Configuring GPIO pin as an SC7 Wake Pin for TX2

Could someone point me to some instructions for configuring a GPIO pin to be an SC7 wake pin for the Jetson TX2. In particular, I am trying to configure the CAN_WAKE pin (C20). I came across the below post, which configured a GPIO pin on a TX1 to be a wake pin, but I wanted to make sure that the process would be similar for the TX2. Also, it would be great if I could configure this pin without having to do a complete reflash so I could keep my current OS unchanged.

https://devtalk.nvidia.com/default/topic/1031889/jetson-tx1/configuring-gpio-wake/post/5251076/#

-Ryan

hello electric27,

suggest you refer to TX2 Configuring Pinmux GPIO and PAD chapter for the steps and commands,
you’ll need to perform complete flash since there’s CFG update.
thanks

JerryChang,

I did follow the instructions on the link you sent, however the pin that I set to be a wake pin (GPIO9_MOTION_WAKE in this case) is still not waking the Jetson. I attached a picture that shows the settings used for the pin that I would like to make a wake pin. Also, I noticed that when I make changes in the pinmux excel file and generate new dtsi files, nothing seems to change in those files other than the filenames in the header. For example, if I change column AT “Wake Pin” from yes to no and then generate new dtsi files, there are no differences in the files. Perhaps this is part of the problem?

Given this issue, it would be great if I could simply decompile the dtb that I am currently using to a dts file and then add just the lines necessary to make GPIO9_MOTION_INT a wake pin. Would you be able to tell me what lines to add/modify by chance?

You can decompile your dtb with dtc:

# First install dtc if not yet done
sudo apt-get update
sudo apt-get install device-tree-compiler

# Extract DT from running Linux:
dtc -I fs /proc/device-tree

# Or from a dtb binary file:
dtc -I dtb file.dtb

I decompiled my dtb into a dts with dtc and then added the following lines at the end of the gpio-keys section, however it didnt work to wake the jetson with the GPIO9_MOTION_INT pin, and now my power button wont even wake the Jetson (only keyboard keystrokes). Can anyone provide some input by chance? I got the address of the GPIO9_MOTION_INT pin for the gpios = <0x1c 0x12a 0x1> line from the Jetson hacks page https://www.jetsonhacks.com/nvidia-jetson-tx2-j21-header-pinout/ for the TX2 J21 where the GPIO9_MOTION_INT address is gpio298 = 0x12a.

gpio-keys {
		compatible = "gpio-keys";
		gpio-keys,name = "gpio-keys";

		power {
			label = "Power";
			gpios = <0x1c 0x38 0x1>;
			linux,code = <0x74>;
			gpio-key,wakeup;
		};

		volume_up {
			label = "Volume Up";
			gpios = <0x1c 0x39 0x1>;
			linux,code = <0x73>;
		};

		volume_down {
			label = "Volume Down";
			gpios = <0x1c 0x3a 0x1>;
			linux,code = <0x72>;
		};

		
[b]		motion_wake {
			label = "Motion Wake";
			gpios = <0x1c 0x12a 0x1>;
			linux,code = <0x8f>;
			gpio-key,wakeup;[/b]
		};
	};

Just wondering if anyone could shed some light on this.