AnsweredAssumed Answered

STM32CubeMX, FatFS and SDIO?

Question asked by H.Rick on Feb 20, 2017
Latest reply on Sep 1, 2017 by Pooja Barhate

Everyone,

How can I use cubeMX for SDcard ? I have generated for MDK but :

this function doesn't work , from UM1721
User manual
Developing Applications on STM32Cube with FatFs page 21.

:

uint32_t wbytes; /* File write counts */
uint8_t wtext[] = "text to write logical disk"; /* File write buffer */
if(FATFS_LinkDriver(&mynewdisk_Driver, mynewdiskPath) == 0)
{
if(f_mount(&mynewdiskFatFs, (TCHAR const*)mynewdiskPath, 0) == FR_OK)
{
if(f_open(&MyFile, "STM32.TXT", FA_CREATE_ALWAYS | FA_WRITE) == FR_OK)
{
if(f_write(&MyFile, wtext, sizeof(wtext), (void *)&wbytes) == FR_OK);
{
f_close(&MyFile);
}
}
}
}
FATFS_UnLinkDriver(mynewdiskPath);

 

This variable :

&mynewdisk_Driver doesn't exist, which file is related ?

 

Thank you

Outcomes