we try to read the value of a pushbutton connected to FORCE_RECOVERY signal of Xavier NX at runtime.
So we try to export gpio_336 as described in GPIO Programming: Using the sysfs Interface | ICS, but for 336 it is not working.
We get following error:
nvidia@nx:~$ echo 336 >/sys/class/gpio/export
-bash: echo: write error: Device or resource busy
we also tried with sudo.
If we try same with other gpios it’s working fine.
if we take a look at:
cat /sys/kernel/debug/gpio
we can see the current value of our pushbutton
“gpio-336 ( |force-recovery ) in hi”
We also checked Pinmux Table: FORCE_RECOVERY, is set to Customer Usage GPIO3_PG.00.
Are we missing something? Is it not intended to export this pin?
I don’t understand, why should we change pinmux?
Our board schematic doesn’t differ from that for Jetson Xavier NX Developer Kit board in this case.
If we take a look at pinmux configuration, FORCE_RECOVERY should be a GPIO.
We could otherwise just set it to unused in pinmux configuration
what does it mean, that this gpio is defined as gpio-keys? What is this gpio used for?
We tried uncommenting these lines and reflashing the device tree, but this did not change the behavior.
we want to use the same pushbutton while boot as recovery button and at runtime as control element.
We already do this with our TX2 device. Here we are able to export the recovery pin as gpio.
Okay I understand it’s used as gpio-keys by software. Does this mean there is a running software which is using it already? Or that it can be used as gpio-key by software? Does gpio-key means it is handled like a keyboard input? I couldn’t find any good explanation to what “gpio-keys” describes.
That’s how we re-flash the devicetree:
sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit-emmc mmcblk0p1
sorry for my late response.
This example helped, so now we are able to see if the key is pressed.
Thank you!
The only downside is that now we have to implement a special solution for it.
Is it also possible to remove this GPIO from the gpio-keys in the devicetree?