2019-09-12 11:36 AM
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.
2019-09-12 11:59 AM
I think it is pretty apparent that ST doesn't have any kind of test matrix for the automated code generation.
2019-09-13 10:02 AM
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. :)