2020-08-04 12:56 AM
Hello
On an coin-cell application I use the STOP mode twice, once with WakeUp through external interrupts, once with WakeUp through RTC. Everything works fine.
When I enter the STOP mode with WkUp through external interrupts, I need to completely disable & stop the RTC, in order to save power (STOP-mode without RTC would be about 500nA less current).
I tried stopping the RTC, De-Init the RTC, etc., but without effort: RTC keeps sucking power.
Any idea on how to stop & disable in runtime the RTC, so it does not consume the additional RTC-power when MCU in STOP-mode?
Many thanks in advance!
Best Regards
Gerardo
2020-08-04 1:20 AM
Did you try e.g. rm0376 7.1.3 RTC and backup registers reset?
2020-08-04 1:27 AM
Yes, but didn't really help.
Till now, only helps disabling RTC & LSI:
RCC->CSR &= (~RCC_CSR_RTCEN); // disable the RTC clock
RCC->CSR &= (~RCC_CSR_LSION); // disable LSI
But just stopping a peripheral clock in this manner doesn't look to me as the elegant / correct way...
2025-03-05 2:08 AM
I use this to turn off the RTC G031. Nothing on the oscilloscope)
// removing write protection to the RTC domain
PWR->CR1 |= (PWR_CR1_DBP);
// LSE generator shutdown.
RCC->BDCR &= (~RCC_BDCR_LSEON);
// RTC domain reset.
RCC->BDCR |= (RCC_BDCR_BDRST);
2025-03-05 2:33 AM
// removing write protection to the RTC domain
PWR->CR1 |= (PWR_CR1_DBP);
// LSE generator shutdown.
RCC->BDCR &= (~RCC_BDCR_LSEON);
//rtc disable
RCC->BDCR &= (~RCC_BDCR_RTCEN);