Mesh OTA couldn't resume after target node reset

Hi,

I use NCS 3.2.4 and 54L15 DK. In the DFU target, I added configuration

CONFIG_DFU_TARGET=Y
CONFIG_DFU_TARGET_MCUBOOT=y
CONFIG_DFU_TARGET_STREAM_SAVE_PROGRESS=y

and also added the following content in dfu_recover function.

static int dfu_recover(struct bt_mesh_dfu_srv *srv,
                       const struct bt_mesh_dfu_img *img,
                       const struct bt_mesh_blob_io **io)
{
    size_t offset = 0;

    int err = dfu_target_mcuboot_offset_get(&offset);
    if (err) {
        printk("Failed to get MCUboot offset (err %d)\n", err);
        offset = 0; 
    }

    printk("Recovering BLOB transfer, already written: %zu bytes\n", offset);

    err = bt_mesh_blob_io_flash_init(&blob_flash_stream,
                                     FIXED_PARTITION_ID(slot1_partition),
                                     offset);
    if (err) {
        return err;
    }    

    *io = &blob_flash_stream.io;
    return 0;
}

After the distributor finished transmitting 3 chunks more, I manually reset the target device. In the RTT window, I entered the shell command: mesh models dfu cli resume, but the command returned error -22.

How can I implement the resume/breakpoint resumption feature for Mesh OTA?

  • Hello John,

    Sorry for the late reply. I have been out of office for a few days. 

    So I can build the application with your new prj.conf.

    Can you please describe how you initialize the DFU process?

    Best regards,

    Edvin

  • What I see when it boots up is:

    **** Booting MCUboot v2.3.0-dev-fce4dac2e629 ***
    *** Using nRF Connect SDK v3.3.0-ba167d9f3db4 ***
    *** Using Zephyr OS v4.3.99-fd9204a02d52 ***
    I: Starting bootloader
    I: Primary image: magic=good, swap_type=0x1, copy_done=0x3, image_ok=0x1
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Boot source: primary slot
    I: Image index: 0, Swap type: none
    I: Bootloader chainload address offset: 0xe000
    I: Image version: v1.0.0
    I: Jumping to the first image slot
    *** Booting Mesh DFU Target v3.3.0-9966ac3adc14 ***
    *** Using nRF Connect SDK v3.3.0-ba167d9f3db4 ***
    *** Using Zephyr OS v4.3.99-fd9204a02d52 ***
    Initializing...
    [00:00:00.018,003] <err> dfu_target: Unknown image type
    [00:00:00.018,853] <inf> fs_zms: 3 Sectors of 4096 bytes
    [00:00:00.018,862] <inf> fs_zms: alloc wra: 0, f60
    [00:00:00.018,868] <inf> fs_zms: data wra: 0, 20
    [00:00:00.018,952] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision                                                                                                                                                                                                                                             :
                                                27 03 7d 53 04 8d fe 99  a9 f2 9a ad                                                                                                                                                                                                                                              de 5b 6a e2 |'.}S.... .....[j.
                                                74 6c ac 75                                                                                                                                                                                                                                                                                   |tl.u
    [00:00:00.020,098] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.020,119] <inf> bt_hci_core: HW Variant: nRF54Lx (0x0005)
    [00:00:00.020,132] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0                                                                                                                                                                                                                                             x00) Version 39.32003 Build 4270654547
    [00:00:00.020,258] <inf> bt_hci_core: No ID address. App must call settings_load                                                                                                                                                                                                                                             ()
    Bluetooth initialized
    [00:00:00.022,386] <inf> bt_hci_core: HCI transport: SDC
    [00:00:00.022,435] <inf> bt_hci_core: Identity: E9:97:DA:36:30:56 (random)
    [00:00:00.022,453] <inf> bt_hci_core: HCI: version 6.2 (0x10) revision 0x30a3, m                                                                                                                                                                                                                                             anufacturer 0x0059
    [00:00:00.022,470] <inf> bt_hci_core: LMP: version 6.2 (0x10) subver 0x30a3
    [00:00:00.026,727] <inf> bt_mesh_provisionee: Device UUID: a0200c8b-f822-45f3-9f                                                                                                                                                                                                                                             df-f37407ddda0c
    Mesh initialized
    [00:00:00.028,747] <dbg> bt_mesh_dfu_srv: bt_mesh_dfu_srv_applied: Wrong state
    *** Booting MCUboot v2.3.0-dev-fce4dac2e629 ***
    *** Using nRF Connect SDK v3.3.0-ba167d9f3db4 ***
    *** Using Zephyr OS v4.3.99-fd9204a02d52 ***
    I: Starting bootloader
    I: Primary image: magic=good, swap_type=0x1, copy_done=0x3, image_ok=0x1
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Boot source: primary slot
    I: Image index: 0, Swap type: none
    I: Bootloader chainload address offset: 0xe000
    I: Image version: v1.0.0
    I: Jumping to the first image slot
    *** Booting Mesh DFU Target v3.3.0-9966ac3adc14 ***
    *** Using nRF Connect SDK v3.3.0-ba167d9f3db4 ***
    *** Using Zephyr OS v4.3.99-fd9204a02d52 ***
    Initializing...
    [00:00:00.019,600] <err> dfu_target: Unknown image type
    [00:00:00.022,260] <inf> fs_zms: 3 Sectors of 4096 bytes
    [00:00:00.022,270] <inf> fs_zms: alloc wra: 0, fc0
    [00:00:00.022,276] <inf> fs_zms: data wra: 0, 0
    [00:00:00.024,199] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision:
                                                27 03 7d 53 04 8d fe 99  a9 f2 9a ad de 5b 6a e2 |'.}S.... .....[j.
                                                74 6c ac 75                                      |tl.u
    [00:00:00.025,346] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
    [00:00:00.025,367] <inf> bt_hci_core: HW Variant: nRF54Lx (0x0005)
    [00:00:00.025,380] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 39.32003 Build 4270654547
    [00:00:00.025,506] <inf> bt_hci_core: No ID address. App must call settings_load()
    Bluetooth initialized
    [00:00:00.027,574] <inf> bt_hci_core: HCI transport: SDC
    [00:00:00.027,624] <inf> bt_hci_core: Identity: E9:97:DA:36:30:56 (random)
    [00:00:00.027,642] <inf> bt_hci_core: HCI: version 6.2 (0x10) revision 0x30a3, manufacturer 0x0059
    [00:00:00.027,658] <inf> bt_hci_core: LMP: version 6.2 (0x10) subver 0x30a3
    [00:00:00.037,383] <inf> bt_mesh_provisionee: Device UUID: a0200c8b-f822-45f3-9fdf-f37407ddda0c
    Mesh initialized
    [00:00:00.039,395] <dbg> bt_mesh_dfu_srv: bt_mesh_dfu_srv_applied: Wrong state

Related