Multi-image LwM2M FOTA patch

Hello,

I'm building a multi-image project for an nRF9151: a two-stage bootloader (NSIB + MCUboot) plus two independent non-secure app images.

Each app needs to be able to FOTA-update itself, the other app image, and the modem, served as three LwM2M Advanced Firmware Update instances.

Since fota_download and lwm2m_client_utils hardcode img_num=0, they don't support this. I've written a patch against the SDK and would like to know whether opening a PR is the right next step.

Forked SDK can be found here (two last commits) and the test project that uses it here.

Patch overview:

fota_download: Replaces the hardcoded 0 passed to dfu_target_init() / dfu_target_schedule_update() with a configurable img_num.

lwm2m_client_utils: Replaces the single hardcoded "application" / PM_MCUBOOT_PRIMARY_ID instance with a table of (component_name, img_num) pairs registered via the new lwm2m_adv_firmware_mcuboot_inst_add() API, so each pair gets its own instance and the right MCUboot slot is used for download, schedule, and version reporting.

Note on Partition Manager dependency

Both the existing code and the new code identify MCUboot primary partitions via PM symbols (PM_MCUBOOT_PRIMARY_ID, PM_MCUBOOT_PRIMARY_1_ID, ...). The 3.3 release notes state PM will be removed by end of 2026, with DTS-based partitioning recommended for new designs excluding nRF91 Series. Since the target here is nRF9151, I read this as PM still being the supported path for this device, so keeping PM_* references in the patch should be fine. Please correct me if that reading is wrong.

Thanks!

Parents Reply Children
Related