Skip to main content
Graduate
April 12, 2024
Solved

Embedded bootloader and HAL

  • April 12, 2024
  • 2 replies
  • 1874 views

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.
    Best answer by Imen.D

    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

    2 replies

    Imen.DAnswer
    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

    TheRaprusAuthor
    Graduate
    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.

    Graduate II
    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.