AnsweredAssumed Answered

LPC1700 Multiple Images flashed to memory

Question asked by Nicholas Lawrenson on Aug 24, 2018
Latest reply on Aug 27, 2018 by Nicholas Lawrenson

Hi guys,

I am using an LPC1758 (KEIL MCB1700) with uvision 5. I am trying out an alternative to bootloading. Is it possible to flash three separate KEIL projects (HEX or otherwise) to memory.

The plan is to have 2 different applications (Blinky1 and Blinky2) at 2 different locations and have a separate application that will point to and run either of these flashed at address 0x00.

Blinky1 and Blinky2 having already been compiled to a HEX file and verified to work if flashed at address 0x00.

So for example Blinky1 will be located at 0x2000 and Blinky2 will be located at 0x4000 and the third project will run these two functions at these addresses as seen in the code below. (I tried 3 times to format it properly for this forum but can't work it out. Sorry)

#include "LPC17xx.h" #define AP_ADDR 0x2000 // where the user app located #define AP_ADDR2 0x4000 // where the user app located typedef void (*FP)(void); /** run the user application from pre-specified address*/ void Run_Blink1() {         FP fp;         fp = (FP)AP_ADDR;         (*fp)(); } void Run_Blink2() {         FP fp;         fp = (FP)AP_ADDR2;         (*fp)(); } int main(){         while(1){         Run_Blink1();         Run_Blink2();         } }

I'm pretty new to embedded and not quite sure where to start. If this is possible how would one go about separately flashing each of these HEX files at the specified locations?
The idea is that we can use IAP to update a function, sort of like a live firmware update.

 

Thanks in advance for any and all help, even if it's just a link to point in the right direction.

regards Nick

Outcomes