Hi,
I need to make my device based on MSP430F5529 (8kB of RAM, 128kB of flash) to be remotely upgradable but it needs to be safe and in case a faulty image is flashed the microcontroller reflashes agin. No external hardware shall be involved as I have only one GSM modem that is connected to the MSP that is going to be upgraded.
My idea is to have the "boot" application stored in the standard place in the flash (1st to be executed upon start) to check for the flash image on the webserver via GPRS and flash it onto the designated flash area of the MSP. Then upon completion it shall execute this newly flashed code. In case the newly flashed code is faulty, the watchdog resets the MSP and the firmware check and flash repeats so that I can upload the fixed firmare and let the device to self-fix.
I have a couple of questions:
- as far as I know the flash controller lets to execute the code from flash and at the same time erase/program the other flash area. This must be a separate 64kB bank if I understand correctly
- when the flashing of the new image is completed how can I execute some entry point of this new code (let's say a submain() function)
- what shall I do with the vector table? The booting code (the one that checks for the new image and programs it on the flash) shall have it's own ISR routines (for example for UART to handle GSM modem and maybe timers) while the newly flashed code shall have it's own vector code (so that I can modify the main code and the ISRs) so how can I control that?
- what is the format of the flash image I should flash? The GSM modem can transmit only characters 0x00-0xFF so the flash image on the web server shall be in text format. How to convert from .elf to this byte format and shall I simply put these bytes one by one onto the flash?
I hope this isn't too much :)
Best Regards,
tml