to use the FATFs on the STM32F746NG-Discovery Board, I generate the code using the CubeMX.
this is my main.c file.
during the debugging, I found that the value returned by the f_mount is FR_NOT_READY, so that the function will always fall into Error_Handle();
but with the same board and sd card, the demo project:
it could work well.
I want to know whether there is any other thing I've forgot to add to the project? Or the code generator itself has a big bug?
the method i generate the code is:
- select the board
2. config the pinout
and choose the FATFS
3. resolve the clock
5. change the heap size
7. and generate the project
8.open project and add this line to main.c
FATFS SDFatFs; /* File system object for SD card logical drive */
FIL MyFile; /* File object */
char SDPath; /* SD card logical drive path */
if(f_mount(&SDFatFs, (TCHAR const*)SDPath, 1) != FR_OK)
and rebuilt it, debug, falls into error_handle.