I’ve been working on implementing simultaneous multi-image DFU on my custom nRF5340 board using nRF Connect SDK v2.6.0. The goal was to update both the application core and the network core seamlessly. While the application core update worked flawlessly, the network core update was proving to be a challenge. Here’s what I did and how I overcame the hurdles:
Challenges Faced
- Multi-Image Creation: I used the
dfu_multi_image_tool.pyscript to create a multi-image binary. The process seemed straightforward, but ensuring both images were correctly packaged was tricky. - Image Processing: After sending the multi-image binary to the application core, processing it using the DFU Multi Image library worked as expected, but the network core update wasn’t triggering.
- MCUboot Behavior: MCUboot detected the new image for the network core but ignored it, which was perplexing.
Solution and Insights
- Partition Configuration: Reviewing the partition table was crucial. Ensuring that the secondary partitions for both cores were correctly sized and aligned was key to the successful update.
- Configuration Settings: The
/child_image/mcuboot.conffile played a significant role. Configurations likeCONFIG_NRF53_MULTI_IMAGE_UPDATE=yandCONFIG_UPDATEABLE_IMAGE_NUMBER=2were essential to enable simultaneous updates. - Custom Protocol and Library Integration: Sending the multi-image binary via a custom protocol and leveraging the DFU Target library ensured that both images were written to their respective partitions without issues.
- Testing and Logs: Analyzing the logs provided valuable insights. It became clear that while the application core update was straightforward, the network core required additional configuration steps.
Steps to Success
- Binary Creation: Use the
dfu_multi_image_tool.pyscript to create the multi-image binary, ensuring both images are correctly indexed. - Binary Transfer: Send the binary to the application core using a custom protocol or any reliable method.
- Image Processing: Utilize the DFU Multi Image library to process the binary and extract individual images.
- Target Writing: Write each image to its respective secondary partition using the DFU Target library.
- Device Restart: After writing both images, restart the device to apply the updates.
Lessons Learned
- Documentation and Community: The unofficial example provided by Sigurd Hellesvik was invaluable. Engaging with the community and referring to such examples can save a lot of time.
- Configuration is Key: Paying close attention to partition tables and configuration settings is crucial for successful DFU operations.
- Testing and Iteration: Incremental testing and thorough logging helped identify and resolve issues quickly.
If you’re working on a similar project, I hope this guide helps you avoid some of the pitfalls I encountered. Happy coding and seamless DFU updates! ![]()