This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

bootloader that can be updated safely

Hi

I am seeking inspiration and advise on how to make a fail safe 2 stage bootloader that uses the NOR flash at startup.

The platform is Keystone 1 C6657 evaluation board.

Here are my thoughts on the subject:

The  first stage of the bootlaoder is loaded by IBL and stored in NOR flash (section 0) as a very simple algorithm that should never be updated once the device leaves the factory.

The 2nd stage bootloader is also stored in NOR flash, but because it must be possible to update the 2nd bootloader safely two images of the 2ns boot loader must be stored in 2 seperate sections of the NOR flash.

The first stage of the bootloader must load the 2nd stage bootloader and verify that is is valid before it is launched.

The 2nd stage bootloader is more complex and therefore more likely to need updates, which is why it must be possible to do this in a fail-safe mode. The 2nd stage bootloader shall recieve the main application from an external source that uploads the application via EMIF16 (not the most optimal soultion but this is due to the architecture of our old system that we have to comply with)

The 2nd stage bootloader must also be able to update itself by writing to one section of the NOR flash before it erases the and updates the other section.

I guess the nor_writer example can be used for writing a binary file that contains the first and second bootloader, to the NOR flash. But I am not sure how to integrate the nor_writer example to upgrade only one section in the NOR flash, or how to do it without using the CCS5 emulator enviroment.

So any advice on how to get started with this 2 stage bootloader?

Thanks

Jens