Issue with Partition Manager to Devicetree migration on nRF54L15 (MCUboot + TF-M)

Hello.

I am currently migrating a project from NCS v3.2.4 to v3.3.1 and transitioning from Partition Manager to devicetree-based partitioning, following the official migration guide:
https://nrfconnectdocs.nordicsemi.com/ncs/latest/nrf/releases_and_maturity/migration/migration_partitions.html

While the build process succeeds using the generated .overlay files, the application fails to boot after MCUboot.
It enters a continuous reboot loop.

Serial Terminal Log:

*** Booting MCUboot v2.3.0-dev-3de5b4df5f9f ***
*** Using nRF Connect SDK v3.3.1-1d7a0b0e49b8 ***
*** Using Zephyr OS v4.3.99-37e6c28576ee ***
I: Starting bootloader
I: Image index: 0, Swap type: none
I: Bootloader chainload address offset: 0x14000
I: Image version: v0.3.0
I: Jumping to the first image slot
*** Booting MCUboot v2.3.0-dev-3de5b4df5f9f ***
... (loop repeats)

Configuration Details:

  • Device: nRF54L15
  • Setup: MCUboot + TF-M
  • Context: I have been unable to find specific examples for an nRF54L15 setup with both MCUboot and TF-M using the new devicetree partitioning method.

Attached Files:

  • pm_static.yml: Original working partition configuration.
  • generate.overlay: Generated via pm_to_dts.py.
  • app.overlay: Modified version of the generated file
    (removed redundant nodes, and manually adjusted cpuapp_sram to reflect previous Kconfig settings:
    CONFIG_PM_PARTITION_SIZE_TFM=0x1F800 and CONFIG_PM_PARTITION_SIZE_TFM_SRAM=0x10000).
  • mcuboot.overlay: File used for MCUboot.

app:
  address: 0x34000
  end_address: 0xc6000
  region: flash_primary
  size: 0x92000
mcuboot:
  address: 0x0
  end_address: 0xc000
  region: flash_primary
  size: 0xc000
mcuboot_pad:
  address: 0x14000
  end_address: 0x14800
  region: flash_primary
  size: 0x800
mcuboot_primary:
  address: 0x14000
  end_address: 0xc6000
  orig_span: &id001
  - mcuboot_pad
  - tfm
  - app
  region: flash_primary
  size: 0xb2000
  span: *id001
mcuboot_primary_app:
  address: 0x14800
  end_address: 0xc6000
  orig_span: &id002
  - tfm
  - app
  region: flash_primary
  size: 0xb1800
  span: *id002
mcuboot_secondary:
  address: 0xc6000
  end_address: 0x141000
  region: flash_primary
  size: 0x7B000
littlefs_storage:
  address: 0x141000
  end_address: 0x155000
  region: flash_primary
  size: 0x14000
settings_storage:
  address: 0x155000
  end_address: 0x165000
  region: flash_primary
  size: 0x10000
tfm_its:
  address: 0xc000
  end_address: 0xe000
  region: flash_primary
  size: 0x2000
tfm_otp_nv_counters:
  address: 0xe000
  end_address: 0x10000
  region: flash_primary
  size: 0x2000
tfm_ps:
  address: 0x10000
  end_address: 0x14000
  region: flash_primary
  size: 0x4000
tfm:
  address: 0x14800
  end_address: 0x34000
  region: flash_primary
  size: 0x1f800
nonsecure_storage:
  address: 0x155000
  end_address: 0x165000
  orig_span: &id004
  - settings_storage
  region: flash_primary
  size: 0x10000
  span: *id004
tfm_nonsecure:
  address: 0x34000
  end_address: 0xc6000
  orig_span: &id007
  - app
  region: flash_primary
  size: 0x92000
  span: *id007
tfm_secure:
  address: 0x14000
  end_address: 0x34000
  orig_span: &id008
  - mcuboot_pad
  - tfm
  region: flash_primary
  size: 0x20000
  span: *id008
tfm_storage:
  address: 0xc000
  end_address: 0x14000
  orig_span: &id009
  - tfm_its
  - tfm_otp_nv_counters
  - tfm_ps
  region: flash_primary
  size: 0x8000
  span: *id009

&cpuapp_rram {
	partitions {
		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x0 0xc000>;
		};

		tfm_its_partition: partition@c000 {
			label = "tfm-its";
			reg = <0xc000 0x2000>;
		};

		tfm_otp_partition: partition@e000 {
			label = "tfm-otp";
			reg = <0xe000 0x2000>;
		};

		tfm_ps_partition: partition@10000 {
			label = "tfm-ps";
			reg = <0x10000 0x4000>;
		};

		slot0_partition: partition@14000 {
			compatible = "fixed-subpartitions";
			label = "image-0";
			reg = <0x14000 0xb2000>;
			ranges = <0x0 0x14000 0xb2000>;
			#address-cells = <1>;
			#size-cells = <1>;

			slot0_s_partition: partition@0 {
				label = "image-0-secure";
				reg = <0x0 0x20000>;
			};

			slot0_ns_partition: partition@20000 {
				label = "image-0-nonsecure";
				reg = <0x20000 0x92000>;
			};
		};

		slot1_partition: partition@c6000 {
			label = "image-1";
			reg = <0xc6000 0x7b000>;
		};

		littlefs_storage: partition@141000 {
			label = "littlefs-storage";
			reg = <0x141000 0x14000>;
		};

		nonsecure_storage: partition@155000 {
			label = "nonsecure-storage";
			reg = <0x155000 0x10000>;
		};

		storage_partition: partition@155000 {
			label = "storage";
			reg = <0x155000 0x10000>;
		};
	};
};

