AnsweredAssumed Answered

IAP problem - user app not working

Question asked by Michal Dubovsky on Aug 15, 2017
Latest reply on Aug 15, 2017 by Clive One

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 = 40K
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 8K
FLASH (rx) : ORIGIN = 0x8010000, LENGTH = 192K
}

 

My "jump" code:

#define 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?

Outcomes