STM32H745 SDMMC DMA Rx Overrun/Tx Underrun
Hi,
I am working on STM32H745 discovery board and trying to configure the onboard 4GB eMMC flash over SDHC1 interface. I am loading default discovery board configuration by the CubeMx configuration, which sets both M7 and M4 and all AHB buses to run at 64MHz (STM32H7 CubeMx Repository v1.8.0).
I am configuring the SDMMC peripheral clock to 200MHz and setting clockdiv to 4, this will provide 25MHz clock to the eMMC. My application is running on M7. I want to utilize the IDMA for read/write and using HAL_MMC_ReadBlocks_DMA and HAL_MMC_WriteBlocks_DMA APIs. By using this configuration, the DMA interrupts are resulting in Rx Overrun and Tx Underrun errors.
I ran the MMC/DMA example for the discovery board which sets eMMC clock to 50MHz, M7 at 400MHz, M4 at 200MHz. The HCLK for D1 Domain AXI and AHB3 peripherals , D2 Domain AHB1/AHB2 peripherals and D3 Domain AHB4 peripherals at 200MHz.
The APB clock dividers for D1 Domain APB3 peripherals, D2 Domain APB1 and APB2 peripherals and D3 Domain APB4 peripherals to run at 100MHz. This example seems to be buggy and does not read correct number of blocks from eMMC.
But with the same example if I change the clockdiv to give 25MHz clock to eMMC, the DMA operations are working fine and the example runs as expected.
With this observations, I need help answering few of questions.
- What is the reason for the MMC/DMA example of STM32H745 Discovery board does not run with 50MHz eMMC clock but runs fine when it is changed to 25MHz?
- What could be the reason for the overrun/underrun issues with my project?
- Is there a connection between CPU and AHB bus speeds with IDMA and eMMC clock speed?
- Is there a straight forward documentation available which simplifies the clock related mysteries?
Thanks,
Joyab
