MCU Boot with sysbuild with SPI external flash

I am trying to get MCU Boot working with sysbuild using DFU with SPI external flash for FOTA over BLE with 2.9.1. I added the setting CONFIG_SPI_NOR_SFDP_DEVICETREE=y per the directions in the Dev Academy lesson on Exercise 3 – DFU with external flash but when I do that my build fails. I expect I need something in the devicetree. I have spi working with my external flash but I guess I need a partition for the secondary mcuboot sector.

I get an error:

error: static assertion failed: "jedec,spi-nor sfdp-bfp required for devicetree SFDP"
 1613 |         BUILD_ASSERT(DT_INST_NODE_HAS_PROP(idx, sfdp_bfp),     

But where is it described how to set this up in the device tree? I have this in my dts and the external flash is working:


&spi3  {
    status = "okay";
    compatible = "nordic,nrf-spim";
    pinctrl-0 = <&spi3_default>;
    pinctrl-1 = <&spi3_sleep>;
    pinctrl-names = "default", "sleep";
    cs-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
    w25q128: w25q128@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <8000000>;
		jedec-id = [ef 40 18]; // Could be 18 40 ef also. You will see in error printout if wrong ID is detected (ID missmatch)
		size = <DT_SIZE_M(16*8)>;
		wp-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
		reset-gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
		has-dpd;
		t-enter-dpd = <3000>;
		t-exit-dpd = <3000>;
	};
};

I have this in my this in my mcuboot.overlay:

&w25q128 {
	status = "okay";
};

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

  • Hi,

    Can you check out \zephyr\drivers\flash\Kconfig.nor and in specific:

    config SPI_NOR_SFDP_DEVICETREE
    	bool "Basic Flash Parameters from devicetree node"
    	help
    	  The JESD216 Basic Flash Parameters table must be provided in the
    	  sfdp-bfp property in devicetree.  The size and jedec-id properties are
    	  also required.

    If you don't provide sfdp-bfp in the devicetree you should add CONFIG_SPI_NOR_SFDP_DEVICETREE=n.

    Kenneth

Related