Adafruit Feather nRF52840 Sense Not Booting with SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y, Works with Simple DFU

I am using the Adafruit Feather nRF52840 Sense with a W25Q32 external flash and MCUBoot. I can successfully read and write to external flash using NVS, and simple DFU works fine.

Issues:

  1. When I enable SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y, the device does not start.

  2. If I first flash a DFU-compatible build (without SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y), the device boots correctly.

  3. When I update via DFU to a new build with SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y, the DFU process completes successfully, but after reboot, the device does not boot.

Observations:

  • External flash (W25Q32) works fine with NVS.

  • Simple DFU works correctly if the build does not have SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y.

  • MCUBoot does not boot when SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y is enabled, whether flashed directly or updated via DFU.

Questions:

  1. Why does the device fail to start when SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y is enabled?

  2. Are there additional configurations needed for MCUBoot to work with W25Q32 external flash?

  3. Why does the device not boot after a successful DFU update using a build with SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y?

  4. How can I debug this? Are there specific MCUBoot logs, settings, or hardware checks I should look into?

  5. Is there a known issue with SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y on the Adafruit Feather nRF52840 Sense?

Any help or insights would be greatly appreciated!

  •  &flash0 {
     
    	 partitions {
    		 compatible = "fixed-partitions";
    		 #address-cells = <1>;
    		 #size-cells = <1>;
     
    		 boot_partition: partition@0 {
    			 label = "mcuboot";
    			 reg = <0x00000000 0x0000C000>;
    		 };
    		 slot0_partition: partition@c000 {
    			 label = "image-0";
    			 reg = <0x0000C000 0x00076000>;
    		 };
    		 slot1_partition: partition@82000 {
    			 label = "image-1";
    			 reg = <0x00082000 0x00076000>;
    		 };
    
             
    		 /*
    		  * The flash starting at 0x000f8000 and ending at
    		  * 0x000fffff is reserved for use by the application.
    		  */
     
    		 /*
    		  * Storage partition will be used by FCB/LittleFS/NVS
    		  * if enabled.
    		  */
    		 storage_partition: partition@f8000 {
    			 label = "storage";
    			 reg = <0x000f8000 0x00008000>;
    		 };
    	 };
     };
    This is my flash0 partition  in nrf21540dk/nrf21540dk_nrf52840.dts file.
  • Hello Dalvadi,

    I went over the things discussed here and was quite confused where things are.

    First of all, you mentioned using a Adafruit Feather nRF52840 Sense. Why are there builds targeting the nrf21540dk/nrf52840 target?
    I can understand using nrf52840dk/nrf52840 target and overlay it to be compatible with the Adafruit board, but the nRF21540 DK is a lot more different. In particular, it uses the nRF21540 FEM. I am a little surprised there are no runtime issues.

    Secondly, the information about the external flash isn't included in mcuboot.overlay at all. You need to add the same kind of spi1 node overlay you did for the main board in mcuboot.overlay.

    Hieu

Related