cancel
Showing results for 
Search instead for 
Did you mean: 

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

supgz
Associate

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

 

 

2 REPLIES 2
Sarra.S
ST Employee

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 

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.

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