Firmware upgradation through GPRS.

I have my target device(LPC2364) which is at remote site. It has SIM300 GPRS modem connected to UART3. My code size is 70kb. And the flash size of LPC2364 is 128kb. Now I wanted to upgrade the firmware of the device through GPRS commands. It has an 8MB external flash connected to the device though SPI.

Whether i wanted to use ISP or IAP. I am very new to this.Kindly suggest me to do this effectively.

Effectively, the process should be either:

Option A:

  1. Send a command to reboot into “firmware upgrade mode”

  2. Download new firmware in packets, verify each packet

  3. Verify code package

  4. Flash to memory

  5. Restart and run new code

Or…

Option B:

  1. Send a command to receive firmware (in currently running firmware)

  2. Download new firmware in packets, verify each packet

  3. Verify code package

  4. Restart into bootloader and instruct to upgrade

  5. Bootloader flashes new program

  6. Restart and run

Thanks Mr…

Let us take the Option A:

Assume that my present running firmware is at location 0x0000 to 0xFFFF.(code size 64k) .

  1. Can i download the code from locatoin 0x10000 to 0x20000.(code size 64k)

2.In reset the MCU searches for application code at sector 0 of flash only.Here my new firmware is at location 0x10000.how or can i change this setting of MCU that it should search for application code at at sector 9 also.(new firmware is at sector 9).

Kindly reply .if u didnt understand my doubt kindly inform i will send it again.

That part really depends on the processor. Most processors have the reset vector at the zero location, so if you can modify that, then you can jump to your code.

The “right” (there are different versions of “right”) way to do it would be to put a bootloader at the bottom of the firmware. You have a location where the firmware is programmed in a specific memory location. After downloading, verifying, and burning the new firmware, you can save the location of the new code, and reset the CPU.

Another way to do it would be to run the upgrade utility out of RAM, burn the flash, and reset. Yet another way (if your processor supports dual bank flash) is to boot from a smaller flash bank, burn the code, and reset.

It’s really dependant on the processor you are working with…