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.

Recall the boot loader from user code

Hi,

I am going to develop a C5515-based product which can allow the end user to upgrade "firmware" using their own USB key. The upgrading task is simple: the end user download the updated "firmware" from our website, put it in a USB stick, and plug the USB into the device. Then, the device will boot from the USB stick and copy the new "firmware" into on-board flash/EEPROM.

Unfortunately, this idea cannot work if the onboard flash/EEPROM already contains a "valid" boot image. USB interface is at the bottom of the C5515 boot order, so the device always boots from the old boot image onboard instead of the USB stick.

A workaround I can think of is letting the old boot image bypass itself. After the device loads the old boot image on-board, that user program will check whether a valid boot image is available on the USB interface. If yes, it calls back to a segment in the DSP boot loader (located in the on-chip ROM) which can boot directly from the USB stick without checking higher-priority memories.

The questions are whether C5515 boot loader allows overriding boot order in that way, and if yes, which segment of the boot loader the user program should jump into.

  • Another workaround is using a reset button. After the old boot image is loaded and run, if the reset button is pressed for a few seconds, the old program will erase itself on the on-board flash/EEPROM. In the next boot, the old boot image will be no longer "valid", so the device will boot from the USB stick.

    However, this approach requires a reset button. Since the plastic design for our device is quite acoustically critical, placing such a button will be a problem.

  • Since the ROM code cannot be changed, the boot will happen if there is a boot-able code in a flash memory before USB. So you will have to implement the USB detection in your code.

    Basically, after your code is taking over the DSP, the first thing that you need to do is to detect if there is an USB transmission request from a host. If there is, and some kind of signature matched (you defined). Then, you will erase the 2nd part of your code. The detection part of the code (1st part) should not be erased. 

    Regards

    Wen