cancel
Showing results for 
Search instead for 
Did you mean: 

Cube4.12 SDIO generating code bug? 4bit settings generates 1B

schelven
Associate II
Posted on December 14, 2015 at 21:50

Hi,

If have a disco429 board modified, removing hardware that i dont use for an experiment and in order to connect and access an SD memory card by 4 bit.

The settings in CubeMX is set to SD 4 bits wide bus, but the code generated is ''hsd.Init.BusWide = SDIO_BUS_WIDE_1B;''

Is this because i started the cubemx project with the selection of the disco board or might it be considered a bug?

Thanks!

#cubemx-4.12-sdio
2 REPLIES 2
markb
Associate II
Posted on December 15, 2015 at 08:38 Hi, I believe that the SD card has to be initialised in 1 bit mode and then later can be switched to 4B. I do that after the call to f_mount() has returned with the following:

HAL_SD_ErrorTypedef hse;
hse = HAL_SD_WideBusOperation_Config(&hsd, SDIO_BUS_WIDE_4B);
if(hse != SD_OK) {
printf(''Error: failed to set SD card to 4 bit transfers (%d)

'', hse);
}

Cheers, Mark
schelven
Associate II
Posted on December 15, 2015 at 08:50

Thanks Mark, Ahhh that could be the reason.. i give it a try.