OpenBootloader release binary is not working but the debug binary does work
Hi Community,
I have a customized OpenBootloader that works well in debug build but is not working when the same is built for release. After some investigation, it was found that execution hitting hard fault at OPENBL_FLASH_JumpToAddress when OpenBootloader_DeInit() is executed which in turn calls HAL_RCC_DeInit().
What may be the reason it is not working in the release build?
Please find the OPENBL_FLASH_JumpToAddress implementation:
void OPENBL_FLASH_JumpToAddress(uint32_t Address)
{
Function_Pointer jump_to_address;
/* Deinitialize all HW resources used by the Bootloader to their reset values */
OpenBootloader_DeInit();
/* Enable IRQ */
Common_EnableIrq();
jump_to_address = (Function_Pointer)(*(__IO uint32_t *)(Address + 4U));
/* Initialize user application's stack pointer */
Common_SetMsp(*(__IO uint32_t *) Address);
jump_to_address();
}
