cancel
Showing results for 
Search instead for 
Did you mean: 

STOP mode in STM32F103

HF.Wang
Associate II

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
Pierre_Paris
ST Employee

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

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.

View solution in original post

1 REPLY 1
Pierre_Paris
ST Employee

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

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.