/delete-node/ &sram0_ns;

&cpuapp_sram {
	sram0_s: image_s@0 {
		/* Secure image memory */
		reg = <0x0 DT_SIZE_K(64)>;
		ranges = <0x0 0x0 DT_SIZE_K(64)>;
	};

	sram0_ns: image_ns@10000 {
		#address-cells = <1>;
		#size-cells = <1>;
		/* Non-Secure image memory */
		reg = <0x10000 DT_SIZE_K(192)>;
		ranges = <0x0 0x10000 DT_SIZE_K(192)>;
	};
};

/delete-node/ &slot0_partition;
/delete-node/ &tfm_ps_partition;
/delete-node/ &tfm_its_partition;
/delete-node/ &tfm_otp_partition;
/delete-node/ &slot0_ns_partition;
/delete-node/ &storage_partition;

&cpuapp_rram {
	partitions {
		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x0 0xc000>;
		};

		tfm_its_partition: partition@c000 {
			label = "tfm-its";
			reg = <0xc000 0x2000>;
		};

		tfm_otp_partition: partition@e000 {
			label = "tfm-otp";
			reg = <0xe000 0x2000>;
		};

		tfm_ps_partition: partition@10000 {
			label = "tfm-ps";
			reg = <0x10000 0x4000>;
		};

		slot0_partition: partition@14000 {
			compatible = "fixed-subpartitions";
			label = "image-0";
			reg = <0x14000 0xb2000>;
			ranges = <0x0 0x14000 0xb2000>;
			#address-cells = <1>;
			#size-cells = <1>;

			slot0_s_partition: partition@0 {
				label = "image-0-secure";
				reg = <0x0 0x20000>;
			};

			slot0_ns_partition: partition@20000 {
				label = "image-0-nonsecure";
				reg = <0x20000 0x92000>;
			};
		};

		slot1_partition: partition@c6000 {
			label = "image-1";
			reg = <0xc6000 0x7b000>;
		};

		littlefs_storage: partition@141000 {
			label = "littlefs-storage";
			reg = <0x141000 0x14000>;
		};

		storage_partition: partition@155000 {
			label = "storage";
			reg = <0x155000 0x10000>;
		};
	};
};

/ {
	chosen {
		zephyr,code-partition = &boot_partition;
	};
};

/delete-node/ &boot_partition;
/delete-node/ &slot0_partition;
/delete-node/ &slot1_partition;
/delete-node/ &storage_partition;

&cpuapp_rram {
	partitions {
		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x0 0xc000>;
		};

		tfm_its_partition: partition@c000 {
			label = "tfm-its";
			reg = <0xc000 0x2000>;
		};

		tfm_otp_partition: partition@e000 {
			label = "tfm-otp";
			reg = <0xe000 0x2000>;
		};

		tfm_ps_partition: partition@10000 {
			label = "tfm-ps";
			reg = <0x10000 0x4000>;
		};

		slot0_partition: partition@14000 {
			compatible = "fixed-subpartitions";
			label = "image-0";
			reg = <0x14000 0xb2000>;
			ranges = <0x0 0x14000 0xb2000>;
			#address-cells = <1>;
			#size-cells = <1>;

			slot0_s_partition: partition@0 {
				label = "image-0-secure";
				reg = <0x0 0x20000>;
			};

			slot0_ns_partition: partition@20000 {
				label = "image-0-nonsecure";
				reg = <0x20000 0x92000>;
			};
		};

		slot1_partition: partition@c6000 {
			label = "image-1";
			reg = <0xc6000 0x7b000>;
		};

		littlefs_storage: partition@141000 {
			label = "littlefs-storage";
			reg = <0x141000 0x14000>;
		};

		storage_partition: partition@155000 {
			label = "storage";
			reg = <0x155000 0x10000>;
		};
	};
};

Could you please review my configuration and advise on the correct approach for setting up devicetree partitions in an nRF54L15 MCUboot/TF-M environment?

Best regards,

a.da

