-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
Radxa Zero | SSH Crash "Broken Pipe" after exporting UART TX GPIO pin #6354
Comments
Are you sure that this is a valid GPIO number (on mainline kernel)? You mean to do Have you tried using libgpio? apt install gpiod
gpiodetect
gpioinfo
gpioget 0 412 |
Yes, sorry. I edited my post.
Yes although I used the GPIO line instead. It works and won't crash the SSH session. Also, a regular GPIO pin won't turn LOW even with gpiod https://wiki.radxa.com/Zero/hardware/gpio
The direction changed correctly, from input to output, but it won't turn LOW. Am I doing something wrong? |
https://manpages.debian.org/gpioset#l
Seems to be by design, only fixed on RPi recently, lol. You can use the What a strange limitation of this "new" method which shall replace the deprecated sysfs API, which is even disabled by default on mainline kernel, only actively re-enabled on Armbian and RPi kernel, well most distro kernel builds, likely for exactly this reason. |
I must say it's a weird behavior, maybe they thought it would be best to stick the pin to its default value when not toggled specifically. I think this issue can be closed then? Conclusion: use libgpiod to read UART TX GPIO pin state. Edit: |
Generally the gpio sysfs API is deprecated and libgpio seems to be the future, so it generally makes sense to switch with own projects. However, as of the above limitation and since most distros re-enable the sysfs API in their kernel builds by explicitly adding a build config, it may not be suitable in all cases. In any case, using the sysfs API should not crash the system, so this seems to be a kernel bug. Let me reopen to at least try to replicate on Odroid N2+ (same kernel build). |
Sure! Makes sense to keep it open still. |
On Odroid N2 I can export and access GPIO pins via sysfs just fine. However, on Odroid N2 the GPIO and PIN numbers are stirred and do not match docs. There are numbers which shouldn't exist at all and others exist which do not exist in docs: #5644 |
About the Radxa Zero, there is no problem with the pin numbers. |
Creating a bug report/issue
Required Information
6.1.11-meson64 #23.02.2 SMP PREEMPT Sat Feb 18 00:07:55 UTC 2023 aarch64 GNU/Linux
Steps to reproduce
echo 412 > /sys/class/gpio/export
Expected behaviour
Won't cause the SSH session to break
Actual behaviour
client_loop: send disconnect: Broken pipe
Extra details
No idea if I'm doing something dumb.
I think that UART TX spits data out which could cause the thing to break but then how do I check whether its HIGH or LOW?
The text was updated successfully, but these errors were encountered: