NRF52840dk with MX25L256

Hi,

We're trying to use the LittleFS sample on NCS 2.9.0 with the NRF52840DK with the flash chip changed to an MX25L256.

We defined an overlay file as nrf52840dk_nrf52840.overlay:

/*
 * Copyright (c) 2019 Peter Bigot Consulting, LLC
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/delete-node/ &storage_partition;

/ {
    chosen {
        nordic,pm-ext-flash = &mx25l25;
    };
};
&qspi
{    
    mx25l25: mx25l25645g@0
    {
        compatible = "nordic,qspi-nor";
        reg = < 0x0 >;
        writeoc = "pp4io";
        readoc = "read4io";
        sck-frequency = < 0x7a1200 >;
        jedec-id = [ C2 20 19 ];
        sfdp-bfp = [ e5 20 fb ff ff ff ff 0f 44 eb 08 6b 08 3b 04 bb fe ff ff ff ff ff 00 ff ff ff 44 eb 0c 20 0f 52 10 d8 00 ff d6 59 dd 00 82 9f 03 db 44 03 67 38 30 b0 30 b0 f7 bd d5 5c 4a 9e 29 ff f0 50 f9 85 ];
        size = < 0x10000000 >;
        has-dpd;
        t-enter-dpd = < 0x2710 >;
        t-exit-dpd = < 0x88b8 >;
        enter-4byte-addr = <0x87>;
		address-size-32;
    };
};

/ {
	fstab {
		compatible = "zephyr,fstab";
		lfs1: lfs1 {
			compatible = "zephyr,fstab,littlefs";
			mount-point = "/lfs1";
			partition = <&lfs1_part>;
			automount;
			read-size = <16>;
			prog-size = <16>;
			cache-size = <64>;
			lookahead-size = <32>;
			block-cycles = <512>;
		};
	};
};

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

		lfs1_part: partition@0 {
			label = "storage";
			reg = <0x00000000 0x00800000>;
		};
	};
};

we also added an nrf52840dk_nrf52840.conf:

# Need this when storage is on flash
CONFIG_MPU_ALLOW_FLASH_WRITE=y

# Need this when storage is on MX25R64
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096

However, compilation fails with:

(folder)/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/libzephyr.a(flash_map_partition_manager.c.obj):(.rodata.default_flash_map+0x2c): undefined reference to `__device_dts_ord_25'
collect2: error: ld returned 1 exit status

If we use the overlay file without redefining the &qspi node it works fine with the MX25R64 chip, but not the MX25L256. How can we get this to work?

Related