-
Notifications
You must be signed in to change notification settings - Fork 220
Error handling for setting up pinmux mode in gpio.setup() #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@zsserg Thanks for creating this pull request. I'll test it out tonight. |
@zsserg Unfortunately, I'm traveling right now, but I will review and respond when I'm back home on Thursday (Aug 10). Thanks. |
Testing with @zsserg repo at e86acc4
The issue seems to be with P8_10:
|
Trying to track down the issue with FAIL:
|
The test of To double check, I just installed the latest revision from adafruit repo's master branch and pytest completed without any issues. However, when I investigated with strace, I have found that it is just failing silently. The regression makes sense given the nature of this PR.
@zsserg I'm going to investigate how to resolve the |
What kernel for BB are you using? There have been some breaking changes in sysFS paths between 3.9-4.0 (or 4.0-4.1, I dion't remember exactly). For example, the udev-non-root-gpio-permissions.sh script provided with this repo is not valid any more for 4.4 kernels as some of the sysFS paths are now different. |
@zsserg The kernel is |
Replace GPIO for test "TIMER6" with "P8_10" as TIMERn syntax is not working on newer kernels such as 4.4. This is a valid path: /sys/devices/platform/ocp/ocp:P8_10_pinmux/state while this path is invalid: /sys/devices/platform/ocp/ocp:TIMER_pinmux/state Originally discovered while testing Pull Request #152. See issue #156 for details.
@zsserg thanks. I've merged this and created #156 to address the failed test for GPIO |
I added error handling for the gpio.setup() method in the part where it sets up the pinmux mode. Before it just silently failed if it was unable to write to the corresponding sysfs file.
I also altered underlying set_pin_mode() C function to provide debug output (as it is done in other places) when library is built/run in debug mode