Hi,
I am currently putting things together with my MSP430-LaunchPad-based weather station (https://plus.google.com/u/0/photos/+TomekLorek/albums/5936572393229426625?authkey=CJ3N8Y2CtJiOIQ) that is pretty much already working, reporting data from 4 sensors via GSM etc. It is going to be solar-powered (already working as well with a Phocos CA-08 controller and a lead-acid batteries) but the last thing I'd like to do before deploying it in the field is remote flashing. I have written the code myself but still am quite new to microcontrollers especially when it comes to booting.
A quick chat with a friend ended up with the following idea:
- the MSP430 operates with two images: a bootloader (the minimal code that is always ran upon BOR) and the "application" image that is loaded by bootloader
- the bootloader image is static, well tested, not upgradable remotly and it is going to be executed as the first what the MSP430 does upon power up. Everytime it will communicate the website via GSM modem (via UART) to look for the new "application" image, then compare to what was flashed previously (e.g a timestamp stored in the information memory of the flash), download it and in program onto the flash starting from a specific address. Then it's going to make MSP430 to run this application image (checkpoint 1).
In case the application is faulty or the programming didn't go well (e.g due to the power loss) then the bootloader will simply run again (reset triggered by a watchdog probably) and flash the application image again. The assumption is the bootloader area is not damaged (checkpoint 2).
The 128kB of flash on F5529 with my 20kB of application image is enough for such solution. I can even back up the last-working configuration :) I have some questions though:
1. does it look ok?
2. does the MSP430F5529 offer a better/easier solution? I started to read about the BSL and still have very vague understanding so I don't know whether it can/should be used of not. The key here is that flashing a faulty image must be self-recoverable, so the code executed from the 0 address must always work.
3. Checkpoint 1 - how to make this code executable? The application image shall be executed at the end of the bootloader execution
4. Checkpoint 2 - can the bootloader flash area be damaged during the power loss? I'm afraid yes, then how to protect?
Thanks in advance for your support!
Best Regards,
tml