cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] After the instruction MX_TouchGFX_Init(), FATFS methods do not work as wanted (STM32F469I-DISCO)

William F
Associate II

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>

 0693W00000KdYSvQAN.png0693W00000KdYSgQAN.pngDo 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!!!

0693W00000KdaPPQAZ.png 

1 ACCEPTED SOLUTION

Accepted Solutions
Amel NASRI
ST Employee

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.

View solution in original post

1 REPLY 1
Amel NASRI
ST Employee

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.