2021-06-10 08:45 PM
Hello,
Doing some work using sd cards, and noticed that if i were to use the main.h file and have all my fatfs.h declared all the structs like FATFS / FIL / FRESULT spit out errors that theyre undefiend when cntrl clicking takes me to the file.
unknown type name 'FATFS' (same with the remainder structs)
if i instead make my own file in src called x.h and copy the same code over i get no issues.
Any ideas ?
Latest version of cubemx
a quick snippit of the setup code is
#include "stdint.h"
#include "fatfs.h"
FATFS FS;
FIL fil;
FRESULT fres;
int MountReadSDCard(){
//Mount SSD and copy over the files
if ((fres = f_mount(&FS, "", 1)) == FR_OK) {
/* Try to open file */
HAL_Delay(50);
if ((fres = f_open(&fil, "out.bin", FA_READ)) == FR_OK) {
}
Solved! Go to Solution.
2021-06-10 10:59 PM
Make sure the compiler knows the path to fatfs.h. Details depends on your particular toolchan, read the toolchain's manual.
JW
2021-06-10 10:59 PM
Make sure the compiler knows the path to fatfs.h. Details depends on your particular toolchan, read the toolchain's manual.
JW
2021-06-14 11:18 PM
Thanks, completely forgot about the PATH, honestly assumed that it would of already been in there