Part Number: TMS320F28379D
Hi,
I am new to bootloaders...
I want to make a secondary bootloader that will upload firmware (via SCI) and run it if checksum etc. is okay. I should have 2 application spaces available in the FLASH:
Flash application space 1: This is where the current application is.
Flash application space 2: This is where new firmware is uploaded to.
At the beginning of the firmware upload, I will delete Flash application space 2 to upload new firmware.
Uploading will take place and saves in Flash application space 2.
If the firmware upload fails, then the secondary bootloader will use Flash application area 1 as the current one
If the firmware upload is a success, then the secondary bootloader will switch the two application flash areas. So that no 1 is used for upload and no 2 is used as the current application to be run.
What I don't understand is how this can be done...if it can be done? Because when I make an application I link it to certain flash sectors, bit the secondary will place it in another.
To do this with a backup, will I have to use CPU 1 and CPU2? Or can it be done like this at all?
If I link application version 1 to e.g. FLASHA, and I link application version 2 to FLASHB, and I link application version FLASHA (again), then I get in trouble if a user wants to upgrade from version 1 to version 3 because it is linked to the same memory area. I don't know if I explain myself.
Currently working on the LaunchPadXL with F28379D.
When writing this I came up with another solution. Maybe that is what people do?:
Flash application space 1: Will always be the current application
Flash application space 2: Will always be the backup
After firmware upload, the secondary bootloader will copy area 2 to area 1. If this is interrupted, at the next startup the sec. bootloader will try the same until it succeeds.
Thanks in advance