rt-thread/bsp/stm32/libraries
YangZhongQing 1c2d05d545 RTC STM32F1 Enable PWR and BKP clocks in the same time
bsp\stm32\libraries\HAL_Drivers\drv_rtc.c在STM32F10x上有一个“RTC首次上电时BKP时钟没使能”的问题。

STM32F10x要求:
写RTC Domain and RTC registers之前需要__HAL_RCC_BKP_CLK_ENABLE(详见:stm32f1xx_hal_rtc.c里面的##### Backup Domain Access #####)

问题分析:
1、RTC首次上电时:由于HAL_RTC_Init初始化之前没有使能BKP时钟,所以对RTC registers的初始化无效。
2、然后用date命令设置时间,调用到set_rtc_time_stamp也没有__HAL_RCC_BKP_CLK_ENABLE,所以HAL_RTCEx_BKUPWrite写的值无法真正永存于BKP,重启后就丢失。
最终导致:对于RTC首次上电的情况,每次重启后RTC_BKP_DR1里的值都不是BKUP_REG_DATA,导致永远无法调用到rt_rtc_f1_bkp_update()去使能BKP时钟。

解决办法:
参考STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\RTC\Calendar\main.c里面的RTC_Configuration()同时打开RCC_APB1Periph_PWR和RCC_APB1Periph_BKP
2022-09-23 21:04:35 -04:00
..
HAL_Drivers RTC STM32F1 Enable PWR and BKP clocks in the same time 2022-09-23 21:04:35 -04:00
STM32F0xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32F1xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32F2xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32F3xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32F4xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32F7xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32G0xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32G4xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32H7xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32L0xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32L1xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32L4xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32L5xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32MPxx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32U5xx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32WBxx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
STM32WLxx_HAL [stm32] move CMSIS hearder files to common folder (#5998) 2022-06-04 17:05:37 +08:00
templates [bsp][stm32]添加硬石科技YS-F1Pro开发板 (#6364) 2022-09-01 23:06:44 -04:00
.ignore_format.yml [update] ignore_format.yml 2021-11-15 15:31:51 +08:00
Kconfig [update] add stm32u575-st-nucleo bsp. 2021-11-15 11:23:12 +08:00