How to Interface W25Q32 External Flash with nRF21540DK/nRF52840 in nRF Connect SDK 2.9.0?

I am using nRF Connect SDK 2.9.0 with Toolchain 2.9.0 and trying to interface Winbond W25Q32 SPI flash memory with nRF21540DK (nRF52840). I need help with the following:

  1. Device Tree Overlay – Proper setup for enabling W25Q32 in Zephyr.
  2. Driver Support – Recommended drivers, APIs, or sample projects for working with SPI flash.

If anyone has successfully integrated external SPI flash with nRF52840 in nRF Connect SDK 2.9.0, please share your insights or example configurations.

Thanks in advance!

  • I assume you are connecting some external flash chip to the nrf21540DK since it didn't include a flash chip. The v2.9.0\zephyr\samples\drivers\spi_flash example might be a good starting point. Though it specifically targets the nrf52840DK. The only issue for you would be that the nrf52840 will be using a quad spi part. 

  • Also, the core .dtsi file that is included into the nrf52840 device tree is stored here \zephyr\dts\arm\nordic\nrf52840.dtsi .
    This shows the base of spi1 which I think you will need to connect to for flash.

    For an example of how to add the flash to the device tree (but to a different spi since it's a different board, sorry I couldn't find one specific to the nrf21540/nrf52840)  zephyr\boards\sparkfun\thing_plus\sparkfun_thing_plus_nrf9160_common.dtsi . This shows a w25q32 attached to a spi3. You need to create an overlay for the nrf21540 and copy this into spi1. 

    I haven't had to use an external flash, but this looks like some pieces to start from.

    I am assuming you understand the device tree layout system. 

    Also, IF you haven't run through them, I suggest you go through the Nordic courses on how to use their tools. 

Related