Skip to main content
path321
Associate II
July 10, 2026
Solved

Is it mandatory to reconfigure clocks after Stop mode ?

  • July 10, 2026
  • 4 replies
  • 94 views

Hi everyone, 

I am facing an long-standing issue with a STM32L476RE-powered device loosing UART frames when waking up from UART3 from Stop Mode (will be analyzed on another issue).

Prompted by this, I have a generic question for clock configuration after Stop1-2 mode.

The device uses HSI & LSE for all of its peripherals, in a bare-metal CubeMX project.

Q1: The function 

__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_HSI);

is called 1 time before while(1){} loop. Should it be called just once or should it be called every time before calling 

HAL_SuspendTick();
HAL_PWREx_EnterSTOP1Mode(PWR_STOPENTRY_WFI);

?

Q2: Should we call 

SystemClock_Config();

every time after waking up from Stop mode, despite the fact that the clock selection ( HSI & LSE ) remains the same and no PLL or MSI is used ?

Q3: Could calling 

SystemClock_Config();
HAL_ResumeTick();

disrupt an ongoing UART-RX ( running on Idle-line callback ) , despite the fact that clock selection is not changing ? 



Thank you in advance

Best answer by Saket_Om

Hello ​@path321 

Q1: The function 

 

__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_HSI);

is called 1 time before while(1){} loop. Should it be called just once or should it be called every time before calling 

 

HAL_SuspendTick();

HAL_PWREx_EnterSTOP1Mode(PWR_STOPENTRY_WFI);

?

 

Calling it once during initialization is sufficient

Please refer to the example below:

STM32CubeH5/Projects/NUCLEO-H503RB/Examples_MIX/PWR/PWR_STOP/Src/main.c at main · STMicroelectronics/STM32CubeH5 · GitHub

 

Q2: Should we call 

 

SystemClock_Config();

every time after waking up from Stop mode, despite the fact that the clock selection ( HSI & LSE ) remains the same and no PLL or MSI is used ?

 

No, calling the full SystemClock_Config() after Stop mode is not recommended 

Please refer to the STM32CubeMX errata 6.14.x section 4.4. 

4 replies

Andrew Neil
Super User
July 10, 2026

The datasheet tells you:

 

So, if that’s the configuration you want after exiting STOP - you don’t need to do anything.

If it’s not what you want then, of course, you will have to reconfigure it,

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
ST Technical Moderator
September 2, 2026

Hello ​@path321 

Has your question been answered?
BR
Gyessine

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
path321
path321Author
Associate II
September 7, 2026

Yes, I am flagging the respecitve “best answer” , thanks

Saket_OmBest answer
ST Technical Moderator
September 3, 2026

Hello ​@path321 

Q1: The function 

 

__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_HSI);

is called 1 time before while(1){} loop. Should it be called just once or should it be called every time before calling 

 

HAL_SuspendTick();

HAL_PWREx_EnterSTOP1Mode(PWR_STOPENTRY_WFI);

?

 

Calling it once during initialization is sufficient

Please refer to the example below:

STM32CubeH5/Projects/NUCLEO-H503RB/Examples_MIX/PWR/PWR_STOP/Src/main.c at main · STMicroelectronics/STM32CubeH5 · GitHub

 

Q2: Should we call 

 

SystemClock_Config();

every time after waking up from Stop mode, despite the fact that the clock selection ( HSI & LSE ) remains the same and no PLL or MSI is used ?

 

No, calling the full SystemClock_Config() after Stop mode is not recommended 

Please refer to the STM32CubeMX errata 6.14.x section 4.4. 

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om