2013-11-14 06:31 AM
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 #sdio2013-11-14 06:46 AM
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?