Skip to main content
Visitor II
July 5, 2021
Solved

MDMA Config on STM32H7 with FatFS and FreeRTOS

  • July 5, 2021
  • 2 replies
  • 2180 views

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?

    This topic has been closed for replies.
    Best answer by ranciere

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

    2 replies

    Super User
    July 6, 2021

    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.

    ranciereAuthor
    Visitor II
    July 6, 2021

    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?

    ranciereAuthorAnswer
    Visitor II
    July 7, 2021

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