Matter Application throws FIH_PANIC within flash_area_open()

Hello,

I am developing a Door Lock Matter application using the nRF5340 + AT25XE321D (32Mb SPI-NOR External flash). I am having problems with getting my Matter application to boot using my current configuration. The application throws an FIH_PANIC in this piece of code in bootloader/mcuboot/boot/bootutil/src/loader.c on boot.

I am using nRF Connect SDK v2.6.1.

/* Open primary and secondary image areas for the duration
* of this call.
*/
for (slot = 0; slot < BOOT_NUM_SLOTS; slot++) {
    fa_id = flash_area_id_from_multi_image_slot(image_index, slot);
    rc = flash_area_open(fa_id, &BOOT_IMG_AREA(state, slot));
    assert(rc == 0);

    if (rc != 0) {
        BOOT_LOG_ERR("Failed to open flash area ID %d (image %d slot %d): %d, "
                         "cannot continue", fa_id, image_index, (int8_t)slot, rc);
        FIH_PANIC;
    }
}

This is my devicetree definition for the SPI-NOR Flash Device tree:

arduino_spi: &spi4 {
	compatible = "nordic,nrf-spim";
	status = "okay";
	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
	pinctrl-0 = <&spi4_default>;
	pinctrl-1 = <&spi4_sleep>;
	pinctrl-names = "default", "sleep";
	at25xe321d: at25xe321d@0 {
		status = "okay";
		compatible = "jedec,spi-nor";
		reg = < 0 >;
		spi-max-frequency = < 100000000 >;
		hold-gpios = < &gpio0 6 GPIO_ACTIVE_LOW >;
		size = < 0x400000 >;
		has-dpd;
		t-enter-dpd = < 3000 >;
		t-exit-dpd = < 1200000 >;
		jedec-id = [ 1f 47 0c ];
	};
};

This is my pm_static_dfu.yml file:

mcuboot:
  address: 0x0
  size: 0x10000
  region: flash_primary
mcuboot_pad:
  address: 0x10000
  size: 0x200
app:
  address: 0x10200
  size: 0xe6e00
mcuboot_primary:
  orig_span: &id001
  - mcuboot_pad
  - app
  span: *id001
  address: 0x8000
  size: 0xef000
  region: flash_primary
mcuboot_primary_app:
  orig_span: &id002
  - app
  span: *id002
  address: 0x10200
  size: 0xe6e00
factory_data:
  address: 0xf7000
  size: 0x1000
  region: flash_primary
settings_storage:
  address: 0xf8000
  size: 0x8000
  region: flash_primary
mcuboot_primary_1:
  address: 0x0
  size: 0x40000
  device: flash_ctrl
  region: ram_flash
mcuboot_secondary:
  address: 0x0
  size: 0xef000
  device: DT_CHOSEN(nordic_pm_ext_flash)
  region: external_flash
mcuboot_secondary_1:
  address: 0xef000
  size: 0x40000
  device: DT_CHOSEN(nordic_pm_ext_flash)
  region: external_flash
external_flash:
  address: 0x12F000
  size: 0x2D1000
  device: DT_CHOSEN(nordic_pm_ext_flash)
  region: external_flash
pcd_sram:
  address: 0x20000000
  size: 0x2000
  region: sram_primary

Attached is also: (Filenames are only changed for devzone)

  1. prj.conf, which is in my child_image/mcuboot/prj.conf
  2. nrf5340dk_nrf5340_cpuapp.overlay which is located in child_image/mcuboot/nrf5340dk_nrf5340_cpuapp/nrf5340dk_nrf5340_cpuapp.overlay.
  3. Attached is also my boards/nrf5340dk_nrf5340_cpuapp.overlay which I am building my application with!
  4. the main prj.conf located in the project root

When debugging, the slot variable is 1. So I expect that mcuboot_secondary is failing.

I would sincerely appreciate any and all help!

0755.mcuboot_prj.conf

2821.mcuboot_nrf5340dk_nrf5340_cpuapp.overlay

4087.nrf5340dk_nrf5340_cpuapp.overlay

6153.prj.conf

Related