2019-03-18 03:59 AM
Hello,
I'm using the STM32F767ZI and I'm using the FatFS feature with USB host communication. I created a project based on the example provided by STM32 CubeMX.
The program works. I can read in one file and write in another. My problem happens when I want to make it a 2nd time after unplugging and reconnecting the USB key.
If I do :
· Read in the input.txt file
· Write to the output.txt file
· Unplug the USB key
· Connect the USB key
· Read in the input.txt file
· Write to the output.txt file
The error occurs when I want to open a new file to write in.
if(f_mount(&USBDISKFatFs, (TCHAR const*)USBDISKPath, 0) != FR_OK)
{
/* FatFs Initialization Error */
Error_Handler();
}
While if I do:
· Read in the input.txt file
· Write to the output.txt file
· Unplug the USB key
· Connect the USB key
· Write to the output.txt file
...
· Unplug the USB key
· Connect the USB key
· Write to the output.txt file
I do not have an error.
Could my problem be the number of data in the Input.txt file (9490 x 10 matrix)?
The variables I use are the same each time.