2025-09-15 10:36 AM
I have a question, when I jump from the bootloader to application code from internal flash, I didn't have to disable the interrupt and re-enable them in application, however when I do using the external flash I have first disable then re-enable the interrupt in the application code, otherwise the code just get stuck inside the HAL_InitTick() if i do not disable interrupt in bootloader. It is only that I re-enable the interrupt after SystemClock_Config() function in the application code that my code start working properly as I disable the interrupt from bootloader.
I'm a bit confused why is this the behaviour even though the jumping function is same with the only reason of disabling interrupt in the case of external flash with the reason mentioned above ?
2025-09-15 10:56 AM
This behavior is expected because when running from external flash, the vector table and timing setup differ from internal flash. If interrupts remain enabled during the jump, they may trigger using the wrong vector base before your application has reconfigured clocks and the VTOR register, causing the hang in HAL_InitTick().
Disabling interrupts in the bootloader and re-enabling them in the application after SystemClock_Config() ensures that the application has set up the correct vector table and clock sources before any interrupt fires. That’s why it works correctly in your case.
In short: for external flash boot, always disable interrupts before the jump and re-enable them only after the application has properly configured the system.