nRF Dongle 52840 DFU over Mesh

Dear fellow Developers,

I'm finishing a project where I have to implement the DFU over Mesh protocol in a series of firmware running on a nRF 52840 Dongle. While I was able to solve most of the problems so far, there's still a major one that is bugging me:

I managed to complete the whole procedure of Device Firmware Update over Mesh, where a Distributor was able to distribute the Firmware to several targets, successfully the vast majority of times. The device remains provisioned, the services offered show the correct update (so to verify, together with the version number that the service is indeed updated), and I'm able to use them seamlessly.

Problem is, whenever the update is completed, if I detach the nRF 52840 Dongle from its USB port (hence turning it off) it always reboots in "Open DFU Bootloader" mode. Unplugging and re-plugging the device doesn't produce any effect.

I also tried the following directive so to apply the firmware at a later stage, but this was unsuccessful. 

mesh models dfd start 0 0 0 0

mesh models dfd apply

I feel like there are major incompatibilities between the Dongle Bootloader and MCUBoot and I was wondering if any of you have any idea on how to overcome these.

Thank you in advance,

Ale

  • Dear Hung Bui, I'm back with some mixed news. Some of them are good, others are meh.

    Best news: After a lot of trials during the weekend I managed to make it all work and, indeed you were right: by only using the MCUBoot image, the nrf5 bootloader does indeed allow the firmware to be booted even after the update. Massive thank you for this!

    Unfortunately, to get there, it was all but trivial: first, for some reason, mcumgr was not (and still isn't) able to upload the firmware whatsoever. The upload phase is stuck at 0bytes, even if i launch the command using sudo (I'm on linux). Changing the owner rights of the /dev/ttyACM0 file doesn't really produce any different effect and nor does changing the accessibility through chmod.I am able to read the console through /dev/ttyACM0 but I'm not able to upload anything using ./mcumgr. In case you're wondering, I installed mcumgr as specified in the github page using go install. I also used nrfutil as specified in the tutorial, downloading not from github but instead from the non-deprecated page in your site. Through it, I also installed nrf5-sdk-tools.

    In the end neither mcumgr nor nrfutil were used to flash the firmware in the dongle. this is not the solution i was looking for but still it's a first step towards it:

    • Using nRF Connect Programmer I flashed the merged.hex image containing both MCUBoot AND DFU Target first.
    • Still using nRF Connect Programmer I then flashed MCUBoot image zephyr.hex contained in the mcuboot subfolder.

    This way, the application did still run properly but the resulting hash in the nrf5 bootloader belongs only to MCUBoot. This way, the device does reboot properly even after the update and the update itself sticks.

    I'll also talk about this with some colleague of mine to see if I can find a better solution.

    Thank you very much for your help, you're the best.

    Ale

  • Hi Ale, 

    One thing need to be double checked is to make sure that you have put the MCUBoot to serial recovery mode on the dongle. 

    In the mcuboot.conf I sent I have set CONFIG_MCUBOOT_INDICATION_LED=y. So it's expected that one of the LED should turn on when you press the switch when you plug the device to USB port. 

    But anyway, if it works now and the trick of flashing using nRF Connect Programmer you did seems to be a good trick. You don't even need to use mcumgr separately then I don't see a problem with that :) 

  • About that: you're once again right, I was so excited I had it working I completely forgot to mention that.

    No, unfortunately, the indication led does not work. I also tried to create an overlay to change led but it didn't really seem to work at all. I don't even get warnings at build time so I wouldn't really know what to expect. A first guess would be to maybe change the pm_static file?

    Anyway, the important thing is that right now we're able to update via DFU OTA hundreds of Dongles. The very first phase of configuring them all is going to be rusty but will do for the early testings.

    Of course, if you have any suggestions related to the errors of mcumgr not uploading and the led not showing up, I'm always happy to hear some advice. Slight smile

    Thank you very much,

    Have a good evening!

Related