External Flash W25Q64 with USBD_MSC example on NRF52840

Hi All,

        I have an external flash W25Q64 on which I have to mount a file system. I am using USBD_MSC example of NRF52840. My main goal is to create a file inside the flash memory chip. And when USB is plugged into the device it should be seen as a drive on laptop/desktop and I should be able to access the file which was created in the flash chip.I have made the connections on the NRF52840 using the pin configurations below:-


#define SDC_SCK_PIN     (25) 
#define SDC_MOSI_PIN   (23) 
#define SDC_MISO_PIN   (24) 
#define SDC_CS_PIN       (15) 

I have also configured the details in nrf_serial_flash_params.c file. 

When I run the example , i get the following error:-

<info> app: Initializing disk 0 (QSPI)...

 <error> app: Disk initialization failed.

1) Will this example run for W25Q64 IC??

2) This example also includes FATfs files. Will it automatically create a file system on the external SPI W25Q64 flash memory??

3) Why am I getting "Disk initialization failed." error?

4) Inside sdk_config.h do I also need to enable pin configurations for Qspi??

5) How to test this application? Currently I am using NRF52840 DK and then connecting external spi flash to it. But for USB detection how will it work?

I have attached few files here to check for the configurations

https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-07b22aa9f6fe492cbaf5dd082cf33f82/usb_5F00_msc.c

04162.sdk_config.h

5287.W25Q64BV.PDF

Please help me to solve this issue. I need to solve this issue on an urgent basis. Your help will be appreciated. I have also attached W25Q64 datasheet for your reference.

Thanks & Regards,

Snehal

Parents Reply
  • Thank you so much Sigurd. Yes it worked. Felt so happy after seeing the drive and the files Smiley

    Now my last doubt is will this same setup work with AT25DF041B flash chip?? I have attached its datasheet here

    at25df041-flash.pdf

    Thanks & Regards,

    Snehal

Children
  • sne_333 said:
    Now my last doubt is will this same setup work with AT25DF041B flash chip??

    This looks to be a SPI flash. The example in the SDK uses the block_dev library, and it has implemented support for QSPI and SD-card. So there might be some work required for you here to get this to run on SPI instead.

  • What work will be needed?? can you tell me??

    Thanks & Regards,

    Snehal.

  • sne_333 said:
    What work will be needed?? can you tell me??

    You need to port e.g. nrf_block_dev_qspi to use SPI instead of QSPI. i.e. a SPI interface for block_dev

  • Is there any example available for porting the code?? 

  • Just have to look at how e.g. sd-card or QSPI backend does it, and replicate that using the SPI driver instead.