cancel
Showing results for 
Search instead for 
Did you mean: 

FatFS f_open always returns FR_DISK_ERR (when SDCard and USB in a single project)

MB.9
Associate

I tried to implement the USB and SDCard in a single project. but I am facing some problems as mentioned below,

Below is my microcontroller configuration:

Controller: stm32h743bit6

SYSCLK frequency: 480MHz

APB1 &2: 120MHz

TO SDMMC1,2: check from 8Mhz to 52MHz

TO USB: 48MHz

·        Minimum Heap 0x400 / Minimum Stack 0x800

* USB and SDCard are working fine in the separate project configurations.

* But when integrated USB and SDCard in a single project facing some issues

  - The read and write functions of USB and SDCard are working fine when both devices are connected to the controller(Without ejecting SDCard or USB from the controller board).

* When we remove sd card or USB in between operations, the below error is observed

 - f_open or fmount functions will always return the FR_DISK_ERR .

 - Once i get disk error, i cant perform any operation like read or writing data to usb or sd card

 - Some times the code will be stopped the execution.

2 REPLIES 2

Hello @MB.9​ ,

Take a look at the following example that shows how to use FatFS multi-drive: (Path : Projects\STM32F769I_EVAL\Applications\FatFs\FatFs_MultiDrives)

as well, take a look at this discussion that might be useful to you : STM32CubeMX Multi-Drive Support with FatFS

Otherwise, how error handling is done in your application?

BeST Regards,

Walid

Hello @MB.9​ ,

Is there any news about your problem? Do you still have the same issues?

BeSt Regards,

Walid