I’ve updated my sdcard project to include some FAT32 reading. Make sure a FAT32 partition is on the first partition of the card. So far, the driver is read-only. Drop a file called song.raw into the partition and it will play the song using PWM on pin GPIO 19. The song should be in a raw format with a sample rate of 16000Hz, one byte per sample.
The implementation is small. fat32.cc is 260 lines long, which is likely to be smaller than most other implementations. sdcard.cc is 576 lines long. It implements the SD card block device over SPI. Another compact implementation.