rt-thread-official/bsp/stm32/libraries/HAL_Drivers
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
..
CMSIS/Include
config [bsp][stm32] 更新f407-robomaster-c板的bsp, 添加stm32定时器8 pwm默认配置 (#6201) 2022-08-01 00:21:41 -04:00
drv_flash Fix some compilation warning (#5744) 2022-08-02 12:09:49 -04:00
Kconfig
SConscript [stm32][soft spi] implement soft spi (#6078) 2022-06-16 10:54:30 +08:00
drv_adc.c
drv_can.c Modified bsp/stm32/libraries/HAL_Drivers/drv_can.c 2022-09-16 08:36:48 -04:00
drv_can.h
drv_common.c [stm32] add missing void 2022-08-14 21:49:43 -04:00
drv_common.h
drv_config.h
drv_crypto.c
drv_crypto.h
drv_dac.c
drv_dma.h
drv_eth.c [phy] fix the PHY_FULL_DUPLEX conflicts 2022-08-03 22:45:27 -04:00
drv_eth.h
drv_gpio.c Fix some compilation warning (#5744) 2022-08-02 12:09:49 -04:00
drv_gpio.h
drv_hwtimer.c [stm32][hwtimer] add H7 support 2022-06-14 16:11:05 +08:00
drv_lcd.c
drv_lcd_mipi.c
drv_log.h
drv_lptim.c
drv_lptim.h
drv_pm.c
drv_pulse_encoder.c
drv_pwm.c [rt_drv_pwm]完善PWM框架互补输出部分代码 (#6338) 2022-09-01 00:59:44 -04:00
drv_qspi.c
drv_qspi.h
drv_rtc.c RTC STM32F1 Enable PWR and BKP clocks in the same time 2022-09-23 21:04:35 -04:00
drv_sdio.c
drv_sdio.h
drv_sdram.c
drv_soft_i2c.c Fix some compilation warning (#5744) 2022-08-02 12:09:49 -04:00
drv_soft_i2c.h
drv_soft_spi.c [stm32][soft spi] implement soft spi (#6078) 2022-06-16 10:54:30 +08:00
drv_soft_spi.h [stm32][soft spi] implement soft spi (#6078) 2022-06-16 10:54:30 +08:00
drv_spi.c Fix some compilation warning (#5744) 2022-08-02 12:09:49 -04:00
drv_spi.h
drv_usart.c [bsp/stm32] 简化drv_usart中的DMA接收逻辑 (#6357) 2022-09-22 14:13:57 +08:00
drv_usart.h [bsp/stm32] 简化drv_usart中的DMA接收逻辑 (#6357) 2022-09-22 14:13:57 +08:00
drv_usart_v2.c
drv_usart_v2.h
drv_usbd.c
drv_usbh.c
drv_usbh.h
drv_wdt.c