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

Mesh DFU problem

We have a Mesh app that should be updated via DFU.
The problem is that if a device (for whatever reason) restarts in the middle of DFU or it is powered up later (i.e. not working during DFU), it newer receives update.
Here is a app log (device started after DFU):

<t:         23>, ble_softdevice_support.c,  162, sd_ble_enable: app_ram_base should be adjusted to 0x20002DA0
<t:        489>, main.c,   68, Initializing and adding models
<t:        496>, main.c,  111, rom_base   26201
<t:        498>, main.c,  112, rom_end    424D4
<t:        500>, main.c,  113, rom_length 1C2D3
<t:        502>, main.c,  114, bank_addr   43000
<t:        509>, bizlogic.c,  213, Bizlogic init
<t:        511>, gap_listener.c,   85, GAP scanner started.
<t:        514>, gap_advertiser.c,   74, GAP advertiser init
<t:       5389>, nrf_mesh_dfu.c,  529, 	RADIO TX! SLOT 0, count 255, interval: periodic, handle: FFFE
<t:       5398>, main.c,  141, Started.
<t:       5510>, nrf_mesh_dfu.c,  391, 	New firmware!
<t:       5512>, dfu.c,   48, NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED_NO_AUTH
<t:       5515>, nrf_mesh_dfu.c,  529, 	RADIO TX! SLOT 0, count 255, interval: periodic, handle: FFFD
<t:       5519>, nrf_mesh_dfu.c,  535, Killing a TX slot prematurely (repeats done: 0).
<t:       8167>, nrf_mesh_dfu.c,  529, 	RADIO TX! SLOT 0, count 255, interval: periodic, handle: FFFD
<t:       8171>, nrf_mesh_dfu.c,  535, Killing a TX slot prematurely (repeats done: 0).
,

Device obviously knows that is should be updated (NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED_NO_AUTH) but it fails to transfer firmware (Killing a TX slot prematurely).
How to fix this?

And also when the update is transmission over the Mesh is stopped?
If we have Client with ID = 1 and Server with ID = 2, and if Server devices are now updated, they still broadcast this new firmware to all devices and if you want to update Client device, before you can start it is already receiving update from Server devices and this update is transmitted all the time.
How to stop firmware re-transmission over the Mesh, so that you can update Client without Server firmware being relayed, because if you send init packet via serial to Client you get *84 78 87*. ?
And how to update Server devices then to newer version after like a day or so if some device is still broadcasting older firmware?

[Mesh SDK 3.1, nRF SDK 15.2, SD 6.1, nRF52840]

  • Hi

    1. Yes dfu_evt_handler() is still present - nrf_mesh_dfu.c is not changed at all and it is same as in Mesh SDK so all this functions are present and also timeouts.
    2. I get Timeout fired @... when for example DFU_END happens and it needs some time to finish DFU.

    3. I think the problem is elsewhere but I don't know exactly where.

    What I did and found out now is that 
    -Devices updated with for example firmware 4 are broadcasting it ALWAYS(even after days). What I mean by that is when you power up a new device, on this new device it will automatically go to dfu_evt_handler() into BL_EVT_TYPE_DFU_NEW_FW, and then it goes into
    NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED_NO_AUTH in dfu.c file.
    You also get 1 "nrf_mesh_dfu.c,  529, RADIO TX! SLOT 0, count 255, interval: periodic, handle: FFFE" but then this is it - DFU itself will not start but they get some packet that some device has newer firmware

    -When I got Timeout yesterday, I had 10+ devices connected nearby. 
    Some of those devices transmitted this Firmware 4 packet to others
    Some had custom new firmware flashed from Segger with Firmware 1
    Some had debug and some had release versions (In debug devices were just connected and used for different purposes, I only had release versions for DFU)
    Some where Clients and some where Servers. So clients all had Firmware version 1 and I was trying to update Servers from a Client.

    -I connected 1 device with Firmware 1 and ran with Segger
    -It said New Firmware (BL_EVT_TYPE_DFU_NEW_FW) - So it got Firmware 4 broadcasted from others
    -I created APP version 10 (same release as in version 4, I just changed numbers in .c file and when creating .zip with nrfutil)
    -So I ran Firmware 10 update from a Client and I always got "BL_EVT_TYPE_DFU_ABORT" with reason "0x3" in different parts of DFU transfer. Usually at around 2000/6200 packets running with 800ms

    So this always failed yesterday.
    First time, when ALL devices were newly flashed and didn't have any newer firmware this update worked but only once.

    -After all that I disconnected all devices and had only 1 Server and 1 Client(for DFU) and DFU ran OK!
    -Now I tried adding few new Server devices and also it looks like DFU is ok, even running with 400ms and 1 server already having this update!

    The question is, what is the problem here.
    Are maybe clients or other devices making problems broadcasting this New firmware packets meanwhile DFU is happening.
    Is it maybe that only 1 Client can run nearby
    Are there too many devices nearby.
    Is it maybe that some device had some Debug version on and did something to DFU to abort it randomly.
    Why does DFU behave strangely in this cases?
    Why are then Client devices broadcasting New firmware to others, if the Firmware is already updated on Servers and this Firmware is not for the Clients. Should I also send DFU_END to all clients when Servers are updated?

    4. When running DFU I see that "... INTERVAL: EXPONENTIAL" - can this have any influence on this problems and can this be changed?

    (In world cases I will have few Clients and many Servers. I will run DFU first for Clients and after Clients are updated also new DFU for Servers (This can also be reversed))

    EDIT
    I found out that when I updated 3 Servers, for Client update to work I had to reset all Server devices, because someting was transmiting from Servers and Client update never worked.
    The problem here is we need to add custom Mesh Node reboot, because we don't want to unprovision device with node reset, only reboot it.

  • Hello,

    Can you check whether you have the correct softdevice in your device page? If the bootloader receives a DFU for an app-id with different SD ID's it will request the SD instead.

    Br,

    Edvin

  • Hi!

    Ok I will check that, because I saw it requesting SD version yes, not APP when device didn't work.
    Maybe I corrupted something when I update device with Release, then attached it to debugger and ran ReleaseWithDebugInformation on it

    Thank you!

  • Hi,

    we have different bootloader for Client and Server, because Client has Serial support and Server doesn't.
    We also have to generate 2 different device_page.hex files, with different BootloaderID and AppId for each, but softdevice is the same.
    Can any of this be the problem, if Client receives update from Server which has different configuration?

    Thank you!


  • If the client receives an update with another application ID it shouldn't care about the content of the DFU image, just relay it. But if it receives an update with the same application ID that uses a later softdevice, it will request the softdevice instead. 

    So what are the configurations on the server and client when you are sending to the servers?

    BR,

    Edvin

Related