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!

Parents
  • Hello,

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

    Have you mapped the external flash in the partition manager file? You also need to initialize the external flash controller and include the correct driver for the external flash in the mcuboot.config file.

    The issue is likely because your application knows that the secondary slot is in external flash, but MCUBoot doesn’t ,so it fails when trying to access it.

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

    Take a look at this sample from developer academy course. Check the mcuboot.config and mcuboot.overlay files inside the sysbuild folder.

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

    It's probably because your MCUBoot image wasn't built with external flash support.

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

    Try enabling MCUBoot logs and review the boot logs during startup. You can follow the steps mentioned here to enable MCUBoot logging.

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

    I don’t think there’s any known issue, but I’m not 100% sure. Did a quick search online and didn’t find anything. I haven’t used or tested this board myself.

    Kind Regards,

    Abhijith

  • Hi Abhijith
     

    I have attached all the configuration files and the project below. I have made all the necessary changes, but I am still facing this issue. Here is the error:

    *** Booting MCUboot v2.1.0-dev-12e5ee106034 ***
    *** Using nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    I: Starting bootloader
    E: Failed to open flash area ID 2 (image 0 slot 1): -19, cannot continue
    0763.mcuboot.overlay

    4073.mcuboot.conf

    0272.prj.conf

    1667.sysbuild.conf

    8015.nrf21540dk_nrf52840.overlay

    8524.peripheral_lbs.zip

Reply Children
No Data
Related