When I was learning about low power consumption before, I encountered some problems with hibernation. The main summary is to stop hibernation.
And, there is a sentence: So, after waking up, the internal clock is used, and the effect shown is that the LED flashes slower. I added a timer to sleep regularly in the code, and found out: although other IOs are in a sleep state, when debugging with JLink, I can see that my timer value is still changing, and the speed is slower than before. a lot. Another phenomenon is that when reading the keys, the displayed results also become messy. In the case found on the Internet, there is a useful function clock (written by myself) to reinitialize. But as a beginner, I still have to change the configuration of the clock, it is better to use SystemInit directly: `void EXTI2_IRQHandler(void)
{
EXTI_ClearITPendingBit(EXTI_Line2);
LED1=1;
SystemInit();
}
`
I can directly dissect this function to solve the problem. In addition, when looking for registers, some registers cannot be found in Chinese manuals and authoritative guides. Finally, I found a detailed introduction to these registers on the information given on the official website. For example: System control register (SCB_SCR) is found in the programming guide STM32F10xxx/20xxx/21xxx/L1xxxx
Cortex-M3 programming manual with the help of netizens. Here is the address and I will upload this pdf below as well.
Link to recommended blog here
Also, there is a recommended blog that goes into great detail about the three types of hibernation. Solved the above problem: link to recommended blog