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?

Related