cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, In a custom board I've the STM32F722 connected to a 8GB eMMC with a 24Mhz clock. I'm having issue reading (sigle or multiple block ) with the DMA using the HAL_MMC_ReadBlocks_DMA function.

roberto Monti
Associate II

STM32F722

STM32CubeF7 Firmware Package V1.11.0 / 23-February-2018.

Hi,

In a custom board I've the STM32F722 connected to a 8GB eMMC with a 24Mhz clock.

I'm having issue reading (sigle or multiple block ) with the DMA using the HAL_MMC_ReadBlocks_DMA function.

If I continue to read, no problem occurs but if I stop to access the card in read or write mode, after about 3 minutes the HAL_MMC_ERROR_DATA_TIMEOUT interrupt is called.

The FIFOCNT stay to 128, not cleared.

The timeout is the SDMMC_DATATIMEOUT because changing it the interrupt time change whit it.

I've to clean something in the HAL_MMC_RxCpltCallback?

Thanks Roberto.

1 ACCEPTED SOLUTION

Accepted Solutions

For an unexpected DTIMEOUT interrupt: in the HAL's MMC_DMAReceiveCplt() write a 0x0 to DCTRL instead of just clearing the DMAEN bit. Even though DTEN is supposed to auto-clear at the end of the transfer (stopping the Data Timeout timer) it appears that the SDMMC sometimes doesn't actually stop the timer.

View solution in original post

5 REPLIES 5

I have my own eMMC code base tested out to 128GB (full write, full read).

Is this a 4 or 8-bit implementation?

Does your design contain pull-up and series resistors?

Have you tried backing off the pin slew rate?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Is a 4 bit implementation with 10k pull up on data and clock and 22 ohm series only on clock and cmd.

Does your design contain pull-up and series resistors?

No, not now.

But the data are read correctly it seems like a not clean exit.

Do you use the HAL_MMC_ReadBlocks_DMA ?

If I continue to read data the timeout does not expire.

thanks

My approach has been to unify eMMC support into the SD fork, so HAL_SD_ReadBlocks_DMA in my case. This also allows testing on many existing platforms using the ODROID eMMC modules, and microSD adapter.

In my opinion ST forking the SD and MMC code into two trees basically doubles the work, and increases the potential for failure.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

For an unexpected DTIMEOUT interrupt: in the HAL's MMC_DMAReceiveCplt() write a 0x0 to DCTRL instead of just clearing the DMAEN bit. Even though DTEN is supposed to auto-clear at the end of the transfer (stopping the Data Timeout timer) it appears that the SDMMC sometimes doesn't actually stop the timer.

Thank you very much!

Clear DCTRL in MMC_DMAReceiveCplt worked for me!