cancel
Showing results for 
Search instead for 
Did you mean: 

Having Trouble with SD DMA on STM32L452 MCU

KKurt.1
Associate II

Hello. So like title says I am having trouble making SDMMC work with DMA in 4 bit mode. I tried with FreeRTOS and without FreeRTOS didnt get anyresult. But it works perfectly without DMA

It gives either Rx Overrun error or timeout error.

I tried it with different SD card, Different clock speeds, Different configuration no change.

I would really be grateful if someone can help me with this or have working example.

Thanks

Koksal KURT

1 REPLY 1
TDK
Guru

I don't have much to add to the discussion unfortunately. The HAL support of SD/MMC is just not great. For my own applications, I've had to make quite a few changes to get around the shortcomings in HAL. It would be great if ST spent some time to put some quality examples together for SDMMC, and put a bit more work into the code to make it work in all scenarios (1 bit, 4 bit, high speed, etc.) but that's just not where things are at. Without that, it's a long tedious process to inspect what is going wrong. Having a logic analyzer on the pins analyzing the SDMMC protocol can help quite a bit.

See if slowing down the clock speed by an order of magnitude solves the issue. If so, maybe the DMA is overtaxed, or there is some other code that is unable to keep up.

If you feel a post has answered your question, please click "Accept as Solution".