STM32 RTC interrupt flag can only be cleared manually

background:

  Stm32 recently doing a project which uses real-time clock function of the RTC. 32.768K external crystal clock source, clock prescaler is set to 32767, the purpose is to generate an interrupt 1 second, then the real-time interrupt handler updates the date of seconds.

solution:

  However, due to lack of experience, RTC interrupt handler does not use RTC_ClearITPendingBit (RTC_IT_SEC) interrupt flag will be cleared, causing the program after NVIC_Init () function has been to jump to interrupt, the following code can not be executed.

in conclusion:

  After the second interruption by manually clear the flag solved the problem. STM32 description of RTC interrupt flag can not be cleared automatically must be manually cleared, there would be the situation.

Guess you like

Origin www.cnblogs.com/wzzgeorge/p/11564347.html