Ok, I've read the AVR Bootloader FAQ. Very informative!
I have a few questions regarding my needs for an SD card bootloader.
1) If I understood correctly, whatever logic I can write in a standard program to read data from an SD card and get a file can be used in the bootloader (in a separate project without dependencies on the application) to get my firmware file. Is that right? I want to know so I can test my sd card reading code easily in an application then just move that code to a bootloader project.
2) The process I would need to do in such a bootloader would go as such. Do these steps make sense?
- Check if there is an sd card in the socket - If yes, check if the firmware file expected is present - If there is a file, continue to firmware upgrade - Backup the current application to the sd card by reading the application memory - Write the new firmware from the file in the SD card - Verify the firmware written by comparing with the provided file on the sd card. - Once all is honky dorry, call the watchdog to reset the micro - If no firmware upgrade is available, process to start the application.