Make storage and mcuboot slot on external flash

I am trying to split the external memory into littlefs storage and mcuboot secondary slot. But I'm not sure what I'm doing right

pm_static.yml

mcuboot_secondary:
  address: 0x0
  device: DT_CHOSEN(nordic_pm_ext_flash)
  end_address: 0xf2000
  placement:
    align:
      start: 0x4
  region: external_flash
  share_size:
  - mcuboot_primary
  size: 0xf2000
# littlefs_storage:
#   address: 0x100000
#   end_address: 0x400000
#   region: external_flash
#   after:
#   - mcuboot_secondary
#   size: 0x300000
external_flash:
  address: 0x0
  after:
  - lfs_Storage
  size: 0x400000
  device: DT_CHOSEN(nordic_pm_ext_flash)
  region: external_flash

board_file.dts

&qspi {
    ...
    mx25r64: mx25r6435f@0 {
    ...
        partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;
	
			littlefs_storage: partition@0 {
				label = "littlefs_storage";
				reg = <0x000000 0x300000>;
			};
        };
    }
}

  • Hi,

    There should not be a conflict between using littlefs and secondary slot on external flash, and this look ssensible for me. I would expect that you also have this in a .dts or .overlay file though:

    / {
    	chosen {
    		nordic,pm-ext-flash = &mx25r64;
    	};
    };

    With that, does it work? If now, in what way does it not work?

  • Should I specify in pm_static like this:

    mcuboot_secondary:
      address: 0x0
      device: DT_CHOSEN(nordic_pm_ext_flash)
      end_address: 0xf2000
      placement:
        align:
          start: 0x4
      region: external_flash
      share_size:
      - mcuboot_primary
      size: 0xf2000
    littlefs_storage:
      address: 0xf2000
      end_address: 0x300000
      region: external_flash
      after:
      - mcuboot_secondary
      size: 0x20E000
    external_flash:
      address: 0x300000           <-------------------
      size: 0x100000              <-------------------
      device: DT_CHOSEN(nordic_pm_ext_flash)
      region: external_flash

    or like this:

    mcuboot_secondary:
      address: 0x0
      device: DT_CHOSEN(nordic_pm_ext_flash)
      end_address: 0xf2000
      placement:
        align:
          start: 0x4
      region: external_flash
      share_size:
      - mcuboot_primary
      size: 0xf2000
    littlefs_storage:
      address: 0xf2000
      end_address: 0x300000
      region: external_flash
      after:
      - mcuboot_secondary
      size: 0x20E000
    external_flash:
      address: 0x0           <----------------
      size: 0x400000         <----------------
      device: DT_CHOSEN(nordic_pm_ext_flash)
      region: external_flash

  • Hi,

    The first one looks correct. These are separate partitions.

Related