Content originally posted in LPCWare by gendac on Wed Feb 01 00:29:26 MST 2012
We want to update the LPC1343 firmware in the field using the In-System Programming (ISP) feature. This will be done from another processor via the UART.
Is there an example program for implementing ISP? The AutoISP does not seem too relevant as it is using USB and also making use of IAP. The setup as described below I could also not locate in the example and also not the checksum calculation - please direct me to it if it is in there. Otherwise, it would be very helpful to have another example program.
So far we have been able to put the ARM in ISP mode and followed the sequence as explained in the user manual to setup ISP:
- Host sends '?' sync character and waits for response
- Host receives"Synchronized<CR><LF>"
- Host echoes "Synchronized<CR><LF>"
- Host receives "SynchronizedOK<CR><LF>"
- Host responds by sending crystal frequency
- Host receives OK message
Additionally we have used the J command to read the part ID successfully.
The actual programming is still unclear, is this process correct (after the above setup was done)?:
- Send unlock command
- Prepare sectors for write [Sector 0 to 7]
- Erase sectors [Sector 0 to 7]
- Write program to RAM
- Use Go command to execute written program
How is the checksum calculated during the write sequence? The manual states: "The checksum is generated by adding raw data (before UU-encoding) bytes and is reset after transmitting 20 UU-encoded lines." Can someone please elaborate on this, maybe supply an example? Should we start writing at address 0x0000 0000?
The Go command description states the following: "It may not be possible to return to the ISP command handler once this command is successfully executed."
What does this mean? Will you never again be able to enter ISP or only for some time (maybe till the next reset?)