Skip to main content
HP_it
Senior II
July 20, 2025
Solved

eMMC init stalls during boot

  • July 20, 2025
  • 2 replies
  • 563 views

Hi all,

I have a strange issue that I can't wrap my head around.

I have an eMMC chip connected to a STM32U5G9

The .IOC file is all standard:

HP_1-1753010866216.png

 

with the clock config as follows:

HP_2-1753010894702.png

 

However, when I start a debugging session I get stuck in the init function like so:

HP_0-1753010772449.png

It looks almost like the sysTick is not being updated at this point so the whole init just stalls.

If I comment-out the MX_SDMMC1_MMC_Init() the whole system runs as intended (having a touchGFX application that boots right after the inits)

I am running FreeRTOS right now where I think the whole thing should move to ThreadX but the init function should still function as intended, right? For now I am fine with just verifying if the eMMC can initialize.

 

This is my first time setting up an eMMC so I might have overlooked something basic. Anyone out there with some good insights on this? 

Best answer by Saket_Om

Hello @HP_it 

You can add FreeRTOS to your test project and check again. The issue may be related to interrupt priorities.

2 replies

TDK
Super User
July 21, 2025

Look at the code where it's paused and why it's stuck there, in HAL_MMC_InitCard. The issue is probably not HAL_Delay directly but rather *why* it's waiting. The generated code probably expects an MMC card as opposed to an eMMC chip. There are subtle differences.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Technical Moderator
July 29, 2025

Hello @HP_it 

Is the MX_SDMMC1_MMC_Init() work fine without FreeRTOS ? 

Are you using the Systick timer as HAL time base?

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question.Saket_Om"
HP_it
HP_itAuthor
Senior II
August 4, 2025

Hello @Saket_Om 

Thanks for your reply - I am using TIM1 as the timebase.

I have created a separate project with just the eMMC and have been running tests on that.

I have removed TouchGFX and FreeRTOS and got the init function to work with first 1-bit MMC and later 8-bit wide MMC. adjusting the clock division to 12 helped.

However, the full system is still not working - Should I change to ThreadX for better support?

 

Saket_OmBest answer
Technical Moderator
August 4, 2025

Hello @HP_it 

You can add FreeRTOS to your test project and check again. The issue may be related to interrupt priorities.

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question.Saket_Om"