STM32F042 jumps to ST bootloader issue
Posted on February 01, 2018 at 03:03
I have an application and want to jump to ST bootloader. It does not work and it seems to jump back from bootloader.
<LINK NO LONGER ACTIVE>
https://community.st.com/0D50X00009XkYG6SAN
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 Boot
loader from his application code using the
following 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
{
&sharpdefine ApplicationAddress 0x1FFFC519
typedef void (*pFunction)(void);
uint32_t JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4);
pFunction Jump_To_Boot = (pFunction) JumpAddress;
__disable_irq();
// Disable used PLL
HAL_RCC_DeInit();
SysTick->CTRL = 0; // Reset the Systick Timer
SysTick->LOAD = 0;
SysTick->VAL = 0;
/* ARM Cortex-M Programming Guide to Memory Barrier Instructions.*/
__DSB();
__HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
/* Remap is bot visible at once. Execute some unrelated command! */
__DSB();
__ISB();
__set_MSP(*(__IO uint32_t*) ApplicationAddress);
Jump_To_Boot();
while(1);
}
Many thanks
null
