[SOLVED] After the instruction MX_TouchGFX_Init(), FATFS methods do not work as wanted (STM32F469I-DISCO)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-03-22 6: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:
- If there is MX_TouchGFX_Init();, after f_mount(), FatFs gets the value : 0x2000a6a4 <SDFatFs>
- In other case, FatFs is equal to the value : 0x2000a2fc <SDFatFs>
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.
- Labels:
-
STM32F4 Series
-
TouchGFX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-03-31 5: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-03-31 5: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.
