Skip to main content
Explorer
August 4, 2020
Question

How to completely disable RTC before entering STOP-Mode on STM32L0

  • August 4, 2020
  • 3 replies
  • 2425 views

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

    This topic has been closed for replies.

    3 replies

    Graduate II
    August 4, 2020

    Did you try e.g. rm0376 7.1.3 RTC and backup registers reset?

    Gera.VAuthor
    Explorer
    August 4, 2020

    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...

    Visitor II
    March 5, 2025

    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);

    Visitor II
    March 5, 2025

    // 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);