2026-03-13 4:53 AM
I am trying to use the microSD card on the STM32H753I-EVAL2 board with ThreadX and FileX.
I generated the base project using CubeMX with the following configuration:
Board: STM32H753I-EVAL2
Peripheral: SDMMC1 enabled
Middleware: ThreadX + FileX
Option "Is external transceiver present?" = Yes (since the board uses the IP4856CX35)
Default CubeMX clock configuration
However, the generated code fails during initialization at:
HAL_SD_Init(&hsd1);
inside:
MX_SDMMC1_SD_Init()
After debugging further, I found the failure occurs inside SD_PowerON() when sending CMD55 (APP_CMD).
The error returned is:
HAL_SD_ERROR_CMD_RSP_TIMEOUT
From stepping through the code:
SD_PowerON()
-> SDMMC_CmdAppCommand()
-> CMD55
-> HAL_SD_ERROR_CMD_RSP_TIMEOUT
So the card never responds to CMD55.
Additional observations: CubeMX configures the SDMMC1 kernel clock to 150 MHz. From the reference manual / datasheet, it seems the maximum SDMMC kernel clock should be around 125 MHz.I am not sure if this clock configuration could be related to the issue.
But the initialization still fails at CMD55.
Questions:Is a 150 MHz SDMMC kernel clock supported on STM32H753?Is there any additional initialization required for the external SD transceiver (IP4856CX35) on this board?Is there a known issue with CubeMX generated SDMMC code for STM32H753I-EVAL2?
2026-03-14 12:56 AM - edited 2026-03-14 2:09 AM
Set the clock for SD-card to 50MHz .
As this is max frequency for SD-card.
And set 1bit mode at first, as 4bit mode more difficult.
2026-03-16 2:17 AM - last edited on 2026-03-16 5:04 AM by Andrew Neil
static void MX_SDMMC1_SD_Init(void)
{
/* USER CODE BEGIN SDMMC1_Init 0 */
/* USER CODE END SDMMC1_Init 0 */
/* USER CODE BEGIN SDMMC1_Init 1 */
/* USER CODE END SDMMC1_Init 1 */
hsd1.Instance = SDMMC1;
hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING;
hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE;
hsd1.Init.BusWide = SDMMC_BUS_WIDE_1B;
hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
hsd1.Init.ClockDiv = 0;
hsd1.Init.TranceiverPresent = SDMMC_TRANSCEIVER_PRESENT;
if (HAL_SD_Init(&hsd1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN SDMMC1_Init 2 */
/* USER CODE END SDMMC1_Init 2 */
}
tried with the above configuration . Still no luck.
Still fails
HAL_SD_Init ->
HAL_SD_InitCard ->
SD_PowerON
while ((count < SDMMC_MAX_VOLT_TRIAL) && (validvoltage == 0U))
{
/* SEND CMD55 APP_CMD with RCA as 0 */
errorstate = SDMMC_CmdAppCommand(hsd->Instance, 0);
if (errorstate != HAL_SD_ERROR_NONE)
{
return errorstate; //fails here with SDMMC_ERROR_CMD_RSP_TIMEOUT
}
Edited to apply source code formatting - please see How to insert source code for future reference.
2026-03-16 4:23 AM - edited 2026-03-16 4:38 AM
Well, i dont know, what you doing there....
my access to sd-card is just this :
1. the cube generated code ... (static void MX_SDMMC2_SD_Init(void); ) as it is.
2. in filex -> I mount card
void fx_app_thread_entry(ULONG thread_input)
{
UINT sd_status = FX_SUCCESS;
/* USER CODE BEGIN fx_app_thread_entry 0*/
sd_statusx = -1;
tx_thread_sleep(500); // wait 500ms for sdcard startup
/* USER CODE END fx_app_thread_entry 0*/
/* Open the SD disk driver */
sd_status = fx_media_open(&sdio_disk, FX_SD_VOLUME_NAME, fx_stm32_sd_driver, (VOID *)FX_NULL, (VOID *) fx_sd_media_memory, sizeof(fx_sd_media_memory));
/* Check the media open sd_status */
if (sd_status != FX_SUCCESS)
{
/* USER CODE BEGIN SD DRIVER get info error */
printf(" SD mount error ! \r\n");
Error_Handler();
/* USER CODE END SD DRIVER get info error */
}btw
Wait 0.5 s after start/power_up is important, most cards not responding without some start delay time.
2026-03-17 2:11 AM
Hello @pranavps
Please refer to the examples below:
STM32CubeH7/Projects/STM32H743I-EVAL/Examples/SD at master · STMicroelectronics/STM32CubeH7 · GitHub
2026-03-17 6:15 AM
I’ve mostly completed porting my application to the STM32H753I-EVAL2, but I’m facing an inconsistent issue with SD card initialization.
Could this be due to a hardware-related issue, such as SD card slot instability or contact problem?Signal integrity / pull-up configuration? SDMMC peripheral misconfiguration (e.g., clock, bus width, or power sequencing)?
Or is there something in the software stack (HAL / BSP / FileX / ThreadX) that might require reinitialization handling after reinsertion?
Attaching main file and ioc file. Any suggestions on what to check would be really helpful.
2026-03-17 8:42 AM
> I’m facing an inconsistent issue with SD card initialization.
You have to tell in detail, what happens, what works at all, or sometimes not...
otherwise its a guessing game .
2026-03-17 8:53 AM
2026-03-17 9:51 AM - edited 2026-03-17 9:56 AM
>The issue I am facing is detailed in the very first post in this thread.
No.
There you had 150M as clock, that never can work.
Now - new tests needed.
If still same problem, there never was a working connection to the card.
And check (in PC) card: still working fine ? (I killed a card , just by trying to clock it with 100MHz.)
So just do what i showed : try to start /mount the card;
now need a scope: look at clk and cmd line , beginning communication with sd-card is always:
- at 3v3 level , check VCC of card also, 3v3 is mandatory.
- cmd/clk at init is at about 400kHz , you should see some "bursts" here.
- if this looks ok, then look at D0 data line: here the first data coming (if card and cpu understand each other),
but now at full clk speed, 25 or 50 Mbit, depends on what the card was "telling" .
+ for every test: power down/up the check the "start" on the lines to card , cmd/clk/D0 . Always power cycle !
2026-03-17 9:59 AM