Suspend Jetson Nano with push switch

Hi,

I’m trying to suspend the Jetson Nano using a push switch. So far I’ve disabled the auto power-on (jumper between J50 pins 5 and 6) and, using a jumper to mimic a push switch by momentarily connecting PWR_BTN* (J50 pin 12) and GND (J50 pin 11), I can trigger a shutdown.

My question is, is it possible to change the default behaviour so that rather than shutdown, instead the board enters suspend?

I’ve tried the suggestion on this thread Change Behavior of Linux Power Button - Super User and changed /etc/systemd/logind.conf file as follows:

HandlePowerKey=suspend
PowerKeyIgnoreInhibited=yes

but I suspect the GNOME desktop may be overriding it.

Best regards,
Gavin

hello GavinThorn,

please check Jetson Nano Product Design Guide, here’s optional sleep/wake button to indicate the system should enter or exit sleep mode.
BTW, you can use this software command to put device enter suspend. $ sudo systemctl suspend
thanks

Hi JerryChang,

Thanks for your help. The Product Design Guide was very useful. Using that document, the Jetson Nano Developer Kit User Guide and the P3449-B01 schematics, I’ve traced the Sleep/Wake pin (240) back to the automation header which I believe is the 12-pin connector, J50 pin 12, on the carrier board.

If the board is awake and I pulse this pin low, the GNOME desktop pops up a dialog with shutdown/sleep options and after a timeout will shut the board down.

If the board is awake and I hold this pin low, the board enters it’s shutdown sequence.

If the board is asleep (suspended) and I pulse this pin low, the board wakes.

If the board has been shutdown and I pulse this pin low (with the auto power on disable link in place), the board powers up.

In our case, the User won’t have access to the desktop or a terminal window so I’m trying to mechanism where short button press will make it sleep (suspend) and a long button press will cause a shutdown.

Best regards,
Gavin

hello GavinThorn,

please check the kernel driver,
$L4T_Sources/r32.5.1/Linux_for_Tegra/source/public/kernel/nvidia/drivers/input/keyboard/gpio_timed_keys.c

there’re three different options available for pressing button for 1-sec, 3-sec and 5-sec,
for example,

        gpio-timed-keys {
                compatible = "gpio-timed-keys";
                power {
                        linux,press-time-secs = <1 3 5>;
                        linux,key-codes = <KEY_DOWN KEY_DISPLAYTOGGLE KEY_ENTER>;
1 Like

Hi JerryChang,

That looks very promising, thank you :-)

Best regards,
Gavin