cancel
Showing results for 
Search instead for 
Did you mean: 

FatFS + SDIO + CubeMX issue

Duke Nukem
Associate
Posted on January 08, 2018 at 02:22

I'm trying to generate FatFS + SDIO working code by STM32Cube_FW_F4_V1.17.0 and V1.18 for custom boards on stm32f407vgt6 and stm32f429igt6 CPUs, but all attempts are unsuccessful. SPL worked for me. Cube generates absolutely identical functions SD_Initialize() and SD_Status() in sd_diskio.c:

/**

* @brief Initializes a Drive

* @param lun : not used

* @retval DSTATUS: Operation status

*/

DSTATUS SD_initialize(BYTE lun)

{

return SD_CheckStatus(lun);

}

/**

* @brief Gets Disk Status

* @param lun : not used

* @retval DSTATUS: Operation status

*/

DSTATUS SD_status(BYTE lun)

{

return SD_CheckStatus(lun);

}

I supposed to see the call of BSP_SD_Init() into the 

SD_initialize() function, but I see no call of this function anywhere else.

MX_SDIO_SD_Init() doesn't contain hardware initialization section also:

/* SDIO init function */

static 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 = 0;

}

Could someone share working example of FatFS + SDIO functionality generated by Cube?

2 REPLIES 2
Duke Nukem
Associate
Posted on January 08, 2018 at 13:37

Seems like I found the answer here:

https://community.st.com/0D50X00009XkWt5SAF

Miles SUN
Associate
Posted on February 24, 2018 at 03:36

Yes, that's a bug in cubemx 4.23 and have fixed in 4.24.....

But,... emmm, if u follow the official guide or help file to mount and access the SD card, u will find that's not a easy task.....

Can ST make a short video to introduce how to make a valid SDIO wired SD card project based on the new released version of CubeMX (e.g. 4.24) ?