This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to implement 2 bootloaders

Hi Team,

I would like to implement a second bootloader to program an external serial Flash chip. Currently using S110 V7.1.

My current thinking is to create another self contained application in BANK_0 (I should have the space) which when run will advertise a new service and implement the down load protocol and Flash programming.

I could modify the DFU bootloader to run this new app based on a new value set in GPREGRET before the call to bootloader_util_app_start(). Is it safe to use GPREGRET for this purpose going forward? OR Why don't I just do this:

err_code = sd_softdevice_vector_table_base_set(BOOT_EXT_FLASHER);
bootloader_util_app_start(BOOT_EXT_FLASHER);

When I want to run the second application?

I remember reading somewhere about having multiple applications and switching between them, but can't find this reference again and can't remember how the bootloader knew which app was to be run?

Any comments would be appreciated.

Simon

Parents
  • I had the same issue.

    Initially I was going to extend the START packet to include an extra optional length field. But I needed to be able to test the SPI upgrade before our app was written. So instead I added data to init packet that specifies the SPI partition data.

    My SPI flash is 2MB, the worst case upgrade time really sucks.

    If I had it to do over again, I suspect I would drop the DFU bootloader and go with a bootloader that only knows how to copy data from SPI flash into nrf51 flash. That way the bootloader wouldn't be tied to the softdevice and I would end up with more internal flash to work with. The application would download the new application (over time, no hurry) and once all the data is validate, reboot with a GPREGRET command to swap in new data.

Reply
  • I had the same issue.

    Initially I was going to extend the START packet to include an extra optional length field. But I needed to be able to test the SPI upgrade before our app was written. So instead I added data to init packet that specifies the SPI partition data.

    My SPI flash is 2MB, the worst case upgrade time really sucks.

    If I had it to do over again, I suspect I would drop the DFU bootloader and go with a bootloader that only knows how to copy data from SPI flash into nrf51 flash. That way the bootloader wouldn't be tied to the softdevice and I would end up with more internal flash to work with. The application would download the new application (over time, no hurry) and once all the data is validate, reboot with a GPREGRET command to swap in new data.

Children
No Data
Related