[STM32H7] How to use SDMMC with MDMA
Hello Community,
I'm working on a storage module using SDcard for my project. In my application I would like to read and write to the SDcard using the MDMA as indicated in the reference manual of my micro-controller. For now I have the SDcard working in 4-bit mode but using the CPU.
I use the STM32H757II on a PCB connected to a SDcard reader on the same PCB.
With CubeMX I generated the code that allow me to mount a FATFS on my microcontroller and I can create/open/write/read on file with no problem.
But my application needs to log a lot of data to the sdcard periodically, to free-up the CPU I would like to do the transfer using a DMA.
In the reference manual 58.5.7 MDMA request generation it is explained that the MDMA can control the SDMMC peripheral to start new transfer
"The internal trigger lines from the SDMMC allow passing direct request to MDMA controller
to enable successive transfers from/to different internal RAM addresses without CPU use. [...]
The event can trigger the clearance of the DATAEND and CMDREND
flags and, eventually, a new transfer start, through MDMA direct access to the SDMMC
control and configuration registers, thus without CPU intervention."
However in CubeMX I don't seem to be able to link the SDMMC to the MDMA. I don't know either how to link an event of the SDMMC to trigger a change in configuration of those register with the MDMA.
How can I adapt what I have to use DMA instead of CPU.
How do you start a MDMA transfer to write on SDcard ?
Cheers,
Maurin
PS:
STM32CubeIDE Version: 1.3.0
STM32CubeMX Version: 5.6.0-RC6

