cancel
Showing results for 
Search instead for 
Did you mean: 

RTC system doesn't work with LSI clock source

george-metasphere
Associate II

When "Activating clock source" is ticked in RTC module, my MCU doesn't start up if I reset it from RST button. But as soon as I switch the RCC clock source to LSE external 32.768khz crystal and change RTC Clock Mux to LSE, it works without a hitch. Is this by design or there may be a bug?

4 REPLIES 4
KDJEM.1
ST Employee

Hello @george-metasphere ;

 

Could you please give more details about your configuration and project?

Are you testing a STM32CubeU3 firmware example? 

I tested the RTC_ALARM example in the STM32CubeU3 firmware. In this example the RTC work with LSI.

After I click on RESET button, I can see that LD2 is turned ON. So, the RTC Alarm is generated correctly.

 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

george-metasphere
Associate II

OK, i found the problem. Apparently this has to be launched early on in the init phase for the system to work properly with reset:

HAL_PWR_EnableBkUpAccess();

There should be a disclaimer or CubeMX should automatically add this in.

KDJEM.1
ST Employee

Hello @george-metasphere ,

 

Thank you for bringing this issue to our attention. I reported it internally for checking.

 

Internal ticket number: 214838 (This is an internal tracking number and is not accessible or usable by customers).

 

Thank you.

Kaouthar

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Also, the following needs to be added at the RTC_Init phase:

  /* Enable Wakeup Pin */
  HAL_PWR_EnableWakeUpLine(PWR_WAKEUP_LINE7,PWR_WAKEUP_SELECT_3,PWR_WAKEUP_POLARITY_HIGH);

  /* Set Calendar Ultra-Low power mode */
  if (HAL_RTCEx_SetLowPowerCalib(&hrtc, RTC_LPCAL_SET) != HAL_OK)
  {
    Error_Handler();
  }