Skip to main content
TheRaprus
Associate III
April 12, 2024
Solved

Embedded bootloader and HAL

Dear all.

I've implemented a M3 and M4 program ( drive a iLi display and 485 port) now I'm porting it to the H5 (H562RGTX).

One of the latest issue I'm facing is the jump from bootloader to application. In M3/M4 i used only LL, and the jump has no problem, simply work.

On H5 I must use HAL because of the flash (I must read&write: HAL is a must). But if the application use the HAL it crash (somewere). If I use LowLevel it work.  (example with a simple led blinking).

Bootloader use HAL too, and I call HAL_DeInit() before jump (and disable all interrutp, device etc). 

Why HAL don't work in application?

Thanks.

This topic has been closed for replies.
Imen.DBest answer
ST Technical Moderator
April 12, 2024

Hello @TheRaprus , @

Is the vector table aligned with the bootloader address?

Do you set properly the SCB->VTOR?

Please have a look at this tutorial, this will help you on how to perform the jump directly from application code:

How to jump to system bootloader from application ... - STMicroelectronics Community

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

3 replies

Imen.DBest answer
ST Technical Moderator
April 12, 2024

Hello @TheRaprus , @

Is the vector table aligned with the bootloader address?

Do you set properly the SCB->VTOR?

Please have a look at this tutorial, this will help you on how to perform the jump directly from application code:

How to jump to system bootloader from application ... - STMicroelectronics Community

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. Thanks
TheRaprus
TheRaprusAuthor
Associate III
April 12, 2024

Hi Imen.D

I investigated in interrrupt vector table, because also any other interrupt (e.g. USART) crash it.

Re-type the "#define VECT_TAB_OFFSET 0x08020000UL" and now it work!

Probably some typo create the mistake.

Thanks for the help.

Tesla DeLorean
Guru
April 12, 2024

ST *really* needs to learn how to use symbols to assign the vector table address, that way one change in the linker script does the work, and doesn't require #defines in other files to be kept in sync and remembered.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..