Incorrect OCR sent during SD card init
Posted: Wed Mar 08, 2017 8:29 pm
In hal_sdc.c, sdc_init, there is an incorrect OCR word sent in ACMD41:
ocr = 0xC0100000U;
while the correct value according to SD card specification is:
ocr = 0x50FF8000U;
That is, busy=0, hc=1, full performance, full voltage range. There are two major results of this change:
- sending empty voltage range is invalid for initialization, as it only queries for a supported voltage range without initializing the card (according to spec, but seems to work on most cards anyway)
- there is 2-4x performance speedup because full performance bit is set (currently it is 0 which means power save)
ocr = 0xC0100000U;
while the correct value according to SD card specification is:
ocr = 0x50FF8000U;
That is, busy=0, hc=1, full performance, full voltage range. There are two major results of this change:
- sending empty voltage range is invalid for initialization, as it only queries for a supported voltage range without initializing the card (according to spec, but seems to work on most cards anyway)
- there is 2-4x performance speedup because full performance bit is set (currently it is 0 which means power save)