Jetson/FAQ/BSP/Nano Wakeup Pin

From eLinux.org
< Jetson‎ | FAQ/BSP
Revision as of 01:50, 11 December 2020 by XiaoLiu87 (talk | contribs) (Create GPIO key to trigger wake up signal)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Environment

Hardware

  • Jetson Nano

Software

  • JetPack 4.4 (32.4.3)

Use case

Set GPIO(UART1_CTS/PG03) as wake up source to trigger OS resume.

Steps

Note: All changes are in kernel device tree.

Set PG03 GPIO as input

  • Make sure TEGRA_GPIO(G, 3) inside of gpio@6000d000.default.gpio-input property from tegra210-porg-gpio-p3448-0002-b00.dtsi
  • Make sure TEGRA_GPIO(G, 3) outside of gpio@6000d000.default.gpio-output property from tegra210-porg-gpio-p3448-0002-b00.dtsi

Set pinmux

  • Set pinmux as below in pinmux@700008d4.common.uart2_cts_pg3 node from tegra210-porg-pinmux-p3448-0002-b00.dtsi
uart2_cts_pg3 {
    nvidia,pins = "uart2_cts_pg3";
    nvidia,function = "rsvd2";
    nvidia,pull = <TEGRA_PIN_PULL_UP>;
    nvidia,tristate = <TEGRA_PIN_DISABLE>;
    nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};
  • Make sure uart2_cts_pg3 node NOT inside of pinmux@700008d4.unused_lowpower node from tegra210-porg-pinmux-p3448-0002-b00.dtsi.

Create GPIO key to trigger wake up signal

Add following node to tegra210-p3448-0002-p3449-0000-b00.dts.

gpio-keys {
    wakeup_key {
        label = "WakeupKey";
        gpios = <&gpio TEGRA_GPIO(G, 3) GPIO_ACTIVE_LOW>;
        linux,code = <KEY_POWER>;
        gpio-key,wakeup;
        debounce-interval = <30>;
        nvidia,pmc-wakeup = <&tegra_pmc
            PMC_WAKE_TYPE_GPIO 6 PMC_TRIGGER_TYPE_NONE>;
    };
};

Note:

(1) Pay attention of nvidia,pmc-wakeup property, the number 6 means wake up ID of Nano. You can find this ID from Column Y of Nano_Module_Pinmux_Config file which comes from Jetson Download Center.

(2) If you want a key for suspend purpose, please modify linux,code propriety's value as <KEY_SUSPEND>.

Verification

GPIO PG03 is the Num 36 pin of [J41] 40-pin Exp Header on carrier board. Debug UART RX/TX can provide high voltage even OS suspend. Re-build device tree and re-flash to Nano. After boot completed, exec "sudo systemctl suspend" to suspend OS. Connect that 36 Pin and debug uart RX/TX via Dupont wire to wake up OS.