AnsweredAssumed Answered

STM32L4 DMA read write multiple blocks problem

Question asked by Yaroslav Kirillov on Aug 3, 2017
Latest reply on Mar 29, 2018 by Nikolay Brinken

I have a problem with DMA mode reading multiple blocks.

To simplify a problem i took an example from the STM32Cube_FW_L4_V1.8.0\Projects\STM32L476G_EVAL\Applications\FatFs\FatFs_uSD\ archive.

BSP_SD_ReadBlocks_DMA  is used.

Read blocks not worked good, it started to work after i separated rx and tx and added Init and Deinit to DMA  each time that i use that channel.

The problem is with a write now. I can write only blocks that are less then 1k. from 1k to 4096 sometimes it can write and sometimes

f_write return 0x01.

It always fails to write blocks bigger then 4096, bsp_write_blocks always fails with MSD_ERROR .

The problem only in DMA mode, polling mode works great.

 

 stm32l476  sd-card dma mode sdmmc dma stm32l4  

 

Outcomes