cancel
Showing results for 
Search instead for 
Did you mean: 

SDCARD +DMA Writing issue

APate.8
Associate II

Hi

I have setup SDMMC1 over DMA2 channel 14 (Tx) and having issue in writing more frequent data. I have interrupt on system tick (pend sv) 1ms. When I write every 10ms 128 Bytes, it gives me ring buffer overflow error. That means it stuck somewhere on f_write and not returning from there.

I have found that it gives timeout on

HAL_DMA_PollForTransfer(&SDMA__stDMA_Copy_handle, HAL_DMA_FULL_TRANSFER, 1000) function after starting DMA transfer.

Is it related to FATFS or DMA ?

Is there any workaround to write more frequent large data with current configuration.

I have set DMA interrupt priority as 6 and SDMMC1 as 5.

Any help would be appreciated.

1 REPLY 1
Sirac
Associate III

Hello, sometimes sdcard needs a lot of time for writing. Try to increase the time beetween writing (like 500ms) for testing. Also, you can try increasing your buffer size.