STM32F407 Discovery Board - FatFs_USBDisk appliaction not working when unplug and plug in again
Hello,
I have a STM32F407 Discovery Board. I am trying out the FatFs_USBDisk demo application. I am running the application from STM32CubeIDE.
When I run the application and plug in a USB flash drive, the demo application works as expected. I see the STM32.txt file on the USB drive and the Green LED4 is on.
If I then unplug the USB flash drive and plug it back in, I get the RED error LED5.
Debugging it, I see the following is called when I unplug the USB flash drive.
f_mount(NULL, (TCHAR const*)"", 0); When I plug the USB flash drive back in I see that
if(f_mount(&USBDISKFatFs, (TCHAR const*)USBDISKPath, 0) != FR_OK)returns FR_OK
The demo application is failing in
if(f_open(&MyFile, "STM32.TXT", FA_CREATE_ALWAYS | FA_WRITE) != FR_OK)returning FR_NO_FILESYSTEM.
Specifically in the find_volume() in f_open()
If I stop the debug session and restart it the USB flash drive is mounted correctly and able to open then write the file.
Any thoughts on what is going on?
I have not modified the demo application (using as is out the box).
Thanks,
Brent
