Hi,
I have a working application on a Teensy that uses FsFile and SD.sdfs for storage. I want to move to USBHost, USBDrive, and USBFileSystem for packaging purposes.
First, I started with the ListFiles examples from USBHost_t36/Storage. Relevant code:
When I run the application, a USB drive is already connected to the USB pins on the Teensy. When I run the application, the drive "flashes" indicating that it is connected properly. But the "firstPartion.begin" always fails.
Full disclosure. I am testing it with a USB SD card reader with the 128GB SD card I was using in the SD.sdfs version of the code. That reader looks just like a Thumb drive to my PC. I believe it is a FAT or ExtFAT (forgot the exact fs name).
So questions:
1. Am I missing something obvious here? Like specific formatting that is required by USBFileSystem? Or size limitations?
2. Assuming I get past 1, can I assume that the API for FsFile creation and use will work the same for my USBFileSystem instance as it did for SD.sdfs?
Thank you for any help you can provide.
Paul
I have a working application on a Teensy that uses FsFile and SD.sdfs for storage. I want to move to USBHost, USBDrive, and USBFileSystem for packaging purposes.
First, I started with the ListFiles examples from USBHost_t36/Storage. Relevant code:
Code:
USBHost myusb;
USBHub hub1(myusb);
USBHub hub2(myusb);
USBHub hub3(myusb);
USBHub hub4(myusb);
// Setup MSC for the number of USB Drives you are using. (Two for this example)
// Mutiple USB drives can be used. Hot plugging is supported. There is a slight
// delay after a USB MSC device is plugged in. This is waiting for initialization
// but after it is initialized ther should be no delay.
USBDrive myDrive(myusb);
USBFilesystem firstPartition(myusb);
void setup()
{
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect.
}
// Start USBHost_t36, HUB(s) and USB devices.
myusb.begin();
Serial.print("\nInitializing USB MSC drive...");
// future USBFilesystem will begin automatically
// begin(USBDrive) is a temporary feature
if (!firstPartition.begin(&myDrive)) {
Serial.println("initialization failed!");
return;
}
When I run the application, a USB drive is already connected to the USB pins on the Teensy. When I run the application, the drive "flashes" indicating that it is connected properly. But the "firstPartion.begin" always fails.
Full disclosure. I am testing it with a USB SD card reader with the 128GB SD card I was using in the SD.sdfs version of the code. That reader looks just like a Thumb drive to my PC. I believe it is a FAT or ExtFAT (forgot the exact fs name).
So questions:
1. Am I missing something obvious here? Like specific formatting that is required by USBFileSystem? Or size limitations?
2. Assuming I get past 1, can I assume that the API for FsFile creation and use will work the same for my USBFileSystem instance as it did for SD.sdfs?
Thank you for any help you can provide.
Paul