Parents
  • Hi again Shogo

    I've been discussing this with the developers today, and the flash_layout update shouldn't be necessary, as the pm_to_dts script should generaet the dts file correctly. There doesn't seem to be anything obviously wrong with the .dts file either, but can you try building the application with the following configs to get more information from the logging to find out what's wrong here:

    CONFIG_TFM_SPM_LOG_LEVEL_DEBUG=y
    CONFIG_TFM_EXCEPTION_INFO_DUMP=y

    Best regards,

    Simon

  • Hi Simon,

    Here is the log after applying the requested Kconfig changes:

    Writing random Hardware Unique Keys to the KMU.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Success
    Pins have been configured as secure.
    GPIO port: 0x00000000
    Pin: 0x00000000
    Pin: 0x00000001
    Booting TF-M v2.2.2**
    [Sec Thread] Secure image initializing!
    TF-M isolation level is: 0x00000001
    TF-M Float ABI: Hard
    Lazy stacking enabled
    Creating an empty ITS flash layout.
    Creating an empty PS flash layout.
    [INF][PS] Encryption alg: 0x5500200
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    FATAL ERROR: HardFault
    Here is some context for the exception:
        EXC_RETURN (LR): 0xFFFFFFF1
        Exception came from secure FW in handler mode.
        xPSR:    0xA0000003
        MSP:     0x20000BF8
        PSP:     0x2000B188
        MSP_NS:  0xFFFFFFE0
        PSP_NS:  0xFFFFFFFC
        Exception frame at: 0x20000BF8
            R0:   0x2000B1F4
            R1:   0xFFFFFFE0
            R2:   0x00000020
            R3:   0x00000000
            R12:  0x00000000
            LR:   0x00018847
            PC:   0x00023F62
            xPSR: 0xA1000005
        Callee saved register state:
            R4:   0x2000B1F4
            R5:   0xFFFFFFE0
            R6:   0x00000000
            R7:   0x00000000
            R8:   0x00000000
            R9:   0x00000000
            R10:  0x00000000
            R11:  0x00000000
        CFSR:  0x00009200
        BFSR:  0x00000092
        BFAR: 0xFFFFFFE0
        MMFSR: 0x00000000
        MMFAR: Not Valid
        UFSR:  0x00000000
        HFSR:  0x40000000
        SFSR:  0x00000001
        SFAR: Not Valid

    Additionally, I decoded the PC (Program Counter) and LR (Link Register) addresses from the fault using the addr2line tool:

    • PC: 0x00023F62
      C:/ncs/v3.3.1/modules/tee/tf-m/trusted-firmware-m/secure_fw/shared/crt_memcpy.c:26
    • LR: 0x00018847
      ​​C:/ncs/v3.3.1/modules/tee/tf-m/trusted-firmware-m/platform/ext/common/exception_info.c:233

    I hope this helps narrow down the issue. Thank you for your continued support.

    Best regards,

    a.da

Reply
  • Hi Simon,

    Here is the log after applying the requested Kconfig changes:

    Writing random Hardware Unique Keys to the KMU.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Success
    Pins have been configured as secure.
    GPIO port: 0x00000000
    Pin: 0x00000000
    Pin: 0x00000001
    Booting TF-M v2.2.2**
    [Sec Thread] Secure image initializing!
    TF-M isolation level is: 0x00000001
    TF-M Float ABI: Hard
    Lazy stacking enabled
    Creating an empty ITS flash layout.
    Creating an empty PS flash layout.
    [INF][PS] Encryption alg: 0x5500200
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    Powered on CRACEN.
    Powered off CRACEN.
    FATAL ERROR: HardFault
    Here is some context for the exception:
        EXC_RETURN (LR): 0xFFFFFFF1
        Exception came from secure FW in handler mode.
        xPSR:    0xA0000003
        MSP:     0x20000BF8
        PSP:     0x2000B188
        MSP_NS:  0xFFFFFFE0
        PSP_NS:  0xFFFFFFFC
        Exception frame at: 0x20000BF8
            R0:   0x2000B1F4
            R1:   0xFFFFFFE0
            R2:   0x00000020
            R3:   0x00000000
            R12:  0x00000000
            LR:   0x00018847
            PC:   0x00023F62
            xPSR: 0xA1000005
        Callee saved register state:
            R4:   0x2000B1F4
            R5:   0xFFFFFFE0
            R6:   0x00000000
            R7:   0x00000000
            R8:   0x00000000
            R9:   0x00000000
            R10:  0x00000000
            R11:  0x00000000
        CFSR:  0x00009200
        BFSR:  0x00000092
        BFAR: 0xFFFFFFE0
        MMFSR: 0x00000000
        MMFAR: Not Valid
        UFSR:  0x00000000
        HFSR:  0x40000000
        SFSR:  0x00000001
        SFAR: Not Valid

    Additionally, I decoded the PC (Program Counter) and LR (Link Register) addresses from the fault using the addr2line tool:

    • PC: 0x00023F62
      C:/ncs/v3.3.1/modules/tee/tf-m/trusted-firmware-m/secure_fw/shared/crt_memcpy.c:26
    • LR: 0x00018847
      ​​C:/ncs/v3.3.1/modules/tee/tf-m/trusted-firmware-m/platform/ext/common/exception_info.c:233

    I hope this helps narrow down the issue. Thank you for your continued support.

    Best regards,

    a.da

Children
No Data
Related