AnsweredAssumed Answered

Reading from Quadspi using eDMA returns wrong data

Question asked by Katarzyna Baranowska on Aug 27, 2014
Latest reply on Sep 3, 2014 by Timesys Support

I am trying to add eDMA support to my Quadspi using code on VybridVF3xx. I have a problem when receiving from flash more data than I want to copy with eDMA. I got wrong data.


For example I am receiving 21 bytes of data. And eDMA is receiving only 16 (Minor loop is 8 bytes, quadspi WMRK is 1).

The first receive operation is ok. When DMA finifhes Quadspi.RBSR is 0x40200, so 4 bytes from RX buffer are taken by the DMA. The rest (2 bytes) I take from the RX buffer by cpu. The received data is ok.


Then I set CLR_RXF bit in quadspi.MCR register and to be sure clean all the flags by writing 0XFFFFFFFF to quadspi.FR.


Then I repeat the receive function (sending new read command to flash). When DMA finishes Quadspi.RBSR is 0x20400 so only 2 bytes are taken from buffer (it should take 4). Moreover the data received by eDMA is {1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8} when I


expect to get {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}.
DMA settings in both DMA uses are the same:

{SADDR = 0x7c000000, SOFF = 0x4, ATTR = 0x1a02, NBYTES_MLNO = 0x8, SLAST = 0x0, DADDR = 0x3f071b00, DOFF = 0x4, {CITER_ELINKNO = 0x2, CITER_ELINKYES = 0x2}, DLAST_SGA = 0x0, CSR = 0x88, {BITER_ELINKNO = 0x2, BITER_ELINKYES = 0x2}}


What am I doing wrong?