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

Update of Softdevice with DFU doesn't work

Hi!

I'm using SDK13 (Softdevice version 4.0.2) and I noticed that during an update via DFU bootloader the update of the Softdevice doesn't work.

After the transmission is successful the bootloader calls nrf_dfu_mbr_copy_sd(), but it returns 0x09 -> NRF_ERROR_INVALID_LENGTH.

I thought maybe it's because I want to update the Softdevice with the same version so I tried to update it with Softdevice version 5.0.0 which gives "Miss-match SD major version".

So my questions are:

  1. In which case does nrf_dfu_mbr_copy_sd() (or sd_mbr_command()) return NRF_ERROR_INVALID_LENGTH apart from that the length is not page aligned?
  2. How can I make the Softdevice update work?
  3. Why is a Softdevice update with a different major version not supported? How is it possible then to update the BLE stack during the product's life time?

I actually adapted the DFU bootloader to my needs and tried to implement the bootloader update and the Softdevice update myself. For the bootloader it worked immediately using nrf_dfu_mbr_copy_bl() but with the Softdevice I always get the same error as in the DFU.

Thanks!

  • Hi,

    2, 3. Do you only attempt to update the SoftDevice, or a combined package containing both the SoftDevice and bootloader? It is not allowed to update the SoftDevice to a different major version without also updating the bootloader, as doing so typically would make the bootloader and SoftDevice incompatible, bricking the device (the only way to recover would be to use a debugger/programmer). See table in Getting started with Nordic's Secure DFU bootloader, a step by step guide.

    Regarding the first question I have not been able to see where NRF_ERROR_INVALID_LENGTH is returned from the call to nrf_dfu_mbr_copy_sd(), but I can look more into it tomorrow.

  • Hi,

    I tried with an update package containing application & softdevice or bootloader & softdevice but the result was the same: returns NRF_ERROR_INVALD_LENGTH.

    In both cases the Softdevice was the same as already installed so a version issue can't be the problem except if updating the Softdevice with the same version is not allowed with sd_mbr_command().

    About the major version check: I missed out that the logic for installing bootlaoder and Softdevice at the same time is different than individually. Now I understand, thanks!

  • Hi,

    There is generally nothing that prevents you from updating to a bootloader of the same major version, so I suspect there is either something fishy with the modifications you have done to the bootloader or your upgrade image.

    I am not able to see that sd_mbr_command() can return NRF_ERROR_INVALID_LENGTH when handling a SD_MBR_COMMAND_COPY_SD command, so it seems to me that it is the check on line 68 in nrf_dfu_mbr.c (SDK 13) that is hit. Have you verified that this is not the case?

Related