Utilize device tree partition with MCU boot

I am working on custom hardware with an nRF52840. I have added the MCU boot in my earlier development as well but this issue I have never faced before.

Problem statement

I have defined a partition as mentioned below snippet where I have used the minimal MCU boot size configuration along with the MOVE WITH SCRATCH configuration. Along with 4 defined partitions of MCU boot boot, slot0, slot1, and scratc,h there is another partition named data_logger_storage which I have added to save my application data.

&flash0 {

	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x00000000 0x00003E00>;
		};
		slot0_partition: partition@3E00 {
			label = "image-0";
			reg = <0x00003E00 0x0007B000>;
		};
		slot1_partition: partition@7EE00 {
			label = "image-1";
			reg = <0x0007EE00 0x0007B000>;
		};
		scratch_partition: partition@F9E00 {
			label = "image-scratch";
			reg = <0xF9E00 0x3F00>;
		};
		/*
		 * The flash starting at 0x000f8000 and ending at
		 * 0x000fffff is reserved for use by the application.
		 */

		/*
		 * Storage partition will be used by FCB/LittleFS/NVS
		 * if enabled.
		 */
		 data_logger_storage_partition: partition@FDD00 {
			label = "storage";
			reg = <0x000FDD00 0x00002000>;
		};		
	};
};

Here when I compile my code, I face an error 

error: 'PM_PM_PM_data_logger_storage_partition_ID_LABEL_OFFSET' was not declared in this scope

I have not added the pm.yml or pm_static.yml file in my application, because I have other running code with MCU boot and device tree partition that does not have the pm.yml.

So here are my query,
1. How can we use the device tree partition only when we enable the MCU boot? Because I do not have a scope to define pm.yml as the same code is designed in such a way that it can be used with any of nrf boards i.e the same code can be built for nrf52840 and nrf5340

I have attached the partitions.yml generated with this build, which certainly has different data from what I have defined in the device tree.

Parents
  • EMPTY_0:
      address: 0x7c00
      end_address: 0x8000
      placement:
        before:
        - mcuboot_pad
      region: flash_primary
      size: 0x400
    app:
      address: 0x8200
      end_address: 0x81000
      region: flash_primary
      size: 0x78e00
    mcuboot:
      address: 0x0
      end_address: 0x7c00
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0x7c00
    mcuboot_pad:
      address: 0x8000
      end_address: 0x8200
      placement:
        align:
          start: 0x1000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    mcuboot_primary:
      address: 0x8000
      end_address: 0x81000
      orig_span: &id001
      - mcuboot_pad
      - app
      region: flash_primary
      sharers: 0x1
      size: 0x79000
      span: *id001
    mcuboot_primary_app:
      address: 0x8200
      end_address: 0x81000
      orig_span: &id002
      - app
      region: flash_primary
      size: 0x78e00
      span: *id002
    mcuboot_secondary:
      address: 0x81000
      end_address: 0xfa000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x1000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0x79000
    nvs_storage:
      address: 0xfa000
      end_address: 0x100000
      placement:
        align:
          start: 0x1000
        before:
        - end
      region: flash_primary
      size: 0x6000
    sram_primary:
      address: 0x20000000
      end_address: 0x20040000
      region: sram_primary
      size: 0x40000
    

Reply
  • EMPTY_0:
      address: 0x7c00
      end_address: 0x8000
      placement:
        before:
        - mcuboot_pad
      region: flash_primary
      size: 0x400
    app:
      address: 0x8200
      end_address: 0x81000
      region: flash_primary
      size: 0x78e00
    mcuboot:
      address: 0x0
      end_address: 0x7c00
      placement:
        before:
        - mcuboot_primary
      region: flash_primary
      size: 0x7c00
    mcuboot_pad:
      address: 0x8000
      end_address: 0x8200
      placement:
        align:
          start: 0x1000
        before:
        - mcuboot_primary_app
      region: flash_primary
      size: 0x200
    mcuboot_primary:
      address: 0x8000
      end_address: 0x81000
      orig_span: &id001
      - mcuboot_pad
      - app
      region: flash_primary
      sharers: 0x1
      size: 0x79000
      span: *id001
    mcuboot_primary_app:
      address: 0x8200
      end_address: 0x81000
      orig_span: &id002
      - app
      region: flash_primary
      size: 0x78e00
      span: *id002
    mcuboot_secondary:
      address: 0x81000
      end_address: 0xfa000
      placement:
        after:
        - mcuboot_primary
        align:
          start: 0x1000
      region: flash_primary
      share_size:
      - mcuboot_primary
      size: 0x79000
    nvs_storage:
      address: 0xfa000
      end_address: 0x100000
      placement:
        align:
          start: 0x1000
        before:
        - end
      region: flash_primary
      size: 0x6000
    sram_primary:
      address: 0x20000000
      end_address: 0x20040000
      region: sram_primary
      size: 0x40000
    

Children
No Data
Related