External Flash memory QSPI for data storage, retrieval to send over BLE

Hello DevZone, 

I am trying to integrate an external flash memory device W25M02GWZEIG chip with nRF52840 over QSPI. I had followed the sample code - SPI- Flash in the Zephyr- RTOS codebase for nrfConnect as follows,


https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/drivers/spi_flash/src/main.c . Attempted setting the overlay config with different pins owing to my system pin-mapping.

Therefore, I would like to obtain insight for setting the overlay for this particular chip(W25M02GWZEIG) using QSPI. 

Having looked into the code for erasing, reading and writing multi-sector data into the flash, I would like to retrieve and send data over BLE to an app(custom) for my application. I am trying to store data from an IMU onto the chip and send it later to an app when needed. 

Kindly help provide guidance in how I can use the QSPI setup for flash to store, retrieve and send packaged data over BLE to my application. Provide any suitable resources to help with this regard. 

Thank You. 

Parents
  • Hi

    Yes, this should be possible. You need to handle the data you receive over BLE and forward them to the SPI/QSPI peripheral. The spi_flash sample you have already found is useful for setting up an external flash device. Questions similar to this has also been asked multiple times on DevZone already, so I'd suggest checking out some of these cases where it is discussed already.

    Let me know if you have any specific questions you can't find the answer to here and I'll help you out.

    Best regards,

    Simon

Reply
  • Hi

    Yes, this should be possible. You need to handle the data you receive over BLE and forward them to the SPI/QSPI peripheral. The spi_flash sample you have already found is useful for setting up an external flash device. Questions similar to this has also been asked multiple times on DevZone already, so I'd suggest checking out some of these cases where it is discussed already.

    Let me know if you have any specific questions you can't find the answer to here and I'll help you out.

    Best regards,

    Simon

Children
  • Hello Simon,

    I have been attempting the following for the qspi device. I am using the sample in zephyr spi-flash for this integration. 

    After going through many threads online, i configured as follows:

    Calling the device via compat: nordic_qspi_nor
    disabled - &mx25r64
    Set pin configuration according to my hardware connections.

    When built and run, the code gives an error log. Please give any suggestions to help read device and use the sample correctly for my flash chip. Thanks

    error:


    My device tree overlay is set as follows, kindly let me know how to resolve this and start reading writing and flashing into the flash chip.

    Overlay for qspi: 

     

    Kindly give me some solution regarding this. Thanks much

Related