SLEEP/WAKE# pin functionality in Jetson TX2 NX

Hi Everyone,

I am working on Jetson TX2 NX. PIN NO ;240 SLEEP/WAKE# of Jetson TX2 NX is interfaced with a controller GPIO pin to wake the jetson from sleep mode.To move Jetson to sleep mode I am using sudo systemctl suspend command.And upon a specific activity,controller will give a low from high to wake up jetson and make the state back to high.Using the command jetson sleep is working fine and using SLEEP/WAKE# to wake up jetson from controller is also working fine.But If jetson is up and active and sudden high to low transition from controller power down the Jetson. Jetson SHUTDOWN_REQ goes to low from high .Is this expected behavior or can we correct it?

Are you testing on custom design board? Did you try it on devkit? A short low phase of SLEEP/WAKE# pin will let system to enter sleep mode.

Hi @Trumany ,

Thank you for the quick response.I am testing on a custom design board.In my case a low signal of SLEEP/WAKE# pin when nvidia is awake is causing power down.Can we keep the nvidia as such without power down and sleep in this case.Because I am using that pin only for waking up nvidia if nvidia is in sleep[by issuing the sleep command]?

Hi @Trumany ,

I’ve come across another observation. In an attempt to reduce boot time, I made use of the following Linux command to disable the desktop manager:

sudo systemctl set-default multi-user.target

Upon re-enabling the desktop manager, I’ve noticed that the power-down issue with Nvidia, specifically when transitioning from high to low or low to high signal from controller while Nvidia is active, seems to have been resolved. However, I’m seeking clarity on the correlation between the NVIDIA Sleep/Wake functionality and the desktop manager. As previously mentioned, my requirement for the sleep/wake pin is solely intended for waking up NVIDIA if it happens to be in sleep mode. Other transitions should not prompt NVIDIA to power down or enter sleep mode. Could this be achieved with the desktop manager disabled?
I have tried the below dtsi configuration for configuring SLEEP/WAKE# pin of NVIDIA as wake pin only

wakeup {
label = “Wake-Up_BTN”;
gpios = <&tegra_aon_gpio TEGRA_AON_GPIO(FF, 0) GPIO_ACTIVE_LOW>;
linux,code = <KEY_WAKEUP>;
gpio-key,wakeup;
};
File path : hardware/nvidia/platform/t18x/lanai/kernel-dts/common/tegra186-p3509-0000-cvb.dtsi

I am not observing the above power down issue.But wake functionality is not working.

Your insights and guidance on this matter would be immensely appreciated.Kindly help me .

Thank you in advance for your support.

Hi,

Could you make a brief summary about what you want to do here?

Hi @WayneWWW ,

I want to configure SLEEP/WAKE# as a wake pin only, removing its power key functionality. Is that possible?

So you removed the original linux,code and it cannot wake up the board?

Was it able to wake up when it was “KEY_POWER”?

No.Wake functionality is working when SLEEP/WAKE# was configured as KEY_POWER.but if nvidia is active and low to high or high to low pulse causing the shutdown of nvidia when nvidia desktop manager is disabled
sudo systemctl set-default multi-user.target

.I have to remove desktop manager as it is taking much time to boot up nvidia.

if nvidia is active and low to high or high to low pulse causing the shutdown of nvidia when nvidia desktop manager is disabled

I don’t really know what is “nvidia” you are talking about here. This platform is called Jetson.

Are you talking about jetson…? If so, try to use the correct word first… otherwise I am really confused by what you want to say here.

I already mentioned that I am working on NVIDIA Jetson TX2 NX .That’s why I used NVIDIA word

Sorry that I tried to understand what is your exact problem but I still cannot.

No.Wake functionality is working when SLEEP/WAKE# was configured as KEY_POWER

Ok, wake up is working if KEY_POWER is set for gpio keys.

If jetson is active and low to high or high to low pulse causing the shutdown of jetson when jetson desktop manager is disabled

Does the low to high mean the power button here?

So if desktop is present, then pressing the key will lead to wake up, but if desktop is not there, then it will directly lead to power off?

That is what you are saying?

Hi @WayneWWW ,

In my custom board , SLEEP/WAKE# pin of Jetson TX2 NX is connected to a GPIO Pin of Micro controller. If Jetson is in sleep[sudo systemctl suspend command is using to put Jetson TX2 NX in sleep mode], wake functionality is working upon giving an active low signal from controller in both desktop enabled and disabled case.

But if Jetson is awake and low to high or high to low pulse from controller causing Jetson to shutdown[ This is happening only when desktop manager is disabled].

Hi,

Ok. So what is Jetson’s GPIO pin in use here? Also TEGRA_AON_GPIO(FF, 0)?

Yes .these are the current dtsi configuration:[file path :hardware/nvidia/platform/t18x/lanai/kernel-dts/common/tegra186-p3509-0000-cvb.dtsi

power_key {
label = “power-key”;
gpios = <&tegra_aon_gpio TEGRA_AON_GPIO(FF, 0) GPIO_ACTIVE_LOW>;
linux,code = <KEY_POWER>;
gpio-key,wakeup;
};

I need above jetson pin ie SLEEP/WAKE# pin only to wake Jetson if it is in sleep mode.Is that possible?

Are you able to reproduce same behavior on NV devkit? So that we can debug on our side too.

Hi @WayneWWW ,

Sorry .Unfortunately, I couldn’t test this on NX dev kit due to the unavailability of the developer kit . Despite this limitation, I attempted to replicate the conditions using an alternative custom board featuring Xavier NX. The shutdown issue persisted even after disabling the desktop manager.

So, to reproduce this issue

  1. Disable the desktop GUI
  2. Jetson is not in suspend mode
  3. Change the gpio-keys from linux,code = <KEY_POWER> to <KEY_WAKEUP>

result: press button will lead to direct power off.
if device is in suspend mode, this will trigger wake up.
if device does not disable GUI, and not in suspend mode, it will trigger sleep but not power off?

Hi @WayneWWW ,

There is a small correction : current gpio-keys from linux,code = <KEY_POWER> .That is I am observing issue with this configuration.

And if device does not disable GUI, and not in suspend mode it will not go to sleep mode.it will be active only.

When I Changed the gpio-keys from linux,code = <KEY_POWER> to <KEY_WAKEUP> wake functionality is not working.

So let me just double confirm again.

  1. Disable the desktop GUI
  2. Jetson is not in suspend mode
  3. gpio-keys linux,code = <KEY_POWER>

result: system directly goes to power down.
But wake up is working fine if above situation is suspend mode.
If GUI is enabled, then system won’t go to power down. What would you see there? A hint on screen to ask whether you want to shutdown?

Yes correct .

If GUI is enabled, then system won’t go to power down. What would you see there? A hint on screen to ask whether you want to shutdown?

Ans : There is no hdmi support for my custom board . But from systemd-logind service I am getting a print as “power-key pressed” if desktop is enabled.if desktop is disabled i am not getting even that print directly going to shutdown