How to soft Shutdown Jetson nano with GPIO

How to shutdown jetson nano with a switch connected to GPIO, I think if I keep plugging off Jetson nano from the power supply to shut it off might reduce the longevity of the device and might corrupt the script it is running In headless mode.

hello shubham.shah09,

why you must shutdown the platform through GPIO?
have you tried to use ubuntu commands, for example, $ sudo shutdown --poweroff.
thanks

I am building a system that should be shut down at the end of the day, so a normal person should be able to turn it off by pressing a switch. It won’t be connected to a monitor @JerryChang

hello shubham.shah09,

you may use SW_SHUTDOWN* to perform a software shutdown control ,
please also refer to Nano PMIC device tree, it has GPIO pin for SW shutdown control with default value as high.
for example,

        i2c@7000d000 {
                nvidia,bit-bang-after-shutdown;

                max77620: max77620@3c {
                            compatible = "maxim,max77620";
                            maxim,power-shutdown-gpio-states = <1 0>;
                            low-battery-monitor {
                                maxim,low-battery-shutdown-enable;
                            };

                            max77620_default: pinmux@0 {
                                                  pin_gpio1 {
                                                          pins = "gpio1";
                                                          function = "gpio";
                                                          drive-open-drain = <1>;
                                                          maxim,active-fps-source = <MAX77620_FPS_SRC_NONE>;
                                                          maxim,active-fps-power-up-slot = <0>;
                                                          maxim,active-fps-power-down-slot = <7>;
                                                  };
                            };
...
                            spmic-default-output-high {
                            gpio-hog;
                            output-high;
                            gpios = <1 0>;
                            label = "spmic-default-output-high";
                        };

BTW,
here’s a similar discussion thread for your reference, controlling Jetson Nano power button headers with Arduino.
thanks

1 Like

Thank you I’ll look into it