Jetson/FAQ/BSP/Nano Wakeup Pin

From eLinux.org
< Jetson‎ | FAQ/BSP
Revision as of 04:09, 20 October 2020 by XiaoLiu87 (talk | contribs) (Created page with "= 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...")
(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
  • Make sure TEGRA_GPIO(G, 3) outside of gpio@6000d000.default.gpio-output property

Set pinmux

  • Set pinmux as below in pinmux@700008d4.common.uart2_cts_pg3 node
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

Create GPIO key to trigger wake up signal

Add following node into gpio-keys node.

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>;
};

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.

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.