STM32 RTC 库函数 RTC

    技术2022-05-19  22

    在使用 STM32 系列 MCU 的时候

    发现,使用库函数

     

    RTC_SetCounter (0);

    RTC_WaitForLastTask();

     

    后系统就一直处于等待状态,

    进入了一个死循环, 通过查资料发现在

    RTC_SetCounter (0);

     

    // Check if the Power On Reset flag is set   RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);

       /* Allow access to BKP Domain */   PWR_BackupAccessCmd(ENABLE);    /* Wait until last write operation on RTC registers has finished */   RTC_WaitForLastTask();

     

    这样就可以了~! 


    最新回复(0)