Teensy 4.1 USB Host mass storage example not working?

Windorey

Active member
Hello, I am using the example for USBHost_t3 library, I tried all the storage examples, but none of them work. They all fail to read from any of my flash drives. All my drives are formatted FAT32, with more than enough files inside for the list program to be able to list them.

The HID example works if I disconnect the flash drive and instead connect my USB mouse, so the USB wiring is correct.
 
Hello, I am using the example for USBHost_t3 library, I tried all the storage examples, but none of them work. They all fail to read from any of my flash drives. All my drives are formatted FAT32, with more than enough files inside for the list program to be able to list them.

The HID example works if I disconnect the flash drive and instead connect my USB mouse, so the USB wiring is correct.

What OS are you using, Windows, Linux or MacOS? What versions? What versions of Arduino and Teensyduino are you using? What is the type and brand of the flash drives. Are you using a USB hub? Is it a powered hub?

We really can't help much without more information:) I would suggest starting of with Arduino 1.8.19 and Teensyduino 1.58 Beta 3 as these have the latest changes and updates. Also start of with 'DriveInfo.ino'.
The output will look something like this:
Code:
Waiting for Drive to initialize...
Device Info:
       connected: 1
     initialized: 1
   USB Vendor ID: 0951
  USB Product ID: 1666
      HUB Number: 0
        HUB Port: 0
  Device Address: 1
Removable Device: YES
        VendorID: Kingston
       ProductID: DataTraveler 3.0
      RevisionID:     
         Version: 6
    Sector Count: 60437491
     Sector size: 512
   Disk Capacity: 30943995392 Bytes

Partition Table
	part,boot,bgnCHS[3],type,endCHS[3],start,length
FAT32:	1,0,0x4,0x1,0x4,0xB,0xFE,0xC2,0xFF,2048,60434432
pt_#0:	2,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
pt_#0:	3,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
pt_#0:	4,0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0,0
	 < unused area starting at: 60436480 length 1011 >

Volume name: 32GFAT32
Volume type: FAT32
Cluster Size: 16384 bytes
Volume size: 30927306752 bytes
 Space used: 375930880 bytes  (922 ms to compute)

Files:
2021-10-03 16:29   56863276 armaged.wav
2019-01-01 08:14   40900890 Daddy's_Little_Man.wav
2021-09-12 23:48   43025728 DeffLepardAnimal.wav
2021-09-12 23:46   60148898 StatusQuoWhateverYouWant.wav
2021-09-12 23:44   35639166 ThePaperboysMolinos.wav
2019-01-01 08:01   36381082 ThePaperboysMolinosI'veJustSeenaFace.wav
2021-09-12 23:47  102878882 YoureLazyJimmyBarnesJoeBonamassa.wav
It would help to see the output from your serial monitor as well.
And then post the output using the code tag Icon "#".

Another option is to turn on the debug output in 'USBHost_t36.h'. This is at about line # 62-63:
Code:
// Uncomment this line to see lots of debugging info!
//#define USBHOST_PRINT_DEBUG [COLOR="#FF0000"]<---- Uncomment this line.[/COLOR]


// This can let you control where to send the debugging messages
//#define USBHDBGSerial Serial1
#ifndef USBHDBGSerial
#define USBHDBGSerial   Serial
#endif

And then post the output using the code tag Icon "#".
 
I am running Linux (Ubuntu based distribution), using the latest version of Arduino (2. Something) and PlatformIO (I test with both of them everything). Teensyduino is also the latest version.

There is one which now works which is a SanDisk and the other non-working one is a no name one that is from one of those “banking card flash drives”.

I am not using a hub, just connecting a recycled USB port directly to the Teensy pins.

The SanDisk suddenly started working correctly and drive into sketch is showing correct info, but no luck when it comes to the other flash drive. Shows up on my PC just fine and I can copy files to it without any hiccups, it is formatted the same way as the SanDisk and even with the same files inside.

Will make another reply with images of everything and send both drive infos once I get home.
 
Will make another reply with images of everything and send both drive infos once I get home.

As I promised:
2023-01-23-160128.jpg
2023-01-23-160208.jpg
2023-01-23-160258.jpg
2023-01-23-160434.jpg
 
Back
Top