IAP problem - user app not working
Hello. I am trying to implement an in application programming to an F303 processor.
I got to a point where I can successfully download a whole new firmware to my desired location (0x08010000) through UART. I checked whether the data are OK with STLINK and there is no difference between the firmware and memory starting from 0x08010000.
The custom firmware should blink the LED but when I make a jump to the user application the LED just lights up and doesn't blink so there clearly must be something wrong.
In my custom 'blink' firmware I changed the linker script so that the FLASH starts from 0x08010000
MEMORY
{RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 40KCCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 8KFLASH (rx) : ORIGIN = 0x8010000, LENGTH = 192K}My 'jump' code:
&sharpdefine USER_PROG_ADDRESS FLASH_BASE+(uint32_t)0x10000
typedef void (*pFunction)(void);
pFunction JumpToApplication;uint32_t JumpAddress;
JumpAddress = *(__IO uint32_t*) (USER_PROG_ADDRESS + 4); JumpToApplication = (pFunction) JumpAddress; __set_MSP(*(__IO uint32_t*) USER_PROG_ADDRESS); JumpToApplication();What am I missing? Did I forget to do something?
#stm32f303 #iap