I’m looking to migrate a project from a Raspberry Pi to the Jetson Nano and one behavior I’d like to cross over is the ability to pull a pin high after the Jetson has safely shut down. For the Raspberry Pi I simply put dtoverlay=gpio-poweroff,gpiopin=17
in /boot/config.txt
. I did a bit of research and the only lead I have so far is setting “pinmux” configurations by flashing the Jetson. However, I couldn’t find any descriptors that seemed to give the behavior I want.
What I need precisely is any single pin on the GPIO header to flip high (and stay high) to at least 3.3V after a shutdown (not a reboot) routine completes.
Thanks in advance!
hello woz4tetra,
there’re several approaches for your reference to access GPIO for usage.
- you may control GPIO pin via system nodes, shown some sample to export pin for controlling.
* Generate gpio220 name
echo 220 > /sys/class/gpio/export
* Configure GPIO manually
echo 1 > /sys/class/gpio/gpio220/value
- please access L4T sources via download center. check below header file for GPIO APIs.
you may have implementation and control them in the kernel drivers.
for example,
$L4T_Sources/r32.4.2/Linux_for_Tegra/source/public/kernel/kernel-4.9/include/linux/gpio.h
static inline int gpio_get_value(unsigned int gpio)
{
return __gpio_get_value(gpio);
}
static inline void gpio_set_value(unsigned int gpio, int value)
{
__gpio_set_value(gpio, value);
}
- you may also refer to Jetson-gpio python library, whihc enables the use of Jetson’s GPIOs.
thanks