Bootloader on MCU
Hello everyone, i've been coding a bootloader for STM32L072 MCU's, i can download the binary file and write it into FLASH memory from specific address, all this process works, but at the time to jump to the code to be executed, it doesn't work...i checked the memory by debugging and the code has been wrote,so i cannot understand why it doesn't run. have i create a memory area in the .id file?
The firmware has to be placed from 0x8008000, i am not sure if i have to create a specific area for this... like this:
and make section like this...:
the code to jump and check if there is firmware already is the following:
#define FLASH_APP_ADDR 0x8008000
void go2APP(void){
uint32_t jumpAddress;
pFunction jump_to_app;
if(((*(uint32_t*)FLASH_APP_ADDR) & 0x2FFE0000) == 0x20000000){ //Comproba si hi ha una app instalada
//jump to the App
jumpAddress = *(uint32_t*) (FLASH_APP_ADDR + 4);
jump_to_app = (pFunction)jumpAddress;
//Inicialitza el stack de la app
__set_MSP(*(uint32_t*)FLASH_APP_ADDR);
jump_to_app();
}
}When it jumps it makes a hardfault..but i am not sure whether i have to create the APP_MEM area for this purpose or not...
Anyone can help me?¿
thanks a lot.
