LPC812 Reprogramming Over SPI

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Rorrik on Tue Oct 28 09:12:54 MST 2014
I'm trying to configure my LPC812 so that if after we have put it into application we need to change the code, we can do that through our established communication chain without having to physically access the devices. Our main processing unit communicates to the microcontroller over SPI, and in the case where we need to reprogram the microcontroller, we would be sending the new program over the same SPI line we receive communications over. I think I have set up the IAP commands I need to write the received program into flash.

However, it seems to me there are no IAP commands for reading Flash into RAM. I can use an IAP command to invoke ISP mode, but once in ISP mode, where Flash can be read, but I can't find a way to send the commands to the ISP within the program. If there is a way to do this, I would like to know.

My plan B is to simply use the IAP command to write over my current program in Flash, but this approach is more prone to failure, and I would rather not. In plan B, I will need to know where I can begin writing, won't I? Or should I erase the whole flash and write the new program in fresh?