cancel
Showing results for 
Search instead for 
Did you mean: 

Configuration preservation from Boot to Application transition

Kubis438
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

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

View solution in original post

3 REPLIES 3
TDK
Super User

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".
Kubis438
Associate II

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

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