We are trying to calling the STM32 SystemMemory Bootloader from our application,
but we encountered some problems.
In order to make bootloader working, it's necessary to do some stuff before : (from ST documentation)
Disable all peripheral clocks
• Disable used PLL
• Disable interrupts
• Clear pending interrupts
Here is my function which enters in bootloader mode :
Code: Select all
void enter_bootloader_mode()
{
chSysDisable();
//shut down any tasks here ...
uint32_t application_address = 0x1FF01FFE; //corresponding to stm32l152RE <=== code crash here
__set_MSP( * (__IO uint32_t*) application_address);
bootJump = *(__IO uint32_t*) (application_address + 4);
bootJump();
while(1);
}
But, every time, debugger stop at :
__set_MSP( * (__IO uint32_t*) application_address)
and I get a : _unhandled_exception(void) { ... }
in vectors.c
apparently, reading address 0x1FF01FFE is not permitted ..
Have you any ideas about what is occurring ?
Thanks in advance for any help ..
Geoffroy