This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU OTA Mesh - pre-save update

Hi,

I already achieved the update of all available nodes in a mesh network, where the update is injected over a serial connection to one node.

Now my question is, if I can load the whole update into the flash of the nRF52833 and then start the update if the whole dfu is on the device.

If this is possible, where should I start? Can I somehow overwrite the current serial connection in the DFU Mesh example with flow control to give back a successful 

response when I saved the packet?

  • I see, so my understanding is the main point of this application is to reduce the time you need to connect the DFU master (the UART device or the BLE device) to the DFU unit. After you transfer the image to the DFU unit (which should take less than a minute), you can leave the DFU unit to broadcast the image to the mesh network ? 

    If that's the case, you would need to build the application so that it can receive the image, store it into flash, and then from there, start to call the bootloader APIs to send the pieces of the image to the bootloader for broadcasting. 

    I would expect a good amount of work needed to achieve this. But it's not a very difficult task. You just need to understand the protocol how we send the image to to the bootloader. Unfortunately it's not very well documented. But you can start by looking at the nrfutil source code and the bootloader source code. 

    The protocol for the normal BLE DFU described here (format of init packet) it should be similar to what inside the .zip package for MESH DFU : https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_bootloader_dfu_validation.html?cp=7_1_3_5_1_1_0#lib_bootloader_dfu_init

  • You are right, I try to save connection time for an end user.

    I try now to write to the same flash address as will be used for the bootloader. For this, I use the optimal_bank_address() function provided in the examples for DFU. Now I have my address and my packets, but I don't know how I can now read from the flash. There is nrf_flash.c which provides a write function, but there is no read function. How Can I read out the flash data I wrote?

  • You can just use a pointer variable and point that pointer to an address in the flash to read it. There is no different between flash and ram when it come to reading. That's why we don't have a function for read. You can use an array pointer. 

    Check function flashwrite_read_cmd() in flashwrite example. 

Related