cancel
Showing results for 
Search instead for 
Did you mean: 

MDMA Config on STM32H7 with FatFS and FreeRTOS

ranciere
Associate III

I use a STMH743ZI Nucleo board with an SD card (SDMMC1 peripheral). The SDMMC peripheral and SD Card initialization are successful, as FatFS init too (FATFS_LinkDriver). The problem comes when the FatFS lib wants to mount the SD Card. After configuring everything (command, DMA etc. in HAL_SD_ReadBlocks_DMA function) I get a SDMMC_IT_RXOVERR error in the HAL_SD_IRQHandler function. As the STM32H743 Reference Manual stated: "An IDMA transfer error can occur: When reading or writing a reserved address space."

The AN5200 alse refers the neccessity of the MDMA configuring but there is no information about how.

The example codes for STM32H743 EVAL board don't contain any source code for this.

What is the correct solution? How can I configure this?

1 ACCEPTED SOLUTION

Accepted Solutions
ranciere
Associate III

It was a user error, I've passed the SDMMC1 peripheral address instead of the SD Handle of it in the IRQ routine.

View solution in original post

4 REPLIES 4
TDK
Guru

An RX overrun can happen if the code does not respond quickly enough to data coming in on the line, and the hardware buffer overflows. Consider disabling interrupts during SD transfers, or move to a DMA based solution.

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

Hi,

As I stated I use the DMA version ("in HAL_SD_ReadBlocks_DMA"). Both the IDMATE (IDMA transfer error) and the RXOVERR bits of the STAR register of SDMMC are set. The reference said for this case: "An IDMA transfer error can occur: When reading or writing a reserved address space.". What does it mean?

I've rechecked the code: the reading buffer in the D1 RAM (AXI RAM, address: 0x24007308). Also, I've turned off the DCache, but the result is the same.

ranciere
Associate III

It was a user error, I've passed the SDMMC1 peripheral address instead of the SD Handle of it in the IRQ routine.