nRF Mesh DFU over the air

Hello,
I'm trying to set up the DFU over the air mesh. Using the mesh SDK 5 and nRF SDK 7.1.0.
Using the DFU example from nrf sdk17.1.0, I successfully ran it.
When I tried to execute the DFU example located in mesh_sdk5, I cannot find my board via NRF connect app and cannot send a DFU package.
After reading some documentation, I have not been able to add DFU features to my application.
How do I add DFU over the air to my mesh network application?
Is it necessary to use the DFU bootloader and then add the application that uses buttonless DFU over mesh on top of it?  If so, how can I connect all this in Segger studio?

On nRF52832, I am using NRF SDK 7.1 and mesh SDK 5.

I appreciate your help in advance!

  • Hello,

    The bootloaders in the nRF5 (normal SDK) and the mesh SDK are a bit different.

    The Mesh bootloader uses Mesh communication, and since phones don't support that, then you can't find the device in nRF Connect for Android/iOS. To send out a mesh-bootloader-image, you need to use a separate DK, connected to a computer, and then use a tool called nrfutil, which is tailored for the Mesh SDK (please note that this is a separate nrfutil than the "normal" nrfutil tool. They just have the same name). 

    A guide on how to perform a Mesh DFU is described here:

    https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v5.0.0/md_doc_user_guide_modules_dfu_configuring_performing.html

    Hint: It is possible to download the mesh version of nrfutil and rename it to something like nrfutil-mesh by renaming the .exe file, and hence have both installed at the same time. 

    If you want to update the device using a mobile phone, then you would need to use the bootloader from the normal SDK. This is a quicker bootloader, in terms of throughput and speed of the DFU process, but you can only update one device at the time. The advantage with the mesh bootloader is that you can update multiple nodes (using the same application ID) in the network at once. The disadvantage is that it is fairly slow, but it happens in the background while the old application is running, so in an end product, this will happen in the background while the nodes are still working as normal.

    Best regards,

    Edvin

  • Thank you so much! It never occurred to me that nrfutil has a mesh-specific version.

    As I followed the guide, I got stuck on the part where I had to transfer the .zip from one DK to another with the following error:

    D:\Nordic\mesh-nrfutil>nrfutil-mesh --verbose dfu serial -pkg dfu_test.zip -p COM3 -b 115200 -fc --mesh
    Upgrading target on COM3 with DFU package D:\Nordic\mesh-nrfutil\dfu_test.zip. Flow control is enabled.
    Flushing com-port...
    Opened com-port
    Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 2416
    Sending DFU start packet, afterwards we wait for the flash on target to be initialized before continuing.
    1: PC -> target: 0502aabbccdd
    2: PC -> target: 0502aabbccdd
    3: PC -> target: 0502aabbccdd
    4: PC -> target: 0502aabbccdd
    5: PC -> target: 0502aabbccdd
    6: PC -> target: 0502aabbccdd
    7: PC -> target: 0502aabbccdd
    8: PC -> target: 0502aabbccdd
    9: PC -> target: 0502aabbccdd
    10: PC -> target: 0502aabbccdd
    
    
    Failed to upgrade target. Error is: Failed to establish connection
    
    Possible causes:
    - bootloader, SoftDevice or application on target does not match the requirements in the DFU package.
    - baud rate or flow control is not the same as in the target bootloader.
    - target is not in DFU mode. If using the SDK examples, press Button 4 and RESET and release both to enter DFU mode.
    - if the error is ERROR_BUSY at the beginning of the DFU process,increase the value of PAGE_ERASE_TIME_MAX by few milliseconds.
    Closing serial port...

    I did steps 3 to 6 (in Preparing for DFU) on both DKs. Could that be the problem or am I doing it correctly?

    After the reset, neither of my DKs is showing any lights.

  • Hello,

    The command that is sent from the PC to the target here is has length 05 (the first byte), and the OPCODE is 02, meaning "echo", which you can see here(line 60).

    This means that the PC (nrfutil-mesh) is trying to establish a serial link with the DK on COM3. What did you flash on the DK connected to COM3? Did you flash the softdevice, the bootloader and an application? If so, what softdevice, what bootloader and what application?

    BR,

    Edvin

  • On both DK (The one connected to COM3 and the one I am trying to DFU) I flushed the following:

    bin/softdevice/s132_nrf52_7.2.0_softdevice.hex

    bin/bootloader/gccarmemb/mesh_bootloader_serial_gccarmemb_nrf52832_xxAA.hex

    examples/dfu/build/dfu_nrf52832_xxAA_s132_7.2.0_Debug/dfu_nrf52832_xxAA_s132_7.2.0.hex

    tools/dfu/bin/device_page_nrf52832_xxAA_s132_7.2.0.hex

    This is the RTT output:

    00> <t:          3>, main.c,  227, ----- Bluetooth Mesh DFU Example -----
    00> <t:      12069>, nrf_mesh_dfu.c,  753, Version info: BL(ver, id): 0x01 0x01 SD: 0x0101
    00> <t:      12073>, nrf_mesh_dfu.c,  755, Version info: APP company: 0x00000059 id: 0x0001 version: 0x00000001
    00> <t:      12100>, serial_handler_prov.c,  267, Generating encryption keypair...
    00> <t:      16951>, main.c,  233, Initialization complete!
    00> <t:      21719>, main.c,  254, Enabling serial interface...
    00> <t:      21722>, mesh_app_utils.c,   66, Device UUID (raw): B66F3B2F0D6A4BD089E64985D5E52C70
    00> <t:      21726>, mesh_app_utils.c,   67, Device UUID : B66F3B2F-0D6A-4BD0-89E6-4985D5E52C70
    00> <t:      21735>, nrf_mesh_dfu.c,  554,   RADIO TX! SLOT 0, count 15, interval: periodic, handle: FFFE
    00> <t:      21743>, main.c,  262, DFU example started!

  • lidorelias3 said:

    examples/dfu/build/dfu_nrf52832_xxAA_s132_7.2.0_Debug/dfu_nrf52832_xxAA_s132_7.2.0.hex

    So which of the examples in the examples\dfu folder did you compile? There are two types of applications here. One called dfu_... and one called dfu_no_serial_...

    The one that is connected with your COM port, which you are trying to push the update to (via serial) needs to be programmed with the application that does not say dfu_no_serial_..., because it needs the serial interface. Try that, and see if it helps.

    BR,

    Edvin

Related