cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 + SDIO + FatFS + USB MSC merge problem

Vladimir Lobanov
Associate II
Posted on June 03, 2018 at 19:44

Hello. I am developing the device on STM32L433 with the following logic of operation:

1) Pressed the button - the sensors are reading (SPI, I2C), data from them are written to the memory card via SDIO + FatFS

2) Pressed the button again - recording stops, the device can be connected to USB as a MSC and copy the previously recorded data.

The bundle of SDIO + FatFS is working, the data is normally written, but MSC does not work at all.

If I am add the line HAL_SD_Init (& hsd1) to the static void function MX_SDMMC1_SD_Init (void), the card is normally detected and works, but after that FatFS stops working on the controller. How to merge them together so they do not conflict?

#sdio #usb-msc #fatfs
1 REPLY 1
Barry Richards
Associate III

I have the same problem using a STM32F446RETx.

I can configure CubeMX with USB_Device, Mass Storage Class with USB_OTG_FS and Device_Only and I can read/write the contents of the SD card through the PC.

If I add FATFS with SD Card, I can read/write the contents of the SD card with FatFs but cannot open the SD Card with the PC. I get an error saying I need to format the card.