Hi!
I could really use some help with bootloaders.
I'm trying to add bootloader support to nrf_desktop using nRF Connect v2.1 (I could upgrade if needed but the changes to nrf_desktop between 2.1 and 2.3 look extensive and I'm a bit concerned about how much work upgrading might take) - I thought this would be simple but I'm getting confused with all of the options on B0/NSIB vs MCUBoot.
I'm currently working with an nRF52840 devkit.
I got B0 to work to where I can program in b0_container.hex, provision.hex, signed_by_b0_s0_image.hex, and signed_by_b0_s1_image.hex, and the bootloader will select and load the newer one between the images. (Though I would like to know how to enable readback protection for production)
Now I'm trying to figure out what I need to do receive and save off my new image. The links I've found talk about a configuration channel, but I'm not sure how to use that, or if B0 has any way to read in an image, or if B0 is *just* the little bit of code that selects the image at startup.
I guess for both B0 and MCUBoot I'm confused about the "get a new image from somewhere" aspect of a bootloader and the "run at startup and launch the application" aspect. I've done bootloaders in my life that do both things in the same code, where if there's a special value that the app has saved off in flash or if someone's holding down a certain button then you enter the bootloader and it includes the code needed to receive the new file, put it in memory, and then launch it. I've also done bootloaders where the "receiving and saving the file" stuff happens in the application, and then you reboot and the bootloader code is just responsible for copying over the new file and launching it. Which of those two bootloader types are B0 and MCUBoot?
The docs say MCUBoot can receive an image via Bluetooth with SMP, but I don't know if I need to use MCUBoot as a primary bootloader or if I need to have B0 as the primary and MCUBoot as the secondary, and how to get all the configuration options right to do that.
I tried just building the unmodified nrf_desktop sample with the prj_mcuboot_smp.conf file selected and I got a compile error:
\testing\nrf_desktop\src\util\bt_le_adv_prov_uuid16.c:15:18: error: 'const struct bt_le_adv_prov_adv_state' has no member named 'bond_cnt
Also, is the code for these bootloaders in the SDK directory somewhere or is it a precompiled library? I have another project using nRF Connect v2.3 that needs a bootloader with data coming in over Ethernet or possibly a serial port, so I'd like to figure out if I can hack out the SMP code and put in my own front end. I'm assuming that code just receives data and sticks it into flash at the right location, right?
I'd appreciate any advice to get me going in the right direction.
Thanks!
Glen
