I have been struggling for a week now trying to get FatFS working over the SDIO under FreeRTOS. I was making some progress debugging through the HAL but I have come to a difficult part to debug.
While debugging through f_open(), stepping into find_volume() and I get to the check_fs(). It pulls up the MBR correctly and the partition table sends it to sector 8192. The following steps pull the sector pointed to by the MBR in each of the four partition tables. When check_fs() reads sector 8192 everything is correct EXCEPT the first word, which is set to 0x00000000. find_volume() uses this first word to determine if the sector is a valid FAT partition, and zero is not valid, so I get an invalid file system error.
I put breakpoints on the SDIO and DMA interrupts so that it breaks before any of the interrupt code is executed and the first word of sector 8192 is still 0x00000000. It looks like the DMA_Read is not pulling the first word of the sector. When I put the SDIO card into my PC and use a disk sector editor the first bytes of the sector are non-zero and valid values.
I tried running with the DMA FIFOs off and got all zeros for the entire MBR sector.
Any suggestions? (Go back to 1.7?)