Skip to main content
Visitor II
December 23, 2021
Solved

How to execute code after "wakeup"

  • December 23, 2021
  • 2 replies
  • 2111 views

If I put the system to sleep via the "echo mem > /sys/power/state" mechanism, how can I execute code/script on wakeup event?

Thanks,

Ben

    This topic has been closed for replies.
    Best answer by Olivier GALLIEN

    Hi @BBeck.1​ ,

    I recommend you to read our documentation related to low power management starting from here :

    How to define your low-power strategy - stm32mpu

    Hope it help

    Olivier

    2 replies

    Technical Moderator
    January 3, 2022

    Hi @BBeck.1​ ,

    I recommend you to read our documentation related to low power management starting from here :

    How to define your low-power strategy - stm32mpu

    Hope it help

    Olivier

    BBeck.1Author
    Visitor II
    January 3, 2022
    Oliver,
    Thanks (again)! This is helpful information. BTW, in a document (
    https://wiki.st.com/stm32mpu/wiki/Power_overview) referred to by the LP
    strategy document, there is a reference to another document on the ST
    github (
    https://github.com/STMicroelectronics/linux/blob/v5.10-stm32mp/Documentation/power/interface.rst)
    which is a dead link, and seems to have critical info on wakeup sources.
    Is there another source for this info?
    Thanks,
    Ben Beckwith
    Technical Moderator
    January 3, 2022

    I confirm the dead link. Thanks for pointing it !

    Seems this was ok with previous version kernel 5.4 :

    linux/interface.rst at v5.4-stm32mp · STMicroelectronics/linux (github.com)

    I come back to you asap with further explanation.

    Olivier

    BBeck.1Author
    Visitor II
    January 7, 2022

    Thanks so much for you follow up! I'm on my way to super low power! Thanks to those docs you provided, I've been able to get my system to "hibernate".

    Cheers!

    Ben