Skip to main content
Associate II
November 26, 2025
Solved

Configuration preservation from Boot to Application transition

  • November 26, 2025
  • 3 replies
  • 177 views

I have noticed that in my Application project there is no SystemClock_Config() generated by CubeIDE so my guess is that these settings should be inherited from Boot stage. If that is the case, should I also not initialize XSPI interfaces, memories and memory mapped modes if they are also initialized in Boot stage?

Best answer by TDK

Yes. Everything initialized by the bootloader will be in the same state when you jump to the application. You should generally only initialize things once, in this case the bootloader.

Alternatively, you can de-initialize everything before making the jump and re-initialize it in the application.

 

Edit: Also want to note that anything relying on interrupts will need to be disabled as the vector table will surely change between bootloader and application and location of variables is not the same between the two. This includes SysTick.

3 replies

TDK
TDKBest answer
Super User
November 26, 2025

Yes. Everything initialized by the bootloader will be in the same state when you jump to the application. You should generally only initialize things once, in this case the bootloader.

Alternatively, you can de-initialize everything before making the jump and re-initialize it in the application.

 

Edit: Also want to note that anything relying on interrupts will need to be disabled as the vector table will surely change between bootloader and application and location of variables is not the same between the two. This includes SysTick.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Kubis438Author
Associate II
November 27, 2025

So I will delete even HAL_Init() which CubeIDE automaticaly put there, leave there only initialization of periherals which weren't initialized at Boot stage and handle the transition as normal function call, right?

gbm
Principal
November 27, 2025

Wrong, the application's HAL must be stared properly. Jump to the application before anything is initialized in the bootloader, as discussed multiple times during past 2 weeks on this forum. Got through reset, use some flag in RTC/backup registers.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice