I need to configure GPIO02 as wake up pin

I have to use GPIO02 as wake pin in Jetson TX2NX. I chose this pin from Jetson TX2NX series pinmux table. How do I configure GPIO02 as wake up?

hello user9329,

please refer to developer guide, Pinmux Changes.
there shows the steps to modify the pinmux spreadsheets and update the board configuration.
thanks

1 Like

Hi JerryChang,
I have made the necessary changes in the spreadsheets. I should also make changes in the device tree, right? If yes, how should that be configured?

hello user9329,

you should clock the button on the top-right to generate *.dtsi files.
please moving those to your host machine, (i.e. x86 flashing machine) and execute pinmux-dts2cfg.py to convert it as cfg file for flashing.
please use the cfg file and full-flash the target to apply the changes.

1 Like

Hi JerryChang,

Already this pin is set as GPIO pin and know it can be used as a wakeup pin .But
I need to know how to configure this wakeup pin in Jetson TX2NX as wakeup. I will share pinmux spreadsheet of the GPIO02

Also ,I saw how to configure gpio as a wakeup interrupt for Jetson Nano.I will share the link .Is there a similar method for here?

yes, please try to add gpio-keys{...} implementation into your device tree.

Hi JerryChang,
Thanks for the information.Could you pls tell the location to add gpio-keys{…}

hello user9329,

please check below sources to add your implementation,
i.e. $L4T_Sources/r32.6.1/Linux_for_Tegra/source/public/hardware/nvidia/platform/t18x/lanai/kernel-dts/common/tegra186-p3509-0000-cvb.dtsi

Thanks a lot JerryChang .

Hi JerryChang,
I made specific changes in the device tree in this location .pls find
the pic.

.
Here we configure GPIO(L ,0) as Wake up pin and GPIO(FF ,0) as sleep pin.

I flashed the board and access the board through picocom .As per the usecase ,If I short the sleep pin terminal should be stuck ie,it is going through sleep mode. When I short wake up pin it should come from that sleep mode.

But here ,when I access the board through picocom after shorting the sleep pin immediately it is coming out from the board.ie ,like a reboot process.
I dont know why its like this?
I tried many times.Sill not working.
Could you pls help me in solving this.
I will share the current output.

hello Merry,

it’s Jetson TX2 NX, right?
please also refer to Jetson TX2 NX Product Design Guide, you should have pin-240 as optional Sleep/Wake Button.

could you please have another try to use software commands for entering deep sleep.
for example, $ sudo systemctl suspend.
after that, please use this pin to wake-up the target.

Hi JerryChang,

Yes .It is Jetson TX2 NX.
Here we use pin 240 as Sleep/Wake Button.I will share it.

.

So for the sleep/wake up pin GPIO(FF,0) is used.

Our usecase is when we short Sleep/Wake pin it should move to sleep mode and after that while shorting wake pin it should come to wake mode.

But here after shorting the sleep pin immediately it is coming out from the board.ie ,like a reboot process. like this

AIS@localhost:~$
FATAL: read zero bytes from port
term_exitfunc: reset failed for dev UNKNOWN: Input/output error
root@7855–VISN–KOCHI1:/home/vkchlt0462#

hello Merry,

this is also used on DevKits, please also access Jetson Nano Developer Kit Carrier Board for reference, you should also check the schematic of P3449 for details.

hello Merry,

BTW,
could you please have device tree configuration as… linux,code = <KEY_SUSPEND>;,

Hi JerryChang,
Will check on it.

Hi JerryChang,
Could you pls tell me where I have to make change in device tree configuration
Is it in linux ,code = <KEY_POWER> or
linux ,code = KEY_SLEEP>

hello Merry,

please replace the gpio-key of your sleep{} options, have a try to use KEY_SUSPEND for testing.

Hi JerryChang,
Will replace it.Thanks

Hi JerryChang ,
I see there is a dedicated pin 240 for Sleep/Wake in TX2 NX. Is it possible to configure this pin as both Sleep and Wake up?
If yes, what changes should i make in the device tree?

hello Merry,

this don’t need configuration on the DevKits.
for example,
you should use a jumper to BUTTON_PWR_ON + GND to enable the power menu, for putting system enter suspend,
when the device is in the suspend, you may use the jumper BUTTON_PWR_ON + GND again to resume the system.