I'm just a bit fuzzy on how all of the bootloader stuff comes together.
I imagine the best solution goes like this:
I just don't really know what API is appropriate for the above (aside from step 1).
When I bring in even just nrf_bootloader_app_start, it seems to also depend on an overwhelming number of BLE services, so I'm not sure if I'm on the right track with that... I thought DFU doesn't necessarily require BLE?
I've also seen the experimental IoT background update API, but it seems to be exclusive to TFTP... or ANT (it's unclear - or is it both?)
I'm using VisualGDB and have configured the appropriate write to UICR.BOOTLOADERADDR and located the bootloader at 0x00078000. The bootloader seems to start fine.
Any advice for getting started with this?
I think there are mainly two options to consider for this: 1 create a custom transport layer with your proprietary bus protocol and integrate it with the existing bootloader (create custom transport). 2. Let the application handle the DFU transfer and storing of image to bank 1, then make a custom bootloader that's responsible for validation and activation of the new image. The current bootloader implementation does not support background DFU (ie. app handled dfu transfer).
BLE is only required if you use the BLE transport layer. The serial bootloaders in SDK 15.x.x do not require a Softdevice to be present.
Thanks for the reply.
By "custom bootloader," you mean we would have to implement our own validation of the received image, perform the direct FLASH writes to copy Bank 1 to Bank 0, and figure out our own way to reboot from the bootloader to the application?
The serial bootloaders I assume still require a (serial?) transport - does this imply that they can't be leveraged for at least some of the above steps?
If I were to completely hand-write a bootloader as described above, I think the only unknown at this point is how to get back to the application.
There are several modules from the bootloader which you can re-use in your bootloader, function to transfer execution to app and image validation for instance. So maybe not a custom bootloader, but rather a modified version of the one we provide.
I think you can get a basic overview of the bootloader by going through the nrf_bootloader_init() function in nrf_bootloader.c.
1. Checks to see if should enter DFU mode or not
2. Check if there are any new FW images to activate (could be an image that the app has stored).
3. If dfu_enter == true, initialize transport and wait for DFU master to initiate a DFU
3. if dfu_enter == false, verify CRC of app image and boot the app.
Which SDK version are you currently using? I'll try to check how you can use the validate function for an image stored by the application.
I'm using 15.2 with S132
I'd love pointers to any APIs, high level architecture ideas or example projects that could help me out here. How to make my bootloader validate and load an image stored by the application, as well as how to reboot to the application from there. I'm using 15.2 with S132.