NCS DFU Supported External Flash Devices

OS: Windows

NCS: 2.2.0

We have discovered that we do not have enough internal flash space to support BLE DFU and need to add an external flash to our nRF52833-based design.

The nRF52840 DK board has an external flash (MX25R64) and BLE DFU is shown to work with the bus configured as SPI or QSPI.

 https://devzone.nordicsemi.com/f/nordic-q-a/82430/ncs-external-flash-ota-change-qspi-to-spi/345238

Our board is very small, so the MX25R64 is simply too physically large, so we are looking at the Gigadevices GD25WD40E/20E.  It is tiny at 1.2x1.2mm and supports SPI bus.

https://www.mouser.com/datasheet/2/870/gd25wd40e_gd25wd20e_datasheet_rev1_1_20221019-3081635.pdf

We have no way of verifying this device without doing another version of the board.  That is a big risk.

1.  Is there a specific memory layout of the flash for NCS DFU to work?  For example, the Gigadevices part's memory layout looks like:

2. Is there a specific list of SPI/QSPI flash devices that work with NCS DFU?

Parents Reply Children
  • Thanks for the feedback.  I think spinning a breakout board and testing with the nRF52833 DK is the best way to go, too.  

  • I finally am getting back to this ticket.  Here is what I have done.

    1.  The "hello world" DFU over BLE using internal flash is working on the nRF52833 DK.

    2. I then ported the project to the nRF52840 DK to use it's external QSPI flash.  This is also working.

    3. Now I am trying to add an external SPI flash device on a breakout board to the nRF52833 DK to prove it will work.  The SPI NOR flash I am using is the ISSI IS25LP080D.
    www.issi.com/.../25LP-WP080D-040D-020D.pdf

    From item #2 above I modified...

    Both of these overlay files update the SPI bus (identical content in both files)

    • /boards/nrf52833dk_nrf52833.overlay
    • /child_image/mcuboot/boards/nrf52833dk_nrf52833.overlay

    Both of the these conf files have these lines added to switch from QSPI to SPI

    • prj.conf
    • /child_image/mcuboot/boards/nrf52833dk_nrf52833.conf
    # Additions for DFU external flash
    CONFIG_FLASH=y
    CONFIG_SPI=y
    CONFIG_SPI_NOR=y
     

    I am seeing two things that are odd.  CONFIG_SPI_NOR in both .conf files has the red/orange squiggly lines under it.  When I highlight it says:

    CONFIG_SPI_NOR was assigned the value y, but got the value n. Missing dependencies:
    DT_HAS_JEDEC_SPI_NOR_ENABLED
     https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html  and searching for "CONFIG_SPI_NOR" shows does have DT_HAS_JEDEC_SPI_NOR_ENABLED as a dependency.

    However in my build directory both of the .config files shows CONFIG_DT_HAS_JEDEC_SPI_NOR_ENABLED=y 
    • build_nrf52833dk_nrf52833/mcuboot/zephyr/.config
    • build_nrf52833dk_nrf52833/zephyr/.config

    I suspect this is the root cause of the build error I am getting, but the message doesn't give any real detail.
    c:/users/bryan/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: zephyr/drivers/spi/libdrivers__spi.a(spi_nrfx_spi.c.obj): in function `k_sem_give':
    C:\Virtuix\nordic\myapps\hello_world_dfu\build_nrf52833dk_nrf52833\mcuboot\zephyr\include\generated\syscalls\kernel.h:1071: undefined reference to `z_impl_k_sem_give'

    I have attached my hello_world_dfu project for reference.  The build output log is saved in the root directory (build_output.txt).  I appreciate any help!

    hello_world_dfu.zip
  • I did not have time to look into this today, and I am out of office tomorrow. The undefined reference to `z_impl_k_sem_give' error seems to be related to MULTITHREADING is not enabled? Maybe try to delete your build folder and build again.

    Kenneth

  • Kenneth,

    You are a genius!  I started digging when you focused me on MULTITHREADING and I found this reference online in a prj.conf file.  This resolved the error.

    # If you don't add this when setting CONFIG_SPI=y, you'll get a lot of undefined references 
    # from the nrfx spim driver E.G. "undefined reference to `z_impl_k_sleep'"
    CONFIG_MULTITHREADING=y

  • I have wired up the SPI NOR flash and added the sfdp-bfp into both overlay files

    * boards\nrf52833dk_nrf52833.overlay

    * child_image\mcuboot\boards\nrf52833dk_nrf52833.overlay

    However, I am still seeing issues around the conf settings in prj.conf and child_image\mcuboot\boards\nrf52833dk_nrf52833.conf

    CONFIG_FLASH=y
    CONFIG_SPI=y
    CONFIG_SPI_NOR=y

    warning: SPI_NOR (defined at drivers/flash/Kconfig.nor:4) was assigned the value 'y' but got the
    value 'n'. Check these unsatisfied dependencies: DT_HAS_JEDEC_SPI_NOR_ENABLED (=n). See
    docs.zephyrproject.org/.../kconfig.html and/or look up SPI_NOR in the
    menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values,
    and Kconfig - Tips and Best Practices sections of the manual might be helpful too.

    It still builds, but when it boots...

    *** Booting Zephyr OS build v3.2.99-ncs1 ***
    I: Starting bootloader
    W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=256 - too small?
    W: Cannot upgrade: not a compatible amount of sectors
    E: Unable to determine flash sector of the image trailer
    E: Image in the primary slot is not valid!
    E: Unable to find bootable image

Related