2025-07-20 4:34 AM
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:
with the clock config as follows:
However, when I start a debugging session I get stuck in the init function like so:
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?
Solved! Go to Solution.
2025-08-04 4:02 AM
Hello @HP
You can add FreeRTOS to your test project and check again. The issue may be related to interrupt priorities.
2025-07-21 6:09 AM - edited 2025-07-21 6:10 AM
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.
2025-07-29 4:09 AM
Hello @HP
Is the MX_SDMMC1_MMC_Init() work fine without FreeRTOS ?
Are you using the Systick timer as HAL time base?
2025-08-04 3:51 AM
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?
2025-08-04 4:02 AM
Hello @HP
You can add FreeRTOS to your test project and check again. The issue may be related to interrupt priorities.
2025-08-04 4:17 AM
Hello @Saket_Om
I've added the FreeRTOS wit just a simple blink statement. That works just fine. Any suggestions to the interrupt priorities I should try out?
This is the working project:
2025-08-04 4:31 AM
Hellow @Saket_Om
Thank you for the suggestion!
I changed the priority of the TIM1 to 0 and now the MMC initializes, the RTOS is running and TouchGFX is showing images :)
Thanks!