wwatson
Well-known member
I now have SdFat-beta and MSC working together two ways. One way uses a heavily modified version of the SdFat and Sd libraries. I matched or in-lined the the classes in the two libraries and added block device access for USB host storage devices to the SdFat src directory. This works well but is very invasive to the two libraries. In the second version I created a new library, mscFS that parallels SD and is less in invasive to SdFat and does not use the SD library. It uses all of the latest file system abstraction @Paul created. It only makes an entry in a couple of files in SdFat.
The SdFat src directory contains a a new directory called "USBmsController" containing the low level access to MSC. Actually it uses a modified version of the USBHost_t36 library. MSC now is not used. Instead "USBHost_t36.h" has the former contents of "msc.h" and "msc.h" located in the utiliy directory contains portions of "MassStorage.h". The latest version of "MassStorageDriver.ccp" was added to the USBHost_t36 library. @Paul - I will do a PR on the USBHost_t36 library. I forked the latest one from your Github and modified it.
I was not sure which version of SdFat would be the best one to use. Both have been tested with T3x and T4.x, builtin and external SD cards and USB host devices. So far I have not detected any conflicts but further testing of these libraries is needed
For what I call the inline version of SdFat you will need these libraries for my GitHub site:
https://github.com/wwatson4506/USBHost_t36
https://github.com/wwatson4506/SdFat-beta/tree/SdFat-inline
and
https://github.com/wwatson4506/SD
These will be installed in the TD1.54B5 libraries directory. Of course, make sure to backup the existing libraries.
For what I call the parallel version of SdFat you would use these libraries:
https://github.com/wwatson4506/USBHost_t36
https://github.com/wwatson4506/SdFat-beta/tree/SdFat-parrallel
and:
https://github.com/wwatson4506/mscFS
There are example sketches I added in all five of the libraries. The ones I modified for USB host devices the filename it's self end with "USB.ino".
Examples - "cardInfoUSB.ino" "listfilesUSB.ino" "benchUSB.ino" etc...
Again, the MSC library is not used. It will probably morph into a "MSHost" library where I have time to work in making MSC compatible with USBHost_t36 which right now is not completely backwards compatible. However, I do have uSDFS and FatFs working.
I know @Paul and everybody is busy as heck right now but if you have time please try these libraries. It has been a long hard road to get this working but I have learned so much by studying Sdfat-beta, SD, FS.h and littleFS
The SdFat src directory contains a a new directory called "USBmsController" containing the low level access to MSC. Actually it uses a modified version of the USBHost_t36 library. MSC now is not used. Instead "USBHost_t36.h" has the former contents of "msc.h" and "msc.h" located in the utiliy directory contains portions of "MassStorage.h". The latest version of "MassStorageDriver.ccp" was added to the USBHost_t36 library. @Paul - I will do a PR on the USBHost_t36 library. I forked the latest one from your Github and modified it.
I was not sure which version of SdFat would be the best one to use. Both have been tested with T3x and T4.x, builtin and external SD cards and USB host devices. So far I have not detected any conflicts but further testing of these libraries is needed
For what I call the inline version of SdFat you will need these libraries for my GitHub site:
https://github.com/wwatson4506/USBHost_t36
https://github.com/wwatson4506/SdFat-beta/tree/SdFat-inline
and
https://github.com/wwatson4506/SD
These will be installed in the TD1.54B5 libraries directory. Of course, make sure to backup the existing libraries.
For what I call the parallel version of SdFat you would use these libraries:
https://github.com/wwatson4506/USBHost_t36
https://github.com/wwatson4506/SdFat-beta/tree/SdFat-parrallel
and:
https://github.com/wwatson4506/mscFS
There are example sketches I added in all five of the libraries. The ones I modified for USB host devices the filename it's self end with "USB.ino".
Examples - "cardInfoUSB.ino" "listfilesUSB.ino" "benchUSB.ino" etc...
Again, the MSC library is not used. It will probably morph into a "MSHost" library where I have time to work in making MSC compatible with USBHost_t36 which right now is not completely backwards compatible. However, I do have uSDFS and FatFs working.
I know @Paul and everybody is busy as heck right now but if you have time please try these libraries. It has been a long hard road to get this working but I have learned so much by studying Sdfat-beta, SD, FS.h and littleFS