Adding DFU MESH to existing application?

Hello,

Is there a tutorial to add DFU MESH to an existing application? 

Potentially integrating this DFU example into a project:

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

  • I can confirm that with the wrong application_id it is progressing further because it is relaying:

    00> <t:          5>, main.c,  227, ----- Bluetooth Mesh DFU Example -----
    00> <t:       8848>, nrf_mesh_dfu.c,  753, Version info: BL(ver, id): 0x01 0x01 SD: 0x0101
    00> <t:       8855>, nrf_mesh_dfu.c,  755, Version info: APP company: 0x00000059 id: 0x0001 version: 0x00000001
    00> <t:       8897>, serial_handler_prov.c,  267, Generating encryption keypair...
    00> <t:      14964>, main.c,  233, Initialization complete!
    00> <t:      21029>, main.c,  254, Enabling serial interface...
    00> <t:      21035>, mesh_app_utils.c,   66, Device UUID (raw): 7FCD918FF4054D1CA602A4E4ECED7735
    00> <t:      21041>, mesh_app_utils.c,   67, Device UUID : 7FCD918F-F405-4D1C-A602-A4E4ECED7735
    00> <t:      21060>, nrf_mesh_dfu.c,  554,   RADIO TX! SLOT 0, count 15, interval: periodic, handle: FFFE
    00> <t:      21069>, nrf_mesh_dfu.c,  593,   SERIAL TX (type: 65534)
    00> <t:      21081>, main.c,  262, DFU example started!
    00> <t:    4838111>, nrf_mesh_dfu.c,  418,   New firmware!
    00> <t:    4838116>, main.c,   79, DFU type Application
    00> <t:    4838121>, main.c,  123, Requesting DFU transfer with bank at 0x00059000
    00> <t:    4838128>, nrf_mesh_dfu.c,  554,   RADIO TX! SLOT 0, count 3, interval: periodic, handle: FFFD
    00> <t:    4838137>, nrf_mesh_dfu.c,  593,   SERIAL TX (type: 65533)
    00> <t:    4905405>, nrf_mesh_dfu.c,  554,   RADIO TX! SLOT 0, count 3, interval: periodic, handle: FFFD
    00> <t:    4905413>, nrf_mesh_dfu.c,  593,   SERIAL TX (type: 65533)
    00> <t:    4971630>, nrf_mesh_dfu.c,  411,   Abort event. Reason: 0xC
    00> <t:    4971640>, nrf_mesh_dfu.c,  554,   RADIO TX! SLOT 0, count 15, interval: periodic, handle: FFFE
    00> <t:    4971648>, nrf_mesh_dfu.c,  593,   SERIAL TX (type: 65534)
    00> <t:    4971655>, nrf_mesh_dfu.c,  554,   RADIO TX! SLOT 0, count 15, interval: periodic, handle: FFFE
    00> <t:    4971663>, nrf_mesh_dfu.c,  565, Killing a TX slot prematurely (repeats done: 0).
    00> <t:    4971670>, nrf_mesh_dfu.c,  593,   SERIAL TX (type: 65534)
    00> <t:          5>, main.c,  227, ----- Bluetooth Mesh DFU Example -----
    00> <t:       8772>, nrf_mesh_dfu.c,  753, Version info: BL(ver, id): 0x01 0x01 SD: 0x0101
    00> <t:       8779>, nrf_mesh_dfu.c,  755, Version info: APP company: 0x00000059 id: 0x0001 version: 0x00000001
    00> <t:       8803>, serial_handler_prov.c,  267, Generating encryption keypair...
    00> <t:      14936>, main.c,  233, Initialization complete!
    00> <t:      21000>, main.c,  254, Enabling serial interface...
    00> <t:      21006>, mesh_app_utils.c,   66, Device UUID (raw): 7FCD918FF4054D1CA602A4E4ECED7735
    00> <t:      21012>, mesh_app_utils.c,   67, Device UUID : 7FCD918F-F405-4D1C-A602-A4E4ECED7735
    00> <t:      21033>, nrf_mesh_dfu.c,  554,   RADIO TX! SLOT 0, count 15, interval: periodic, handle: FFFE
    00> <t:      21041>, nrf_mesh_dfu.c,  593,   SERIAL TX (type: 65534)
    00> <t:      21055>, main.c,  262, DFU example started!
    00> <t:     116955>, nrf_mesh_dfu.c,  418,   New firmware!
    00> <t:     116960>, main.c,   79, DFU type Application
    00> <t:     116965>, main.c,  148, Starting relay

  • My assumption is that it is due to flash size as the example runs in dual bank

  • Thank you for the files and detailed information. It doesn't look like I can finish this today, and I am off tomorrow, so I will resume to this on Thursday. I will update you latest by the end of Friday Feb 24.

  • Hi, just a quick update. I have been looking into it but met some difficulties with the setup. I will continue with it and update you when got to run some test.

  • Hi, I set things up yesterday. Because I don't have a nRF52832 with me, I could not use your project files.

    I instead built the DFU example for the nRF52840, with one small modification to a log line to show "v1" and "v2" to differentiate between the original firmware and the DFU firmware.

    What I found is that the setup works just fine. Screenshot of my result is attached below.

    I reviewed nrf_mesh_dfu.c and your log, and found that "Abort event. Reason: 0xC" indicates NRF_MESH_DFU_END_ERROR_BANK_IN_BOOTLOADER_AREA.

    Your assumption about the flash size should be correct. I checked the hex files you provided, and see that the application is about 205kB (0x0002_6000 to 0x0005_81F3), while the free space between the application and the next region is only ~130.5kB (0x0005_81F4 to 0x0007_8000).

    Are you attempting with an unmodified DFU example?
    It seems strange to me that the example could not work, since it is supposed to be really barebone.

    There are a few things we can try here:
    - Build the DFU Example with Release build configuration
    - Use a different SoftDevice with smaller footprint. This will require updating the DFU Example project setup.

    I am working from home and won't have access to a nRF52832 device for the next few days. For the next steps, could you try the options above and let me know the result?

Related