Battery backed RTC
Posted: Mon Nov 10, 2014 11:14 am
I'm trying to implement a battery-backed RTC on an STM32F051 (RTC2 driver).
I've got a 32768Hz crystal connected, which is oscillating.
Using Chibios 3.
I've set STM32_LSECLK to 32768 in the board header file, and STM32_LSE_ENABLED to true in mcuconf.h
According to the RCC->BDCR register, the LSE clock remains disabled, and the RTC is driven from the on-chip 40kHz oscillator (which agrees with my observations - the RTC is running fast).
From what I've read so far, it looks as if I need to change the RTC backup domain, and there's some promising code in hal_lld_backup_domain_init() in hal_lld.c , but I can't see that it's called anywhere.
Is this something that's currently supported?
I've got a 32768Hz crystal connected, which is oscillating.
Using Chibios 3.
I've set STM32_LSECLK to 32768 in the board header file, and STM32_LSE_ENABLED to true in mcuconf.h
According to the RCC->BDCR register, the LSE clock remains disabled, and the RTC is driven from the on-chip 40kHz oscillator (which agrees with my observations - the RTC is running fast).
From what I've read so far, it looks as if I need to change the RTC backup domain, and there's some promising code in hal_lld_backup_domain_init() in hal_lld.c , but I can't see that it's called anywhere.
Is this something that's currently supported?