Hello NXP,
I am trying to read Device id and for W25Q32 flash memory using S32k312 EV Board SPI in all mode Sync and Async INT ,Poll , but not getting data on SIN pin.
Do you have any W25Q32 lib support for SPI.?
What would be SPI sequence for for below CASE for reading external flash?
1 - Send ID read command to the external flash
2 - Read 3 bytes back from the external flash
Hi @aryandis
We do not provide a library for the W25Q32 flash memory specifically, but you can find some examples in other websites (ex: LibDriver W25QXX).
Are you using an example for the SPI code? You can use this one, for example: Example S32K312 SPI Transmit & Receive Using Interrupt DS3.5 RTD300 - NXP Community.
Best regards,
Julián
Yes i have used exampled you mentioned in thread. And to ensure Flash memory i also used Arduino board, getting data correctly in Arduino board.
Can you please attached any reference for configuring S32 IDE in Sync and Async SPI mode.?
Hi @aryandis,
You can refer to S32K3 SPI examples from the RTD package. Keep in mind that the RTD package only release examples for the 344 & 358 derivatives, so you will need to port the example, or use the already existing one I've previously shared.
Lpspi_Ip_DmaRepeatedTransfer demonstrates how to configure the DMA + SPI, and uses Lpspi_Ip_AsyncTransmit, and Lpspi_Ip_HalfDuplexTransfer uses both Sync and Async methods for transfer.
Also, I can see in external websites that the W25QXX memory may need some dummy cycles. Please refer to some posts like: Solved: QSPI - Read UNIQUE ID from W25Qxx NOR memory - STMicroelectronics Community.
It would also be helpful to see the data transmission through an oscilloscope or logic analyzer.
Best regards,
Julián.
Here i ma trying to read JEDEC ID of external flash in half duplex mode bit always getting 0.
Can you please check why , even i have checked with altered the API being called in image for TransfersSync (Tx first, Rx second).
Hi @aryandis
Sorry for the late reply, and the blurry image, I've replaced it.
How are you sending the commands to the W25 memory? I think the easiest way to debug this, is to read the Arduino's output, and compare it with the S32K312's output through a logic analyzer, or oscilloscope.
I can see from the git repository I've previously shared, all of the command definition is written in the w25qxx.c file. In this case, since this is a third-party device, you will need to implement these commands through the SPI functions.
Please share your project configuration, so I can test the SPI communication. Just keep in mind that I am not able to test the memory's init and read/write commands; I will simply analyze the SPI's frame through a logic analyzer.
Now i am able to read/write in SPI full duplex mode. but issue is here
Spi_SetupEB and SyncTransmit" which i am using to write and read data.
In this function a parameter length is assigned to both Tx/Rx buffer.
What should i do if I am writing command 1 byte of data and expecting more than 1 byte to receive?. Basically Command Read /Write for external flash.
I am expecting like byte by byte transfer operation like below mentioned.
Ex.
Hi @aryandis
You could prepare a Tx buffer with the command byte (0x4B) and dummy bytes (e.g., 4 dummy bytes), prepare the Rx buffer of the same length, and extract the received data from the Rx buffer by skipping the first few bytes.
Best regards,
Julián
Attached PNG is completely blur can you please attached new one.
Thanks
For SPI mode 0 , is this config is ok?