While running the SdcConnect function on an STM32L4+ & EMMC, the bus speed is switched to a high speed
Code: Select all
/* Switches to high speed.*/
if (HAL_SUCCESS != detect_bus_clk(sdcp, &clk)) {
goto failed;
}
sdc_lld_set_data_clk(sdcp, clk);
In the function sdc_lld_set_data_clk, the clock will be set to the correct bus speed. This function fails because it is blocked by the ST hardware. So the value will not change.
After this function the connection fails, probably due to incorrect clock settings on both ends.
I moved the code above to a later position in the SdcConnect function
Code: Select all
/* Switches to high speed.*/
if (HAL_SUCCESS != detect_bus_clk(sdcp, &clk)) {
goto failed;
}
sdc_lld_set_data_clk(sdcp, clk);
/* Initialization complete.*/
sdcp->state = BLK_READY;
return HAL_SUCCESS;
Now the STM connects correctly to my EMMC and is the clock set correctly.
I don`t know if this is only an issue with the STM32L4+ as this is a high level SDC function