Configuring QSPI Flash (W25Q512) on NRF52840 Dongle for USB Mass Storage in Zephyr v2.6.1

Hello,

I am currently working with the NRF52840 Dongle and have integrated a W25Q512 QSPI Flash chip, connected to the following pins:

  • CSN: P0.17
  • SCK: P0.20
  • IO0: P0.24
  • IO1: P0.22
  • IO2: P0.15
  • IO3: P0.13

SDK: Zephyr v2.6.1

I am using the "USB Mass Storage" example from Zephyr SDK and would like to configure the QSPI Flash (W25Q512) as the storage partition. However, I am struggling to find detailed information on how to update the necessary overlay and prj.conf files to achieve this setup.

Could you please provide guidance or an example on how to properly configure these files for this use case?

Thank you for your support.

Best regards,
Bivay

Parents Reply
  • Hi Brevy,

    Apologies for the delayed response. Please try the following:

    overlay:

    &qspi {
    status = "okay";
    sck-pin = <20>; // SCK is P0.20
    csn-pin = <17>; // CSN is P0.17
    io-pins = <24>, <22>, <15>, <13>;

    mx25r64: mx25r64@0 {
    compatible = "jedec,spi-nor";
    reg = <0>;
    label = "W25Q512";
    spi-max-frequency = <8000000>;
    size = <0x4000000>;
    partition@0 {
    label = "storage";
    reg = <0x00000000 0x4000000>;
    };
    };
    };

    prj.conf:

    # Enable QSPI driver
    CONFIG_NRFX_QSPI=y
    CONFIG_SPI=y
    CONFIG_FLASH=y
    CONFIG_FLASH_MAP=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_JESD216=y

    # Enable file system support
    CONFIG_FILE_SYSTEM=y
    CONFIG_FAT_FILESYSTEM_ELM=y

    # Enable partitions
    CONFIG_FLASH_PARTITION=y
    CONFIG_STORAGE_PARTITION=y

    USB storage related configs are already in the prj.conf of the sample I guess. 

    -Priyanka

Children
Related