2022-03-22 06:16 AM
When I'm using TOUCHGFX and FATFS together, I can create/write/read a file in my SD only if I do it before "MX_TouchGFX_Init();"
f_mount(&SDFatFS, (TCHAR const*)SDPath, 0);
f_open(&SDFile, "DIO.TXT", FA_CREATE_ALWAYS | FA_WRITE); //with TGFX this one gets FR_DISK_ERR
f_write(&SDFile, wtext, sizeof(wtext), (void *)&byteswritten);
f_close(&SDFile);
f_mount(NULL, (TCHAR const*)SDPath, 0);
Not sure if this can be helpfull but the only difference I notice it's that when I debugging:
Do you know if there is something I can do to make them working well after with the graphic application?
Thank you
EDIT: I resolve it. I suppose because MX_TouchGFX_Init() is written in C++ inside that the FATFS methods could not be read in C so I put it inside a task and it works!!!
Solved! Go to Solution.
2022-03-31 05:50 AM
See Edit section for the solution, thanks @William F for sharing it.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-03-31 05:50 AM
See Edit section for the solution, thanks @William F for sharing it.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.