partition manager

Can you please help us to convert following snippet from dts to mp_static.yml to use it for DFU applcation. We have external nand flash which used with littlefs and internal flash which used for boot, slot0, slot1 and dev_params zone (raw operations with flash).

CONCAT_2(&spi, SDHC_SPI_INST){
	compatible = "nordic,nrf-spi";
	status = "okay";
	pinctrl-0 = <&spi2_default>;
	pinctrl-1 = <&spi2_sleep>;
	pinctrl-names = "default", "sleep";

    cs-gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
	interrupts = < 35 SDHC_SPI_PRIO >;

    nand_flash: mt29f2g01a@0 {
		compatible = "jedec,spi-nand";
		reg = <0>;
		spi-max-frequency = <32000000>;
		jedec-id = [2c 24];
		
		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			storage_partition: partition@0 { //TODO: replace with mt29f2g01a and disable CONFIG_FILE_SYSTEM_SHELL
				reg = <0x0000000 0x10000000>;
			};
		};
	};
};

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

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x00000000 0x000C000>;
		};
		slot0_partition: partition@C000 {
			label = "image-0";
			reg = <0x0000C000 0x00079800>;
		};
		slot1_partition: partition@85800 {
			label = "image-1";
			reg = <0x00085800 0x00079800>;
		};
		dev_params_partition: partition@FF000 {
			reg = <0x000FF000 0x00001000>;
		};
	};
};

I tried to take partitions.yml which was generated by building app (without sysbuild) But it failes with following:

-- Found partition manager static configuration : C:/Projects/ars_trackers/ars_tracker_fw/ars_tracker_main_app/projects/main_app/pm_static.yml
Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined.
Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined.
Partition manager failed: Error when inspecting littlefs_storage, invalid address 0x7f800, expected 0x7f600,
Failed to partition region flash_primary, size of region: 1048576
Partition Configuration:
app:
  size: 497664
dev_params_partition:
  size: 4096
littlefs_storage:
  placement:
    before:
    - end
  size: 24576
mcuboot:
  size: 49152
mcuboot_pad:
  placement:
    align:
      start: 4096
  size: 512
mcuboot_primary:
  size: 546816
mcuboot_primary_app:
  size: 546816
mcuboot_secondary:
  size: 497664

CMake Error at C:/Projects/ars_trackers/ars_tracker_fw/nrf/cmake/sysbuild/partition_manager.cmake:150 (message):
  Partition Manager failed, aborting.  Command:
  C:/Python310/python.exe;C:/Projects/ars_trackers/ars_tracker_fw/nrf/scripts/partition_manager.py;--input-files;C:/Projects/ars_trackers/ars_tracker_fw/ars_tracker_main_app/projects/boot/build/main_app/modules/nrf/subsys/partition_manager/pm.yml.file_system;C:/Projects/ars_trackers/ars_tracker_fw/ars_tracker_main_app/projects/boot/build/mcuboot/zephyr/include/generated/pm.yml;C:/Projects/ars_trackers/ars_tracker_fw/ars_tracker_main_app/projects/boot/build/main_app/zephyr/include/generated/pm.yml;--regions;sram_primary;flash_primary;--output-partitions;C:/Projects/ars_trackers/ars_tracker_fw/ars_tracker_main_app/projects/boot/build/partitions.yml;--output-regions;C:/Projects/ars_trackers/ars_tracker_fw/ars_tracker_main_app/projects/boot/build/regions.yml;--static-config;C:/Projects/ars_trackers/ars_tracker_fw/ars_tracker_main_app/projects/main_app/pm_static.yml;--sram_primary-size;0x40000;--sram_primary-base-address;0x20000000;--sram_primary-placement-strategy;c-- Configuring incomplete, errors occurred!
omplex;--sram_primary-dynamic-partition;sram_primary;--flash_primary-size;0x100000;--flash_primary-base-address;0x0;--flash_primary-placement-strategy;complex;--flash_primary-device;flash_controller;--flash_primary-default-driver-kconfig;CONFIG_SOC_FLASH_NRF
Call Stack (most recent call first):
  C:/Projects/ars_trackers/ars_tracker_fw/nrf/cmake/sysbuild/partition_manager.cmake:612 (partition_manager)
  C:/Projects/ars_trackers/ars_tracker_fw/nrf/sysbuild/CMakeLists.txt:468 (include)
  cmake/modules/sysbuild_extensions.cmake:563 (nrf_POST_CMAKE)
  cmake/modules/sysbuild_extensions.cmake:563 (cmake_language)
  cmake/modules/sysbuild_images.cmake:23 (sysbuild_module_call)
  cmake/modules/sysbuild_default.cmake:19 (include)
  C:/Projects/ars_trackers/ars_tracker_fw/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
  C:/Projects/ars_trackers/ars_tracker_fw/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)       
  C:/Projects/ars_trackers/ars_tracker_fw/zephyr/share/sysbuild-pSee also "C:/Projects/ars_trackers/ars_tracker_fw/ars_tracker_main_app/projects/boot/build/CMakeFiles/CMakeOutput.log".
ackage/cmake/SysbuildConfig.cmake:8 (include)
  template/CMakeLists.txt:10 (find_package)

pm_static.yml that I used:

app:
  address: 0xc000
  end_address: 0x85800
  region: flash_primary
  size: 0x79800
dev_params_partition:
  address: 0xff000
  end_address: 0x100000
  region: flash_primary
  size: 0x1000
mcuboot:
  address: 0x0
  end_address: 0xc000
  region: flash_primary
  size: 0xc000
mcuboot_primary:
  address: 0xc000
  end_address: 0x91800
  orig_span: &id001
  - app
  region: flash_primary
  size: 0x85800
  span: *id001
mcuboot_primary_app:
  address: 0xc000
  end_address: 0x91800
  orig_span: &id002
  - app
  region: flash_primary
  size: 0x85800
  span: *id002
mcuboot_secondary:
  address: 0x85800
  end_address: 0xff000
  region: flash_primary
  size: 0x79800
sram_primary:
  address: 0x20000000
  end_address: 0x20040000
  region: sram_primary
  size: 0x40000


ncs 2.7.0

Parents Reply Children
No Data
Related