Firmware updates

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by jdurand on Thu Nov 01 20:07:47 MST 2012
I'm porting code over to an LPC1226 and am having trouble figuring out how to do it.  Up to this point all my LPC projects haven't needed field updates but now I'm getting to the products that require it.

On other processors I simply load an encrypted mirror of the update into a cheap external serial flash, then run an assembly routine in RAM that erases all the on-chip flash and copies the new update in.  This has worked well on several brands of processors for many years (since the 1990s).

Now I get to the LPC series where it appears that I can't erase sector 0. If there IS a way, please let me know (I need to have code running THIS weekend).

I have the assembly routing working perfectly up until it tries to erase all of flash.

I've been searching all over and find articles about boot-loaders to copy programs to RAM or load code in odd places.

ALL I want to do is be able to copy my image in just like I was loading it fresh with the SWD.

So, I either need to erase ALL of the flash or have a way to move my code up one sector and re-map the vectors (PIA!).

Is there an application note on how to do this (or better, just tell LPCXpresso to handle it)?

ISP is NOT an option.  Not secure, we would never allow that. Also each product checks if an update is authorized (maybe you didn't pay for that version of code, you have code for the wrong product, etc.).

Once I get this working, it would be nice to know why the SWD/ISP can erase sector zero but IAP can't.  Since I can erase the rest of the part it seems pointless to lock one sector.

I'm off to continue researching this.