USB Firmware update

Hello, I'm starting to study MCUboot with the intention of implementing firmware upgrades in a product. I'm currently working with the nrf5340dk eval board.
As far as I understand there are multiple options for this, and I'm trying to understand what is best, also given our usecase.

First of all, a bootloader is required, and MCUboot is the obvious choice. I read somewhere (probably devzone blogposts) that there is the option of having MCUboot as a second-stage bootloader, the rationale being to establish a root of trust?

  • What is the real use case for this? What value does this approach add in comparison to using just using mcuboot?

Regarding the update process, I got initially a bit confused by the documentation. Now I seem to understand that the following options exist

  1. USB DFU (device firmware upgrade): this is an actual USB class designed for this purpose. I managed to update a firmware image with this approach and the corresponding tool (dfu-util), but I had to manually configure the driver of the device (choosing WinUSB), which is not ideal. docs.zephyrproject.org/.../README.html
  2. MCUmgr: This approach allows to chose various transports (BLE/USB/IP), and also integrates other management functionalities. I did not tried this yet. https://docs.zephyrproject.org/latest/services/device_mgmt/mcumgr.html

In our application we need to support communication via USB at the application level (to do some configuration/download data etc), which I was planning to implement with USB CDC. 

In this issue it seems that the combination of USB CDC and DFU is not possible, at least on Windows, due to a bug in some driver. Indeed I tried setting up an example project with both USB classes and non of the endpoints was working. This would perhaps suggest that option 2 is a better alternative.

I would really appreciate general feedback on my understanding of this topic to see if I am missing or I misunderstood something, and specific replies to the following questions

  • Difference/advantages of using two bootloaders, and what is the option for the first stage
  • Confirmation that I understood correctly 1 and 2, and wether there's other options that I missed :)
  • Confirmation on wether it is possible to run DFU and CDC in parallel (example very much appreciated!) and if this works fine (maybe on linux)
  • Is there a clearly better way between 1 and 2?

I think this topic is still lacking in documentation so this post could be really helpful for other people as well!

Thank you very much!

Related