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

Mesh DFU how to update Softdevice

We have a device with the following configuration:

  • nrf5_SDK_for_Mesh_v3.1.0
  • nRF5_SDK_15.2.0
  • s140_nrf52_6.1.0_softdevice
  • mesh_bootloader_gccarmemb_nrf52840_xxAA

 Our task:  Update a device using Mesh DFU to this configuration:

  • nrf5_SDK_for_Mesh_v4.2.0
  • nRF5_SDK_17.0.2
  • s140_nrf52_7.2.0_softdevice

 We are aware that our application only will run if we also update the softdevice.

Questions:

1/ is it possible to update the softdevice with Mesh DFU?

>> we failed when trying to update the Softdevice

  • We generated an update package this way

nrfutil dfu genpkg --softdevice s140_nrf52_7.0.1_softdevice.hex --company-id <our_own_companyID> --application-id <app_id> --application-version <appl_vers> --sd-req 0xFFFE --mesh <packageName>.zip

Our investigations showed us, that in the mesh_evt_handler() the function fw_updated_event_is_for_me() is called which returns false for a dfu_type NRF_MESH_DFU_TYPE_SOFTDEVICE.

Therefore the function nrf_mesh_dfu_relay() will be called.

  • What are we doing wrong?
  • If we run an Application DFU, nrf_mesh_dfu_request() will be called. Why not for SoftDevice DFU?
  • What is the correct way to generate a package for the softdevice?

2/ Is it possible to update the application AND the softdevice with a single update package (only 1 zip file)?

3/ is there a tutorial how (and in which sequence) to update the SW parts (Bootloader, Softdevice, Application)?

 thanks for the help

Parents
  • Hi,

    1/ is it possible to update the softdevice with Mesh DFU?

    Yes, it is possible to update the Softdevice with Mesh DFU.

    2/ Is it possible to update the application AND the softdevice with a single update package (only 1 zip file)?

    Unfortunately, you can't do this. You will need to update them seperately one by one. It's better to update the Softdevice first(assuming the old bootloader is compatible with the new one), then the application.

    3/ is there a tutorial how (and in which sequence) to update the SW parts (Bootloader, Softdevice, Application)?

    I suggest you look through this, Configuring and performing DFU over Mesh.

  • Did you go through the guide I pointed to in my previous reply? It is a step by step guide on how you can do Mesh DFU, how you can update the softdevice with Mesh DFU. Also, it shows how you can generate the DFU pacakge for the Softdevice.

  • Hi Mttrinh,

    thanks for your fast response. We did all the steps, but we think the problem is still in the fw_update_is_for_me() function on the server node (DFU receiver).

    If we perform an application or bootloader DFU, application and bootloader IDs will be checked. The function fw_update_is_for_me() will return true, if the new ID (sent by DFU) is higher than the current one on the device page (flash). This will call nrf_mesh_dfu_request() and we can see how the new DFU data is written to the flash.

    If we run the SoftDevice DFU, the function returns false and nrf_mesh_dfu_relay() is called. We can not see any new data on flash.

    Why?

    Kind regards,
    Thomas

  • Hi,

    It seems like you have to implement it yourself. You need to modify the code and let it accept Softdevice transfers. Under the case NRF_MESH_DFU_TYPE_SOFTDEVICE, you have to check for the incoming softdevice versions(similar to the other cases) and change the return from "false" to "true". So do the checks first before returning "true".

    Best Regards,

    Martin

  • Dear Martin

    thank you for the answer

    We will try it.

    Kind regards ,

    Thomas

  • Hi Martin,

    now we can run the SoftDevice (SD) DFU (checking softdeivce versions in the case NRF_MESH_DFU_TYPE_SOFTDEVICE works).

    But there is an other problem:

    The old application runs with SD 6.x.x with FLASH_START=0x26000, but SD 7x.x needs more flash therefore the application should start at FLASH_START=0x27000.

    After performing the DFU SD 6.x.x -> SD 7.x.x the application does not start, I guess because the application start (0x26000) is overwritten by the new SD.

    We prepared a new application DFU package for SD 7.x.x and FLASH_START=0x27000.

    How can we update now the application?
    I thought the bootloader would start automatically the DFU mode without the running application, but it seems not doing this.

    Best regards,
    Jeff

Reply Children
Related