I have a bootloader used 3 years ago on 2020 on STM32F437 and it works perfectly.
This year, I am trying to use the same bootloader on STM32F205 but got problem that after the jump, the Application is not running.
After a long time debugging I found the Application is stuck in HAL_Delay()and osDelay().
So, I manually added the __enable_irq() in the beginning of the Application code and it magically works.
I know I have __disable_irq(); in the Bootloader code but the problems really confused me are:
You don't have to use __disable_irq() at all. What you NEED to do is stop all the *** you have running that's causing interrupts at a peripheral level, because the RAM and all the peripheral instances in it are going to be completely remapped via the new app and how the linker allocated the resources, and then likely zero'd or initialized. If you do the appropriate tear-down this isn't going to be an issue, and you won't get Hard Faults.
The MCU doesn't come out of reset with IRQ's disabled, IRQ's are enabled, there's just nothing in the NVIC and none of the peripherals are banging off interrupts. Code built in startup.s and beyond doesn't expect the IRQ to be disabled at an MCU level. You will need to enable them if you disabled them