cancel
Showing results for 
Search instead for 
Did you mean: 

Wakeup on GPIO in Linux on STM32MP1

RPiet.1
Associate II

Hello. I am working on standby/wakeup using gpio pin in stm32mp1 custom board. Going to sleep works well using gpio-keys but I can't wakeup. What bothers me most is that interrupt responsible for waking up does not set "waleup" attribute although it is defined in DTS as wakeup-source. I am not sure whether I correctly understand the concept behind exti_pwr and pwr_irq nodes so if there is anyone who can help me with a proper setup I would appreciate your help. Please find enclosed DTS.

 gpio_keys {

  compatible = "gpio-keys";

  #address-cells = <1>;

  #size-cells = <0>;

  autorepeat;

  input-name = "gpio-keys";

   button@1 {

    label = "Suspend";

    linux,code = <205>;

    gpios = <&gpioi 6 GPIO_ACTIVE_LOW>;

   };

   button@2 {

    label = "Wakeup";

    linux,code = <143>;

    interrupts-extended = <&exti_pwr 55 IRQ_TYPE_EDGE_RISING>;

    wakeup-source;

   };

 };

};

&pwr_irq {

 wakeup-gpios = <&gpioi 6 GPIO_ACTIVE_HIGH>;

};

11 REPLIES 11

I'm not sure, but according to AN5109 (and AN5284), the choice of deepest mode is automatic and depend on the activated wakeup source.

e.g. if UART is defined as wakeup, the "echo 'mem' > /sys/power/state" command will go in LP_STOP.

Same command will go in LPLV_STOP if GPIO wakeup source is used.

I think in your example above for GPIOI6, you should use:

    interrupts-extended = <&exti_pwr 6 IRQ_TYPE_EDGE_RISING>;

because GPIOI6 interrupt is tied with EXTI event 6.

See "EXTI events" Table in Reference Manual (RM0436).

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

That sound reasonable I must have omitted that. I am setting the wakeup source of gpio from dts not from sysfs to maybe this differ somehow. Nevertheless I will try to test it more.