Skip to main content
Visitor II
December 2, 2020
Question

Issue on HAL_Delay after jump from bootloader

  • December 2, 2020
  • 3 replies
  • 2451 views

Hi,

I am working on STM32F401VE, I recently wrote a bootloader program, which is doing its job of jumping to a specified location. 

Now my bootloader(at addr 0x08000000) is able to jump to my main application(at addr 0x08020000 ), but when I see my main application getting executed , It stops at the very first HAL_Delay() statement. (i try to remove HAL_Delay, but i have a problem on sleep mode)

On Bootloader, my SCB->VTOR = 0x08000000, and on my application 0x08020000 ;

If i launch my application without bootloader at addr 0x08000000, everything is ok.

Can anyone please help me? 

Regards,

Pascal

    This topic has been closed for replies.

    3 replies

    Super User
    December 2, 2020

    "stops" means what? Endless loop? Fault? HAL_Delay waits for a counter to reach a certain value. The counter is incremented by SysTick. Is SysTick handler running?

    Graduate II
    December 2, 2020

    Did you disable interrupts and then forget to enable them?

    PChig.1Author
    Visitor II
    December 2, 2020

    Hi,

    I found the solution, I need to add two line at the main.c

    SCB->VTOR = 0x8020004 and not 0x8020000 (not sure to understand why )

    and

    __enable_irq();

    Thanks for all

    Pascal

    Graduate II
    December 2, 2020

    Sure it is the latter rather than the former.

    The VTOR is generally required to be on a 512-byte boundary for most STM32, as the core simply doesn't hold/use the lower order bits when it does the address substitution.