Skip to main content
michi_22
Associate
October 21, 2022
Solved

Bug STM32L452CEU6 Internal WakeUp using RTC using CubeMX

  • October 21, 2022
  • 2 replies
  • 883 views

Hi All

I switched form a STM32L412CBU6 to a STM32L452CEU6 MCU and created therefore a new project. The enable of the Internal Wakeup with RTC is not generated anymore into the rtc.c file using CubeMX Version 6.6.1. (I'm using the option seperte .c/.h file in the code generation setting tab).

This topic has been closed for replies.
Best answer by Semer CHERNI

Hello @MHoh.1l​ 

First let me thank you for posting.

After investigation I was able to reproduce the same behavior using the same environment as you did.

As a temporary solution I propose that you add the following instructions in the void MX_RTC_Init(void) function in the rtc.c file:

 /* USER CODE BEGIN RTC_Init 2 */
 /** Enable the WakeUp
 */
 if (HAL_RTCEx_SetWakeUpTimer(&hrtc, 0, RTC_WAKEUPCLOCK_RTCCLK_DIV16) != HAL_OK)
 {
 Error_Handler();
 }
 /* USER CODE END RTC_Init 2 */

This is an example of implementation of the solution; you can set the wakeup clock divider and the counter value as you need and pass the values to HAL_RTCEx_SetWakeUpTimer function.

With this being said, this problem is raised internally to be reviewed. I'll keep you posted with the updates.

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

Thx

Semer.

2 replies

Semer CHERNI
ST Employee
November 1, 2022

Hello @MHoh.1l​ 

First let me thank you for posting.

After investigation I was able to reproduce the same behavior using the same environment as you did.

As a temporary solution I propose that you add the following instructions in the void MX_RTC_Init(void) function in the rtc.c file:

 /* USER CODE BEGIN RTC_Init 2 */
 /** Enable the WakeUp
 */
 if (HAL_RTCEx_SetWakeUpTimer(&hrtc, 0, RTC_WAKEUPCLOCK_RTCCLK_DIV16) != HAL_OK)
 {
 Error_Handler();
 }
 /* USER CODE END RTC_Init 2 */

This is an example of implementation of the solution; you can set the wakeup clock divider and the counter value as you need and pass the values to HAL_RTCEx_SetWakeUpTimer function.

With this being said, this problem is raised internally to be reviewed. I'll keep you posted with the updates.

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

Thx

Semer.

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.
michi_22
michi_22Author
Associate
November 9, 2022

Hi Semer

Thanks for your reply. I already impelmented it as shown by your example.

Best regards,

michi