I have a SD card connector attached to a Sharp LH75410 ARM processor via SPI using the SSP hardware. This has been working for ~9 months with a variety of SD and MMC cards. However, recently I have found a couple of SD cards that don't seem to work. I don't mean they don't initialize but that three or four sector reads and writes fail out of a thousand, and the failures don't match the protocol as I understand it. Single sector read CMD17, for example, sometime misses the Format1 response and returns a data token - though sometimes that's gibberish too. CMD24 does something similar.
So I am asking for any experiences with SD cards in SPI mode. What sort of problems there might be. Also for experiences using the Sharp SSP, particularly for SPI usage.
The cards I have tried successfully are SanDisk SD cards of various sizes, Kingston 512MB SD, superspeed MMC+ 1GB , Integral 512 MB SD MLC card, Canon (Ricoh) MMC 16 MB and various other no-name cards.
The cards that fail are a Toshiba 16 MB SD, which seems to have only 14 MB capacity, and a BytesStor 512MB high speed SD.
The set up is a Sharp (NXP?) LH75410 ARM processor running at 51.6 MHz. The SPI is running at 1.84 Mhz except during initialization when it runs at 391 kHz. The card connector is wired via a short cable. The card interface runs from 3V3 that is locally regulated - good for 250mA and looks clean in use. The signal lines has EMC filters at the CPU board because it can be used to interface to other things. This limits the max clock to ~3 MHz. If I fix the clock at 391 kHz this does NOT improve matters though.
The FAT code is based on FatFs R0.02a with my own changes for LFN (and know about the M$ licensing). This doesn't appear to be the issue since it works fine for SanDisk cards Fat12, Fat16 and Fat32 (by reformatting - on SD HC uses Fat32). So I presume the problem to be in my SPI drivers, the physical interface, or some incompatibility in the cards. The code is running from external Flash so it isn't very fast ~ 60kbyte/sec write, but that's plenty.
Clearly I need help - perhaps just therapy!
thanks in advance for any advice Peter