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.