4 Commits

Author SHA1 Message Date
Patrik Axelsson
d56fbaaaf4 Discard undefined byte at end of write multiple block
This byte needs to be read before the card goes busy, but more importantly,
it would otherwise be read out by sd_wait_ready():

For cards where this byte is 0xff, sd_wait_ready() would think the card is
immediately ready and let the code send it the next command, while the read
actually made the card go busy.

This makes the card end up in a state the code cannot recover it from - even
if you reboot the machine so spisd.device is restarted, it still requires
the card to be power cycled by ejecting and re-inserting it.

How to reproduce for affected cards:
1. Use spisd.device v2.2
2. Mount SD0:
3. Write a file larger than 512Bytes to trigger a write multiple block
4. Write or read another file, this will trigger the next command and show
   the issue as a read or write error
2023-08-30 16:56:48 +02:00
Patrik Axelsson
dadaab55d8 Fix size calculation for 32GB+ SD cards 2023-03-09 00:46:14 +01:00
Patrik Axelsson
14b7884aef Do not lock up SD card on read/writes of zero size
This is for example triggered by Check4GB when it attempts to TD64
capabilities in the device.
2023-03-09 00:46:14 +01:00
Niklas Ekström
a7a9350ba2 Initial commit of the project 2020-05-03 17:32:56 +02:00