]> granicus.if.org Git - esp-idf/commit
sdspi: fix compatibility issue in multi block read
authorIvan Grokhotkov <ivan@espressif.com>
Mon, 12 Mar 2018 07:47:06 +0000 (15:47 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Fri, 30 Mar 2018 10:49:42 +0000 (18:49 +0800)
commit4a2489b99a49ba2801fa4fd6fae7dba0a9c70428
tree56fce4a5a46f40bae73181d6122a6443cf756f7e
parent229f67b8162a2feed3c3a5d38b225a59ef98ec7a
sdspi: fix compatibility issue in multi block read

SDSPI driver optimized polling of the response tokens by requesting
two extra bytes on top of the block size (512) and CRC (2), and
checking whether these bytes contained the data response token or
not. In case the token was there, further polling would not need to
happen, thereby reducing latency between two consecutive blocks
transferred. However this caused compatibility issues when these two
extra bytes were sent after reading the final block. When
STOP_TRANSMISSION command was sent, these extra two bytes were
treated as part of the command, causing an invalid command error.

This fixes the logic by only requesting extra two bytes if the block
being read is not the final block. In addition to that, more strict
error checking is implemented for command response tokens.
components/driver/sdspi_host.c