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

Firmware upgrade OTA with BL+APP

We have a device with firmware based on 14.2 (with sd-id 0x96) and we're trying to do a DFU over BLE to a firmware base on 15.2 (with sd-id 0xAE).

We can do a firmware update using segger and install the SD, BL and APP (with settings) and have it run correctly.

We can create a package with all the components and using nRF Connect on Android upload the firmware (signed with the correct key). However, this process never runs ... we just land in a situation where LED2 (on the PCA10056) ends up flashing continuously.

Checking the sd-id with a memrd, gives us the correct SD (0xAE), but all the iterations I have tried have ended up in the same place including SD+BL (no APP).

  • Adding to this ... I have subsequently added a couple of debugging lines to

    int32_t nrf_dfu_mbr_copy_bl(uint32_t * p_src, uint32_t len)
    ...
    NRF_LOG_DEBUG("About to send BL copy command"); // DKL
    ret_val = sd_mbr_command(&command);
    NRF_LOG_DEBUG("Do I get here"); // DKL

    and the logs show

    <debug> app: Bootloader not verified, copying: Src: 0x00046E7C, Len: 0x0000AF58

    <debug> app: About to send BL copy command

    <info> app: Inside main

  • Hi David,

    I did not spot this earlier, but this is caused by the fact that you are trying to do to a bootloader upgrade with DFU from S140 from S140 5.0.0-2-alpha. This is an alpha SoftDevice which did not support upgrading the bootloader via DFU, as specified in the release notes under Limitations:

    The SV-calls sd_mbr_command_vector_table_base_set() and sd_mbr_command_copy_bl() are not supported
    (DRGN-8197). Using these calls leads to undefined behavior.

    The specific problem is that the MBR write protects the bootloader flash region using ACL, and I do not believe there are any workarounds for this, other than using a debugger to flash a new SoftDevice.

    This is not a problem when upgrading from S140 6.0.0, which was the first production ready (and qualified) SoftDevice for the nRF52840.

    Einar

  • Thanks, Einar

    I kind of suspected the conclusion was heading in this direction (although I did not notice the limitations in the release notes).  Thanks for finally identifying this as a definitive issue.

    Cheers,
    David

Related