I have an application and want to jump to ST bootloader. It does not work and it seems to jump back from bootloader.
From AN2606, STM32F042 should jump to 0x1FFFC519, but the system address is 0x1FFFC400,I think I still need use 0x1FFFC519.
User can jump to the System Memory Bootloader from his application code using thefollowing entry point:0x1FFFC519 (Thumb mode)
I suspect it may related to valid code in bank, and cause a second jump back to application.
Does ST has some proved solution for this kind MCU?
Here is my code:
void jumpToSTBootloader()//called from first line of main
#define ApplicationAddress 0x1FFFC519
typedef void (*pFunction)(void);
uint32_t JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4);
pFunction Jump_To_Boot = (pFunction) JumpAddress;
// Disable used PLL
SysTick->CTRL = 0; // Reset the Systick Timer
SysTick->LOAD = 0;
SysTick->VAL = 0;
/* ARM Cortex-M Programming Guide to Memory Barrier Instructions.*/
/* Remap is bot visible at once. Execute some unrelated command! */
__set_MSP(*(__IO uint32_t*) ApplicationAddress);