wwatson4506 / UsbMscFat

Teensy 36/40/41 Compatiblility Layer for MSC and SdFat
MIT License
9 stars 3 forks source link

UsbMscFat Library

NOTE: This Library is OUTDATED !!!

Please Use the examples in the latest USBHost_t36 stable library for the Teensy. Teensyduino 1.57 up to 1.59B5. Arduino 1.8.19 or Arduino 2.3.3.

This Teensy 3.6/4.0/4.1 library allows use of FS and MSC with SdFat.

You will need Arduino 1.8.13 and TeensyDuino 1.54 Beta 6.

No other changes to FS, MSC or SdFat are needed. SdFat and MSC are now included in TeensyDuino 1.54B6. It allows the use of USB mass storage devices along with exsisting SD cards and littleFS.

This library should be considered as proof of concept as PJRC is developing a standard interface for storage devices and may not be compatible with future releases of TeensyDuino.

Installation:

Install this library in Arduino/libraries folder.

Examples:

Error checking is still not completely functional yet. Mass storage sense key codes and additional sense codes are proccessed. They are displayed as definitions of the error codes not the codes them selves. I have one PNY USB thumb drive that magically decided to write protect itself and gave me this error when I tryed to do a direct sector write:

SCSI Transfer Failed: Code: 1 --> Type: DATA_PROTECT Cause: WRITE PROTECTED.

It turns out that this particular thumb drive had a factory firmware defect that needed an update. USB drives that I have don't seem to cause many failures using MSC so far so it was nice to be able to actually have it fail to test the sense codes.