NCS 3.4.0, nRF91, DFU without external flash and without SECURE_BOOT is broken

NCS 3.4.0, nRF91, no SECURE_BOOT, no nordic,pm-ext-flash.

There is a bug in selecting the UPLOAD_FLASH_AREA_LABEL, see my ticket in the zepyhr project.

That was unfortunately closed with the remark, that it must be handled here in the DevZone.

In short:

subsys/dfu/img_util/flash_img.c uses

#if defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) && (CONFIG_TFM_MCUBOOT_IMAGE_NUMBER == 2)
#define UPLOAD_FLASH_AREA_LABEL slot1_ns_partition
#else
#if PARTITION_EXISTS(slot1_partition) && \
    PARTITION_IS_RUNNING_APP_PARTITION(slot0_partition)
#define UPLOAD_FLASH_AREA_LABEL slot1_partition
#else
#define UPLOAD_FLASH_AREA_LABEL slot0_partition
#endif
#endif

but the app runs from slot0_ns_partition, therefore not slot1_partition is used for uploading, it uses slot0_partition.

Using slot0_partition will then break DFU, because the running app will overwrite itself. 

 

Parents Reply Children
Related