FAT and SDIO on the STM32F4: Early Experiments

I've been trying to marry the FatFS filesystem driver with a modified version of ST's SDIO sample code in order to read/write a FAT filesystem on an SD card for logging on my AVC robot.

It's been a frustrating few days. I've had intermittent results and I'm not sure why. I think there's some uncertainty with the DMA completion interrupts in my current lash-up. Moving from ST's library to Lukasz Iwaszkiewicz's software helped. I don't know the differences between the two codebases. Clocking the SD card at 25MHz (I think that's the clock speed in use) at the end of 12" jumper wires surely isn't helping anything. I also think that stopping the debugger and relaunching my code without powering off the SD card may leave its internal state machine confused. All of this is just conjecture, though, based largely on my wholescale ignorance of how the SD interface and the code I'm using actually work.

Currently, I'm able to read a file from the SD card but I'm having problems writing a file. (I started my attempt at writing this morning and only had 45 minutes to work on it before I had to leave for work.)

First experiments with the STM32F4DISCOVERY and an SD card.

First experiments with the STM32F4DISCOVERY and an SD card.

I'm designing a circuit board for my robot's brain that will solve the long wire problem when it's built, but I'm still a ways out from sending that off to be fabbed.

The Saleae logic analyzer that's barely visible in the picture has been worth its purchase price many times over. Many thanks to Supermodel Wife who bought it as a Christmas present for me despite knowing absolutely nothing about what it was!