Skip to main content
Visitor II
March 8, 2021
Question

Wakeup on GPIO in Linux on STM32MP1

  • March 8, 2021
  • 2 replies
  • 4904 views

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

};

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    March 8, 2021

    Hi,

    PI6 has no WKUP capabilities.

    If you really go in SoC Standby (i.e. VDDCORE shutdown), you must use to wakeup one of the 6 available WKUP pins (e.g. PA0/WKUP1 is used on our DK2/EV1 board).

    See Reference Manual

    See also:

    https://wiki.st.com/stm32mpu/wiki/Interrupt_overview

    https://wiki.st.com/stm32mpu/wiki/PWR_internal_peripheral

    Regards.

    RPiet.1Author
    Visitor II
    March 8, 2021
    I've seen these settings in these dts-es but I thought those i/o pins are arbitrary and any pin can be mapped there. Where those certain pins are mentioned in specification because I haven't seen it ? pon., 8 mar 2021, 17:48 użytkownik ST Community napisał:
    Technical Moderator
    March 9, 2021

    Wakeup capabilities are shown in Reference Manual (PWR section, e.g. in RM0436 Rev.5, Table 33. "System Low-power mode summary", or "PWR exiting from Standby mode" sub-section).

    WKUP pins locations are shown on Datasheet, 6x are present on 18x18 and 12x12 packages, 4x in 16x16 and 10x10 packages.

    I confirm, it is PI8 and PI11 (on some packages), plus PC13, PA0, PA2, PC1.

    They are present in STM32CubeMX, PWR category.

    0693W000008wLytQAE.png

    RPiet.1Author
    Visitor II
    March 10, 2021

    Thank for you support. I have one more question regarding standby. We would like to set certain IO pins with pull-ups or pull-downs during standby but it looks like vddcore is switched off during standby. It looks like in deep standby this is normal but I am wondering how could I go into other LP mode like Sleep so that vddcore is on and gpio pin values will be retained.

    Technical Moderator
    March 10, 2021

    Yes, whenever VDDCORE if OFF (STANDBY), all IOs are hi-z (except some IOs related to VSW domain like those for RTC, TAMP).

    For your case, if you want to avoid external resistors, you could use LPLV-Stop (VDDCORE only reduced, larger power than STANDBY, but GPIO settings and interrupt capabilities are kept).

    Se https://wiki.st.com/stm32mpu/wiki/How_to_define_your_low-power_strategy

    Regards.