在STM32F407上如何执行W25Q16的快速读取双输出?

huangapple go评论105阅读模式
英文:

On STM32F407 How to Perform W25Q16 Fast Read Dual Output?

问题

我一直在尝试为W25Q16外部闪存编程,以进行快速读取双输出模式。在这种模式下,基本上MISO和MOSI两根线都变成了主机(在这种情况下是STM32)的输入,数据可以以双倍的速度读取。我的SPI运行在40MHz,使用DMA进行正常读取模式时,我得到了正确的带宽。我能够在大约4.150毫秒内读取20KB的数据。

现在,当我尝试发送执行快速读取双输出的指令,如用户手册的第30页所述时,

https://datasheet.lcsc.com/lcsc/1912111437_Winbond-Elec-W25Q128JVSIQ_C113767.pdf

**我没有获得所需的双数据速率,它的数据速率与以前相同,并且我还开始获得不正确的数据。**我已经在闪存的512字节空间中写入了一些预定义的值进行比较。当我进行正常读取时,如上所述,数据保持正确。然而,使用快速读取双输出时,数据会损坏。

我不明白的是,是否需要在进行快速读取双输出之前配置GPIO的特殊步骤?或者我是否遗漏了手册中未提及的任何具体内容。如果有人已经做过类似的事情,请指导我。我的SPI初始化值如下:

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 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 someone has 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.

答案1

得分: 0

我已经了解到,使用普通的SPI外设无法进行双重读取。只有通过QSPI外设才有可能。我已经通过不同的STM32微控制器代码生成器CubeMX进行了双重确认。

英文:

I have come to know that with a normal SPI peripheral it is not possible to do Dual Read. It is only possible via QSPI peripheral. I have double checked it via a different STM32 MCUs Code generator CubeMX.

huangapple
  • 本文由 发表于 2023年5月28日 23:53:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76352333.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定