Skip to main content
Visitor II
July 3, 2024
Question

STM32 wakeup for unknown reason after enter stop mode when using freertos, need help

  • July 3, 2024
  • 1 reply
  • 853 views

1. stm32F105 + stm32cubemx

2. project was created using freertos by stm32cubemx,no peripheral enabled,and config no use gpio as analog.

3. mcu can go to stop mode normally before os started

4. mcu wakeup for unknown reason when enter stop mode in default task

supgz_0-1719995430759.png

supgz_1-1719995638730.png

 

 

    This topic has been closed for replies.

    1 reply

    ST Employee
    July 3, 2024

    Hello @supgz, welcome to ST community

    Please specify the wakeup source (RTC or LPTIM?) and any other interrupts? 

    WFI will suspend execution until one the following events occurs: 

    • a non-masked interrupt occurs and is taken
    • an interrupt masked by PRIMASK becomes pending
    • a Debug Entry request 

    In the 2nd condition, you need to check your interrupts that can be in pending state which causes the wakeup from lpmode mode 

    supgzAuthor
    Visitor II
    July 4, 2024

    Hi Sarra:

        Thanks for your reply.

        1. I have add breakpoints to NMI interrupts ISR and foundno non-masked interrupt occus

        2. before _WFI, no interrupt is on pending state

        3. I know debug entry request would resume the stop mode ,but not for my situation

        4. Code was generated by stm32cubemx, what I added was just enter stopmode code which was listed on my post. 

    supgz_0-1720092382818.png