Jump from bootloader not working after porting the application from Keil to CubeIDE
I have ported my application from Keil to CubeIDE and now the bootloader (not ported and still a Keil project) is not jumping to application.
The bootloader is working fine when the application is a Keil project (for many years).
The starting point for the porting has been that the Keil project was created with CubeMX and therefore would be easy to port to CubeIDE, and it was :smiling_face_with_smiling_eyes:.
The new CubeIDE application is working fine when running from debug or if I rewrite the bootloader to do a jump right after an reset without initing anything.
But rewriting the bootloader is not an option since this is a product that's been in the marked for years and updates needs to work with the current bootloader.
This is my jump function:
void start_application(void) { pFunction Jump_To_Application; uint32_t JumpAddress; HAL_SuspendTick(); __disable_irq(); HAL_UART_DeInit(&huart4); HAL_I2C_MspDeInit(&hi2c1); JumpAddress = *(__IO uint32_t*) (FLASH_APPLICTION_START_ADDRESS + 4); Jump_To_Application = (pFunction) JumpAddress;
__set_MSP(*(__IO uint32_t*) (FLASH_APPLICTION_START_ADDRESS)); wd_refresh(); Jump_To_Application(); }
I have verified that the SP and VTOR is correct in the new CubeIDE project.
What else do I need to check?
What is the differences between a Keil project and a CubeIDE project that can cause this not to work?
Any feedback or ideas is appreciated.
