Function FS Init
Detects and initializes SD card and FAT filesystem over it.
Zero on success, error code on failure.
This takes a few dozen milliseconds. It populates the SD data structure according to the results, which means setting the Filesystem type flag in addition to SDC_Init().
The error codes returned by this function:
- 1: CMD0 failed (possibly no card in socket)
- 2: CMD59 failed (couldn't enable CRC checking)
- 3: ACMD41 failed (not possible to initialize, bad card)
- 4: ACMD41 timed out
- 5: CMD58 failed (couldn't query card)
- 6: SD read fault
- 7: No usable FAT filesystem found
When the library is operating in compatibility mode (no bootloader detected), it does not return error code 2, rather tries to enable CRC checking twice and ignore failure. This is used to support the Uzem emulator which doesn't emulate SD CRC.