Skip to main content
Visitor II
January 4, 2024
Solved

STOP mode in STM32F103

  • January 4, 2024
  • 1 reply
  • 2214 views

I'm looking for the low power function of the STM32F103TB. I have some questions about this function:

1. I read the code of the AN2629, there has no interrupt routine code. So when we use the RTC alarm and the PA0 (wake-up pin) to wake up the MCU, where the MCU recover from after the stop mode entering (WFE +NOP)? it starts to implement the RTC interrupt (or EXTI0) or RTC alarm (EXTI17)?  or just to continue to implement after the NOP? I checked the document, I guess it may not cause any interrupt actually, just to wake-up, then to continue to the last instruction (NOP). Is it right? But the corresponding bit is still available, so user should then to check the flag bit to identify which has happened? Is it right?

2. When recover from the stop mode, all the clocks should be re-initialized (configured again). But all of the other registers of the peripheral don't because they are keeping the values. is it right?

3. Do I need to disable the (global) interrupt before enter the stop mode, so it could avoid to interrupt occurs when waked-up but all of the recover (re-config the clocks) is not yet done. 

    This topic has been closed for replies.
    Best answer by Pierre_Paris

    Hello @HF.Wang,

    Thank you for your questions !

    Here some answers :

    1. Just to be aligned, you are talking about "Chapter 7 - Using the Stop and Standby mode in battery operated applications". The application uses Auto-wakeup (AWU) from low power mode, RTC wakeup without depending on a external event. To wakeup from Stop mode with an RTC alarm event, it is necessary to:
    ● Configure the EXTI Line 17 to be sensitive to rising edge
    ● Configure the RTC to generate the RTC alarm

    Yes it continue to the last instruction whereas after waking up from Standby mode, program execution restarts in the same way as after a Reset. Yes, you can check WUF=1 (A wakeup event was received from the WKUP pin or from the RTC alarm). This bit is set by hardware and cleared by hardware, by a system reset or by setting the
    CWUF bit in the Power control register (PWR_CR).

    2. In Stop mode the regulator supplies low-power to the 1.8 V domain, preserving contents of registers and SRAM. 

    3. No, you must configure system clock and also, don't forget to resume the systick.

    Here two documents you can check RM0008 (table 14 in chapter 5.3.4) and the Getting Started with PWR.

    Best Regards,

    Pierre

    1 reply

    ST Employee
    January 4, 2024

    Hello @HF.Wang,

    Thank you for your questions !

    Here some answers :

    1. Just to be aligned, you are talking about "Chapter 7 - Using the Stop and Standby mode in battery operated applications". The application uses Auto-wakeup (AWU) from low power mode, RTC wakeup without depending on a external event. To wakeup from Stop mode with an RTC alarm event, it is necessary to:
    ● Configure the EXTI Line 17 to be sensitive to rising edge
    ● Configure the RTC to generate the RTC alarm

    Yes it continue to the last instruction whereas after waking up from Standby mode, program execution restarts in the same way as after a Reset. Yes, you can check WUF=1 (A wakeup event was received from the WKUP pin or from the RTC alarm). This bit is set by hardware and cleared by hardware, by a system reset or by setting the
    CWUF bit in the Power control register (PWR_CR).

    2. In Stop mode the regulator supplies low-power to the 1.8 V domain, preserving contents of registers and SRAM. 

    3. No, you must configure system clock and also, don't forget to resume the systick.

    Here two documents you can check RM0008 (table 14 in chapter 5.3.4) and the Getting Started with PWR.

    Best Regards,

    Pierre