2015-08-18 11:19 AM
Hi,
I am using generated code from CubeMX. Here you can specify the clock divider.: The generated code looks like this:void MX_SDIO_SD_Init(void){hsd.Instance = SDIO;hsd.Init.ClockEdge = SDIO_CLOCK_EDGE_RISING;hsd.Init.ClockBypass = SDIO_CLOCK_BYPASS_DISABLE;hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_DISABLE;hsd.Init.BusWide = SDIO_BUS_WIDE_1B;hsd.Init.HardwareFlowControl = SDIO_HARDWARE_FLOW_CONTROL_DISABLE;hsd.Init.ClockDiv = 4;HAL_SD_Init(&hsd, &SDCardInfo);HAL_SD_WideBusOperation_Config(&hsd, SDIO_BUS_WIDE_4B);}
The problem is the WideBusConfiguration function which looks like this:
Init.ClockDiv = SDIO_TRANSFER_CLK_DIV; /* Configure SDIO peripheral interface */ SDIO_Init(hsd->Instance, Init);
It overwrites the clock divider field and thus the configuration will never be used. Thus I cannot use a different clock divider than ''0'' which results in (0+2) and is equal to 48MHz/2 = 24MHz that is hardly the specification limit.
- Robert
#hal #sd #!bug
2015-08-19 03:04 AM
Hi Robert,
Could you please specify which STM32 product you use and with witch CUBEMX version you interface the issue.-Syrine-2015-08-19 10:10 AM
Hi Syrine,
I am using an STM32F207VCT with altest versions of CubeMX and the HAL. It looks like this is not a problem with the processor but with the HAL actually.- Robert2015-08-20 02:49 AM
Hi robert,
Thank you for your feedback. The issue is reported internally.-Syrine-2016-01-27 01:51 AM
Hi robert
Thanks for reporting this bug, it was fixed since the 1.2.0 version of the STM32F2 cube firmware package.-Syrine-