[En-Nut-Discussion] Dummy buffer hack in SPI MMC driver

Harald Kipp harald.kipp at egnite.de
Mon Mar 12 16:40:14 CET 2012

Hi all,

My original MMC driver suffered from sporadic read failures, caused by
garbage transmitted to the card during read transfers (from card to CPU).

The tricky part is, that PDC (DMA in AT91 terms) requires the transmit
buffer even during SPI read only transfers. Some time ago, Ole provided
a patch that uses a dummy buffer filled with 0xFF. While fixing the bug,
it wastes 512 extra bytes of RAM.

My idea now was to switch the MOSI line to GPIO mode and keep the line
high during read transfers. This way we may be able to get rid off the
dummy buffer. Due to lack of time I'm currently not able to implement
and verify this. Someone else can jump in?



More information about the En-Nut-Discussion mailing list