cancel
Showing results for 
Search instead for 
Did you mean: 

ST32 / USB / SD / FATFS Problem

julian
Associate
Posted on November 14, 2013 at 15:31

I'm currently developing an application for an ST32 (STM32F103xC) using Micrium OS-II. So far it's all gone smoothly, but I've hit a block now and can't proceed.

The board is configured to act as a USB storage device using the SD card so that the host PC can copy files saved out on the device. This works fine, inasmuch as can see the files currently on the SD card in a Windows Explorer.

However, when I try to use FATFS to create a file in my program, f_open() always returns FR_NOT_READY. Stepping through the code, there does seem to be issues with interrupts from USB. I had a go at putting mutexes over SD access but this didn't seem to help. So I am now wondering if it's actually possible to open and write files to the SD whilst it's acting as a storage device?

#usb #fatfs #sdio
1 REPLY 1
Posted on November 14, 2013 at 15:46

You should do one, or the other, lest you create hideous coherency issues if you have two writers. You could play games with SCSI commands to make the media appear unready, not present, or changed?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..