This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Custom bootloader w/o DFU transport

I am trying to write a custom bootloader to do FW updates on our device.  In our main application, we already have a way to transfer a new signed application image over BLE, and that's being saved in external flash that we communicate w/ over QSPI.  After reading through a few devzone Q&As, my understanding of what usually happens is the following:

0. System is reset

1. The MBR runs first and checks the UICR registers to see if bootloader exists. If it does it gives control to bootloader.

2. The bootloader will enter DFU mode if one of the DFU entering methods are used (button press, register set)

3. DFU mode enables a transport which allows for transferring a new image into Bank1

4. The image in Bank1 is checked for validity

5. If valid, Bank1 is transferred to Bank0

6. Then control is handed over to the application in Bank0

In our scheme, we've already taken care of the transferring of the image and the checking of validity in the main application, so I had the following simplified flow in mind:

1. From main app, after checking validity, copy new image from external flash to Bank1

2. Reset device to get into bootloader

3. Bank1 transferred to Bank0

4. Control is handed over to Bank0

My questions:

1. Is this flow even possible?

2. In Step1

a. Should the memory copied into Bank1 be the FW hex (binary) or is there some special format for this?

b. Should I be updating the bootloader settings page here?

c. How do tell the bootloader where Bank1 is?

d. How do I flag to the bootloader that there is a new validated application waiting in Bank1?

Parents
  • UPDATE:  I've been able to get the FW image transferred over to internal flash memory.  From the SDK there is a note that the fstorage calls using the SD backend can fail because they share resources with the SD NVIC.  So if, for example, the advertising interval is too aggressive it can mess with fstorage calls.  I got this to work by doing the following:


    nrf_sdh_disable_request();
    /* fstorage calls here */
    nrf_sdh_enable_request();

Reply
  • UPDATE:  I've been able to get the FW image transferred over to internal flash memory.  From the SDK there is a note that the fstorage calls using the SD backend can fail because they share resources with the SD NVIC.  So if, for example, the advertising interval is too aggressive it can mess with fstorage calls.  I got this to work by doing the following:


    nrf_sdh_disable_request();
    /* fstorage calls here */
    nrf_sdh_enable_request();

Children
No Data
Related