cancel
Showing results for 
Search instead for 
Did you mean: 

SDIO + DMA missing last four bytes

AWied.1
Associate II

Hello guys,

I hope you can help me. I'm using a STM32F439 board and the following setup:

In my application FreeRTOS with FatFS is running. For reading and writing blocks from my eMMC I use a DMA transfer. The problem occurs very seldom (in an 40 MB file it occurs maybe 5-6 times).

I read 512 byte blocks and store them in char buffer which is also 512 bytes big. Everytime after reading and working with the data I flush my buffer with zeros. I know that there is the problem with reading because if I flush my buffer with another value I will get the same problem. When the problem occurs the f_read method tells me that everything was okay and that 512 bytes were read but I see in my buffer that the last four bytes weren't filled with new values.

My SDIO Interrupt has a higher priority than my DMA. I am also waiting before every read operation until my MMC is in state ready again. I could also exclude that the specific blocks are not the problem because I had a counter and prooved that they are not the same blocks that fail in two runs.

Maybe someone of you has an idea where I could search for a bug.

Thanks in advance!

0 REPLIES 0