DFU in nrf52840 using UART.

Hello Everyone,

I developed a ZigBee gateway using nrf52840,

SDK: nrf5_sdk_for_thread_and_zigbee_v4.2.0_af27f76

Chip: NRF52840

IDE: Segger embedded studio

 now we are planning to integrate a DFU functionality.

Our plan is, NRF52840 is connected to ESP32 through UART. (ESP32 is for Cloud connection)

ESP fetch the firmware file from cloud & sent through uart to nrf52840.

I went through the Serial DFU examples. But implementing this protocol in controller is bit complicated.

we don't need to any firmware version validation, compatibility, signature verification and all.

so, we want it to make simple, like esp read bin file from cloud and give some bytes through uart, without any validation nrf write it to the flash.

 after finishing it will rest and apply new firmware.

here my doubt is.

is it possible to implement like this?

what are the steps need to follow to achieve this?

How many bytes can nrf52840 receive in uart?

after generating a dfu zip file, inside 3 files are present manifest, application.Bin, and one .dat file.

application.bin is the main file here, other 2 file is needed for this apporach? (init file) 

secure dfu also not mandatary for current project.

Best Regards

Bose

  • Hi Bose,

    I think you will find it easier to rely on the existing DFU protocol rather than making a new protocol from scratch (even if the new one is less complex). If you decide to create a new protocol, you will not only have to implement it on the ESP, but also make adaptations to the existing bootloader on the nRF.

    Maybe you have seen them already, but the message sequence charts for our serial DFU transport here: Serial should give a good overview of what packets the ESP would need to send to complete a DFU process. 

    The ESP will not need worry about the content of the .bin and .dat file, it just have to forward them to the nRF. The .dat file contains the init command (Init packet) which includes various metadata such as checksum values and version numbers along with the update request, and the .bin contains the FW image.

    However, if you still prefer to handle storage of the update image yourself, you may have a look at the discussion in this post:  nRF52840 : update from a LTEM modem  

    Best regards,

    Vidar

Related