cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in HAL_SD_WideBusOperation_Config: ClockDiv gets overwritten

robert-hartung
Associate II
Posted on August 18, 2015 at 20:19

Hi,

I am using generated code from CubeMX. Here you can specify the clock divider.: 0690X00000602ZbQAI.jpg 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
4 REPLIES 4
Nesrine M_O
Lead II
Posted on August 19, 2015 at 12:04

Hi Robert,

Could you please specify which STM32 product you use and with witch CUBEMX version you interface the issue.

-Syrine-

robert-hartung
Associate II
Posted on August 19, 2015 at 19:10

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.

- Robert

Nesrine M_O
Lead II
Posted on August 20, 2015 at 11:49

Hi robert,

Thank you for your feedback. The issue is reported internally.

-Syrine-

Nesrine M_O
Lead II
Posted on January 27, 2016 at 10:51

Hi robert

Thanks for reporting this bug, it was fixed since the 1.2.0 version of the STM32F2 cube firmware package.

-Syrine-