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).

  • Hi.

    Can you please explain some more about the update process?

    Do you create one packet with SD, BL, and APP? Or do you create two packets, one with SD + BL, and one packet with APP?

    Can you please paste the nrfutil command that you used?

    Best regards,

    Andreas

  • Hi Andreas, thank you for your response.  In answer to your question and further explanation, I will try and elucidate.

    I am testing this on the PCA10056.  I am able to flash the DK with SD v 5.0.0-2.alpha and a working Bootloader.

    I have tried both with one packet (SD+BL+APP) and two packets (SD + BL) + (APP).  In both cases, after the first packet, the DK no longer advertises or responds. LED2 starts flashing vigorously, even after a hard reset.

    The nrfutil command is

    nrfutil pkg generate --key-file keys/private.pem --hw-version 52 --sd-req 0x96,0xAE --bootloader bootloader.hex --bootloader-version 1 --softdevice s140_nrf52_6.1.0_softdevice.hex --sd-id 0xAE DFU_package.zip

    I have tested by loading the BL + SD (v 6.1.0) via nrfjprog and then using DFU to load the APP package and this works.  I am also able to load the APP via nrfjprog (with settings attached) which also works.

    The main case that does not work, is loading the new (SD + BL) OTA with the old SD and BL installed.

    I hope I have covered everything ... happy to fill in anything missing.

    Cheers,
    David

  • Hi David.

    Your nrfutil command seems correct.

    Can you create a bootloader settings page, and merge that with the bootloader?

    Can you try to build a debug bootloader and post the log output here?

    Best regards,

    Andreas

  • Hi Andreas,

    If I add the settings to the BootLoader, the DFU refuses to execute ... it just disconnects.

    If I add a BL with debugging (to be uploaded), the DFU also refuses to execute ... it also just disconnects.

    If I remove the settings and use the BL without debugging, it correcly executes (although the outcome is the same as before).

    I have tested the BL with debugger by using nrfjprog to program and it works correctly.  However what we're trying to do is have the debugging version of the BL programmed by DFU over BLE, so we can see the logs when it fails and I don't seem to be able to get there.

    I seem to be slightly stumped ... yet again.

    Further thoughts?
    David

  • Hi again Andreas,

    Slightly finiky, but I recompiled the 14.2 BL and used a new version, and then managed to upload the BL and SD for 15.2, which failed similarly (same LED flashing), as well as being able to get some log data.

    I will look as well to see what to make of it ... in the meantime, I'm not quite sure where things begin and end but this is the gist.

    <00> info> app: Inside main
    <00> debug> app: In nrf_bootloader_init
    <00> debug> app: in weak nrf_dfu_init_user
    <00> debug> app: In real nrf_dfu_init
    <00> debug> nrf_dfu_settings: Running nrf_dfu_settings_init(sd_irq_initialized=false).
    <00> debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=false)...
    <00> debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    <00> debug> app: Initializing the clock.
    <00> debug> app: Enter nrf_dfu_continue
    <00> debug> app: Valid SD + BL
    <00> debug> app: Enter nrf_dfu_sd_bl_continue
    <00> debug> app: Enter nrf_bootloader_dfu_sd_continue
    <00> debug> app: SD already copied
    <00> debug> app: Verifying BL: Addr: 0x000F3000, Src: 0x00046E7C, Len: 0x00005510
    <00> debug> app: Bootloader not verified, copying: Src: 0x00046E7C, Len: 0x00005510
    <00> info> app: Inside main

    Cheers,
    David

Related