cancel
Showing results for 
Search instead for 
Did you mean: 

Embedded bootloader and HAL

TheRaprus
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

3 REPLIES 3
Imen.D
ST Employee

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

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
TheRaprus
Associate III

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.

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
Up vote any posts that you find helpful, it shows what's working..