cancel
Showing results for 
Search instead for 
Did you mean: 

Bug STM32L452CEU6 Internal WakeUp using RTC using CubeMX

michi_22
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions
Semer CHERNI
ST Employee

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.

View solution in original post

2 REPLIES 2
Semer CHERNI
ST Employee

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
Associate

Hi Semer

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

Best regards,

michi