A consequence of Max's change to the logic to enable access to the backup domain is that every call to enabledbkp(true) must be followed by a matching call to enablebkp(false). There was one cse in both RTCC drivers where that may not always be true.
This commit is contained in:
parent
5d91b8cabb
commit
8b5833f7fe
@ -83,6 +83,10 @@ static inline void stm32_pwr_modifyreg(uint8_t offset, uint16_t clearbits, uint1
|
||||
* Enables access to the backup domain (RTC registers, RTC backup data registers
|
||||
* and backup SRAM).
|
||||
*
|
||||
* NOTE: Reference counting is used in order to supported nested calles to this
|
||||
* function. As a consequence, every call to stm32_pwr_enablebkp(true) must
|
||||
* be followed by a call to stm32_pwr_enablebkp(false).
|
||||
*
|
||||
* Input Parameters:
|
||||
* writable - True: enable ability to write to backup domain registers
|
||||
*
|
||||
|
@ -729,6 +729,12 @@ int up_rtc_initialize(void)
|
||||
/* Remember that the RTC is initialized */
|
||||
|
||||
putreg32(RTC_MAGIC, RTC_MAGIC_REG);
|
||||
|
||||
/* Disable write access to the backup domain (RTC registers, RTC
|
||||
* backup data registers and backup SRAM).
|
||||
*/
|
||||
|
||||
stm32_pwr_enablebkp(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -740,12 +746,6 @@ int up_rtc_initialize(void)
|
||||
rtc_dumpregs("Did resume");
|
||||
}
|
||||
|
||||
/* Disable write access to the backup domain (RTC registers, RTC backup
|
||||
* data registers and backup SRAM).
|
||||
*/
|
||||
|
||||
stm32_pwr_enablebkp(false);
|
||||
|
||||
if (ret != OK && nretry > 0)
|
||||
{
|
||||
rtcinfo("setup/resume ran %d times and failed with %d\n",
|
||||
|
@ -1028,6 +1028,12 @@ int up_rtc_initialize(void)
|
||||
/* Remember that the RTC is initialized */
|
||||
|
||||
putreg32(RTC_MAGIC, RTC_MAGIC_REG);
|
||||
|
||||
/* Disable write access to the backup domain (RTC registers, RTC
|
||||
* backup data registers and backup SRAM).
|
||||
*/
|
||||
|
||||
stm32_pwr_enablebkp(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1039,12 +1045,6 @@ int up_rtc_initialize(void)
|
||||
rtc_dumpregs("Did resume");
|
||||
}
|
||||
|
||||
/* Disable write access to the backup domain (RTC registers, RTC backup
|
||||
* data registers and backup SRAM).
|
||||
*/
|
||||
|
||||
stm32_pwr_enablebkp(false);
|
||||
|
||||
if (ret != OK && nretry > 0)
|
||||
{
|
||||
rtcinfo("setup/resume ran %d times and failed with %d\n",
|
||||
|
Loading…
Reference in New Issue
Block a user