2018-02-21 02:29 PM
Hi.
I've been struggling for couple days to implement micro SD card into my project. I click everything through CubeMX 4.24 with CubeF7 v 1.9.0. 4-bits SDIO, SDIO global interrupt and 2 DMA Channels for RX and TX. FatFS default.I moved to F746G discovery board to eliminate possible hardware problems but still couldn't manage to get the FatFS working.When i manually BSP_SD_init(); i get correct cardinfo, capacity and things...I also did testing procedure:
BSP_SD_WriteBlocks_DMA(..)
BSP_SD_ReadBlocks_DMA(..)BSP_SD_Erase(..)BSP_SD_ReadBlocks_DMA(..)
with a success.
But when i run project almost straight from the CubeMX i get empty cardinfo as probably fatfs does not init the sdcard. f_mounts doesn't return errors. It hangs/timouts on f_mkfs or f_open if i omit mkfs and format the card externally (FAT32). I've tried many various fatfs examples with the same results.Any known problems or possible configuration advices?#sdcard #stm32-f7 #sdio #fatfsSolved! Go to Solution.
2018-02-21 03:52 PM
Ok. I've overcome this problem:
I did define:
void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd){ BSP_SD_ReadCpltCallback(); }
void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd){ BSP_SD_WriteCpltCallback(); }
ofc, with additional BSP Callbacks declarations.and added:BSP_SD_Init();
before MX_FATFS_Init();And that should be all.2018-02-21 03:52 PM
Ok. I've overcome this problem:
I did define:
void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd){ BSP_SD_ReadCpltCallback(); }
void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd){ BSP_SD_WriteCpltCallback(); }
ofc, with additional BSP Callbacks declarations.and added:BSP_SD_Init();
before MX_FATFS_Init();And that should be all.