AnsweredAssumed Answered

FatFS + SDIO + CubeMX issue

Question asked by Duke Nukem on Jan 8, 2018
Latest reply on Feb 24, 2018 by Miles SUN

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?

Outcomes