cancel
Showing results for 
Search instead for 
Did you mean: 

STM32Cube STM32H7 firmware 1.5.0, when fix SDMMC init?

Jack3
Senior II

Hello, I use STM32CubeMX and use the latest STM32H7 (1.5.0) firmware.

When may the MX_SDMMC1_SD_Init finally be fixed?

The function still looks like this, which will accomplish nothing, really:

void MX_SDMMC1_SD_Init(void)
{
  hsd1.Instance = SDMMC1;
  hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING;
  hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE;
  hsd1.Init.BusWide = SDMMC_BUS_WIDE_4B;
  hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
  hsd1.Init.ClockDiv = 25;
}

Should it better look something like this, at least calling HAL_SD_Init too, or is it not needed to do so?

void MX_SDMMC1_SD_Init(void)
{
  HAL_StatusTypeDef status;
 
  hsd1.Instance = SDMMC1;
  hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING;
  hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE;
  hsd1.Init.BusWide = SDMMC_BUS_WIDE_4B;
  hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
  hsd1.Init.ClockDiv = 25;
 
  status = HAL_SD_Init(&hsd1);
  if (status != HAL_OK)
  {
    Error_Handler();
  }
}

 Has the library for SDMMC been tested using the first code? Does it work that way?

 I believe for me only the second variant works.

2 REPLIES 2

I think it is pretty apparent that ST doesn't have any kind of test matrix for the automated code generation.

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

When I compare the different STM32H7 firmware (1.4.0 vs 1.5.0), I notice they focus on correcting preceding and trailing spaces in the source code mostly.

I think to have the code correct is more important. 🙂