softdevice DFU not working with nrf52811

Hi,

We are trying to update the S112 softdevice on nrf52811 over serial DFU but it's not working and throwing the below errors.

Traceback (most recent call last):
  File "/usr/bin/nrfutil", line 11, in <module>
    load_entry_point('nrfutil==4.0.0', 'console_scripts', 'nrfutil')()
  File "/usr/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/nordicsemi/__main__.py", line 858, in serial
    do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, True)
  File "/usr/lib/python2.7/site-packages/nordicsemi/__main__.py", line 793, in do_serial
    dfu.dfu_send_images()
  File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu.py", line 121, in dfu_send_images
    self._dfu_send_image(self.manifest.softdevice)
  File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu.py", line 97, in _dfu_send_image
    self.dfu_transport.send_init_packet(data)
  File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 253, in send_init_packet
    self.__execute()
  File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 370, in __execute
    self.__get_response(DfuTransportSerial.OP_CODE['Execute'])
  File "/usr/lib/python2.7/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 454, in __get_response
    get_dict_key(DfuTransport.RES_CODE, resp[2])))
pc_ble_driver_py.exceptions.NordicSemiException: Response Code InsufficientResources

We are using nRF5_SDK_17.1.0 and soft device s112_nrf52_7.2.0. 

Hex files application sizes:

Bootloader size :

  

Application + softdevice size:

We are able to update the application successfully over serial DFU but softdevice always fails with the above errors. 

Questions:

  1. Can nrf52811 support DFU of softdevice over serial(considering only 192KB of flash)?
  2. Does it require any configuration?

Parents
  • Hi,

    There is not enough flash space to update the SoftDevice with dual banking. However, as you are using serial DFU and do not rely on the SoftDevice for the update, it should be possible given the correct configuration. You need NRF_DFU_SINGLE_BANK_APP_UPDATES set to 1 for that though, and that is set to 0 in your bootloader's sdk_config.h.

  • We tried setting NRF_DFU_SINGLE_BANK_APP_UPDATES=1, but it still fails. Also, I believe in our bootloader "NRF_DFU_FORCE_DUAL_BANK_APP_UPDATES" was set to "0", which by default indicates that the if dual-bank fails, fall back to single-bank (correct me if I am wrong here!).

    So, we are still at the same point, DFU of application works but DFU of SD fails with "InsufficientResources".

    Any guidelines on how much space is required to perform SD DFU?

  • Up on digging up more, it seems we have limited space for DFU even in the single-bank. As per the documents, in single-bank as well, we can use Bank-0 (Free + Application) to get the new Application/SD/BL. The size of this is somewhere around 56KB in our case.

    And SoftDevice size is somewhere around 96KB. So, we can update the application till its size is 56KB and it seems we can't update SoftDevice on nRF52811.

  • Hi,

    This is odd. It should be possible to do single bank of the SoftDevice. You can see this for instance form the implementation of use_single_bank() in components\libraries\bootloader\dfu\nrf_dfu_validation.c and nrf_dfu_cache_prepare() in components\libraries\bootloader\dfu\nrf_dfu_utils.c. Then see that bank0 is defined like this, so it starts at 0x1000 (MBR_SIZE) when the bootloader does not depend on a SoftDevice:

    uint32_t nrf_dfu_bank0_start_addr(void)
    {
        if (SD_PRESENT)
        {
            return ALIGN_TO_PAGE(SD_SIZE_GET(MBR_SIZE));
        }
        else
        {
            return MBR_SIZE;
        }
    }

Reply
  • Hi,

    This is odd. It should be possible to do single bank of the SoftDevice. You can see this for instance form the implementation of use_single_bank() in components\libraries\bootloader\dfu\nrf_dfu_validation.c and nrf_dfu_cache_prepare() in components\libraries\bootloader\dfu\nrf_dfu_utils.c. Then see that bank0 is defined like this, so it starts at 0x1000 (MBR_SIZE) when the bootloader does not depend on a SoftDevice:

    uint32_t nrf_dfu_bank0_start_addr(void)
    {
        if (SD_PRESENT)
        {
            return ALIGN_TO_PAGE(SD_SIZE_GET(MBR_SIZE));
        }
        else
        {
            return MBR_SIZE;
        }
    }

Children
No Data
Related