Closed cpeppler01 closed 4 years ago
Thanks for reporting this is indeed a bug.
Root Cause Analysis: The VMX-pi HAL for WPI Library Programming fails to allocate DIO Channel Number (WPI Library Channel 21) due to a range-check error in DigitalInternal.cpp. Because the allocation fails, the underlying handle that is returned from the allocation is an "invalid handle" value. When later the "Get" (or any other) method is invoked using that handle, an error is returned. In java, this is handled as an "unclean status" exception, which if unhandled (by default, it is unhandled) will cause the java robot application to abort. This issue only occurs for Digital IO's; the same VMX-pi channel can be used successful for PWM.
To resolve this issue, an updated version of the VMX-pi WPI HAL Library will be required; this will also require an updated KauaiLabs GradleRIO release.
Workaround: Use a different WPI Library Channel # (not 21) for Digital IO instead.
Per Scott's recommendation, I tested with channels 18-20, and they all worked correctly, toggling the relay, whereas channel 21 throws the exception.
This issue is now closed; it's resolved in the 2020 version of the VMX-pi WPI Libraries.
This issue is only valid now for the now-defunct 2019 version of the VMX-pi WPI Libraries.
The test involves using an external relay driven by a 5V Digital Output to power a 12V LED for lighting up vision.
This is what I did:
in in class Robot:
This the result (from Console):
If I comment out the reference to DigitalOutput, all is happy.
(Just a note: I just did a Raspi update/upgrade, and it looks like a new java runtime came down...not sure if that might have an effect.)
Also, not sure where to find //hs_err_pi*.log files. If I could find them, I could attach if that would help find root cause of the problem.
I powered VMX down, opened it up, and rechecked all the jumpers. HiCurrent DIO set to output, all power level jumpers set to 5V.
The code is stripped down to just a single call to allocate the Digital Output on a single channel (wpilib 21, HiCurr DIO physical channel 10). No PWMs.
Version info:
$ java --version openjdk 11.0.7 2020-04-14 OpenJDK Runtime Environment (build 11.0.7+10-post-Raspbian-3deb10u1) OpenJDK Server VM (build 11.0.7+10-post-Raspbian-3deb10u1, mixed mode)
Raspberry Pi 4 Model B Rev 1.2
sudo apt-cache show vmxpi-frc Package: vmxpi-frc Version: 1.1.220 Architecture: armhf Maintainer: Kauai Labs Installed-Size: 500 Depends: vmxpi-hal Filename: ./vmxpi-frc_1.1.220_armhf.deb
sudo apt-cache show vmxpi-hal Package: vmxpi-hal Version: 1.1.220 Architecture: armhf Maintainer: Kauai Labs Installed-Size: 3000 Filename: ./vmxpi-hal_1.1.220_armhf.deb