cancel
Showing results for 
Search instead for 
Did you mean: 

USB Mass Storage + SPI Flash W25Q16

SJais.1
Associate

Hello,

I have a board with STM32F407VET microcontroller, W25Q16 and microSD connector.

Writing and reading information from W25Q16 without USB works (using library https://github.com/nimaltd/w25qxx).

SD card via USB works.

Can you advise what I am doing wrong in this project? 

3 REPLIES 3
Neolithic
Associate III

Hi,

I have been trying to program W25Q16 external flash for Fast Read Dual Out mode. In this mode, basically both the lines MISO and MOSI become input for the host (STM32 in this case) and data can be read at double the speed. My SPI is running at 40MHz and in Normal read mode with DMA I am getting the correct bandwidth. I am able to read out 20KB in roughly 4.150 milliseconds.

Now, when i try to send the instruction to perform Fast Read Dual Output as mentioned in page 30 of this user manual https://datasheet.lcsc.com/lcsc/1912111437_Winbond-Elec-W25Q128JVSIQ_C113767.pdf

I don't get the required dual data rate, Its the same data rate, and I also start getting incorrect Data. I have written some predefined values to 512Byte space in flash for the comparison. When I do a normal read, as mentioned above, the data stays correct. However, with Fast Read Dual Out, the data gets corrupted.

What i am not able to understand is that, does it require special steps to configure GPIOs before we do fast read dual output? Or am i missing anything specific which is not mentioned in the manual. If you have already done something similar, kindly guide me. My SPI initialization values are:

inSPIHandle->Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;

inSPIHandle->Init.CLKPhase = SPI_PHASE_1EDGE;

inSPIHandle->Init.CLKPolarity = SPI_POLARITY_LOW;

inSPIHandle->Init.CRCPolynomial = SPI_CRCPR_CRCPOLY;

inSPIHandle->Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED;

inSPIHandle->Init.DataSize = SPI_DATASIZE_8BIT;

inSPIHandle->Init.Direction = SPI_DIRECTION_2LINES;

inSPIHandle->Init.FirstBit = SPI_FIRSTBIT_MSB;

inSPIHandle->Init.Mode = SPI_MODE_MASTER;

inSPIHandle->Init.NSS = SPI_NSS_SOFT;

inSPIHandle->Init.TIMode = SPI_TIMODE_DISABLE;

I will be looking forward to your reply.

Let's keep this in its own thread, not zombie threads https://community.st.com/s/question/0D53W00002HW5CtSAL/how-to-perform-w25q16-fast-read-dual-output-

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Neolithic
Associate III

I have asked in multiple places in the hope that people who have experience with this flash, might have already done it.