Creating new Project for STM32F407 Discovery board and HAL driver with FatFs
i have a dicovrey f4 fattfs + usb msc + micro-sd ( +free rtos) running
i started from an old cubemx generated project (more than a year ago)
I remenber i had look at the cubef4 exemples to undertand a few things
and make it works in dma mode
but it was builing and almost working straigth away.
look like your are missing the BSP side that is “your wrapper arround sd and fatfts”
on my project source are in \Src\bsp_driver_sd.c
proto in “bsp_driver_sd.h”
this header is inlcude on “ffconf.h” that is referecne from fatfts middleware
few stuff in the header related to errors you’r getting
/* USER CODE BEGIN 0 */
/* Includes ----------------------*/
- include “stm32f4xx_hal.h”
/* Exported constants --------------------*/
/**
* @brief SD status structure definition
*/
- define MSD_OK 0x00
- define MSD_ERROR 0x01
- ifndef SD_CardInfo
#define SD_CardInfo HAL_SD_CardInfoTypedef
- endif
/** @defgroup STM324x9I_EVAL_SD_Exported_Constants
* @{
*/
- define SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
- define SD_PRESENT ((uint8_t)0x01)
- define SD_NOT_PRESENT ((uint8_t)0x00)