AnsweredAssumed Answered

STM32F4 FatFs middleware problem with f_open();

Question asked by japit.suilarso on Dec 24, 2015
Latest reply on Dec 28, 2015 by Clive One
Would like to know if anyone comes across pointer crash when using f_open()?

Background:
Our project's configuration include FatFs and USB Host, and the LSE and HSE are 32.7KHz and 8MHz respectively. The media used for FatFs is 1GB USB thumbdrive formatted with FAT16.

I was able to successfully mount the device in our project, but faced problem when I tried to create a file with f_open(&filePtr, (const TCHAR *) filename, FA_OPEN_ALWAYS | FA_WRITE) function. The filePtr after the completion of f_open() function call became corrupted even though the f_open() function return FR_OK. I stepped through the code in debug mode and saw the pointer corruption occurred toward the end of f_open() function.

Would appreciate if anyone would like to share a solution for the above problem.

Thanks & Regards

Outcomes