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
..
2023-03-15 14:13:28 +01:00
2020-05-03 17:32:56 +02:00
2020-05-03 17:32:56 +02:00
2020-05-03 17:32:56 +02:00
2020-05-03 17:32:56 +02:00

SD card module

An SD card module can be used with the SPI adapter in order to mount the SD card as a volume in AmigaOS. This driver uses the code written by Mike Sterling: https://github.com/mikestir/k1208-drivers/tree/master/sd. Thanks Mike!

The file sd.c does all the heavy lifiting and remains largely unchanged compared to Mike's original. The file device.c had to be partially changed in order to be compiled with VBCC. The only reason I'm using VBCC instead of using gcc is that I haven't been successful in installing gcc.

The build.bat Windows batch file contains the command line used to compile the driver with VBCC, producing the binary spisd.device which should go in the DEVS: directory.

Install the fat95 file system handler in L: and copy the mountfile (available here) to some suitable place where it can be used to mount the SD card (read more about how this works in other places, e.g. the fat95 documentation).