STM32f4 with FatFS + FreeRTOS + SDIO SD card sometimes fails with FR_DISK_ERR on f_write
My application works great, until it doesn't. I'm logging to an SD card, and every so often the call to f_write will return FR_DISK_ERR, at which point all subsequent attempts to write will return the same error.
Attempts to call f_open on a second file result in FR_LOCKED after the initial failure on the first file.
After a power cycle, everything is fine. And the mean time to failure is hours/thousands of log file writes (on two log files, not just one).
Documentation describes FR_DISK_ERR as an "unrecoverable hard error", but I'd like to figure out is there's any way at all to recover without power cycling.
Board layout follows guidance for SDIO lines, and the waveforms on the transmission lines look very similar to those on the ST dev boards. I can't totally rule out EMI as the root source, but would love to find a software work around since the application is tolerant of a few missed log entries.
