USBHost_t36 USB Mass Storage Driver Experiments

Yes, nice to see it work.

Haven't looked ANY at the code or support functions (VOL label or other drive ID, or param info) - just running that sample. Interesting the Flash alone takes that long time first seen to come online - then the HDD in HUB online at 2089 ms and just a few ms later after running the short drive1 test the drive2 Flash is online at 2156 ms.

And working reliably with rebuild, clean build, or Reset.

After sitting since last post just hit TyComm Reset and HDD gave : 4109 ms >> initialization done.
repeats after that went to 2 secs and under for a couple then back to 4 secs ... so 5 secs seems minimal safe WAIT
 
@defragster - I remember seeing a post, can't remember where, that I think explained the reason for the inconsistent initialization and access times and it made sense. Dealing with anything that involves flash memory has a bit of housekeeping involved. For that matter probably hard drives a little bit as well. The current state of the device is probably in an unpredictable state when powered down or up. Possibly syncing and unmounting the device before power down could help. Not sure:)
 
@wwatson - what I found in msc.h when I started was this:
Code:
// These two defines are timeouts for detecting a connected drive
// and waiting for it to be operational.
#define MEDIA_READY_TIMEOUT	1000
#define MSC_CONNECT_TIMEOUT 4000

I just put that back - and when First try of MSC.begin() failed ... I added another try:
Code:
Initializing USB MSC drive...initialization failed!

Initializing USB MSC drive... Try #2 ... 
Initializing USB MSC drive...2175 ms >> initialization done.
Writing to test.txt...done.

That worked for Hub/HDD with Flash

- but Flash only direct seems to have hung the T_4.1

So that doesn't seem a viable path at this time?

I put times back to 5K for both and only HDD with No Flash
Works for HDD msDrive1 - when it tries msDrive2 fails as expected:
Code:
initialization failed!
No USB drive detected, plugged in?
USB drive error: 0x28,0x0 --> Type: NO_SENSE Cause: NO ADDITIONAL SENSE INFORMATION
 
@defragster - Based on your testing and some of mine I think it would be best to set the timeouts to at least 30 seconds. I was checking some of the other Mass Storage drivers and they to were doing at least 30 seconds for there timeouts. It is actually waiting for the media to become internally ready to connect to USBHost_t36. (power up).
 
Code:
sizeof Device = 36
sizeof Pipe = 96
sizeof Transfer = 64
power up USBHS PHY
 reset waited 5
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 1FFF4000
periodictable = 1FFF4000

Initializing USB MSC drive...port change: 10001803
    connect
  begin reset
port change: 18001205
  port enabled
  end recovery
new_Device: 480 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 00 02 00 00 00 40 FF FF 78 56 00 02 01 02 03 01 
    VendorID = FFFF, ProductID = 5678, Version = 0200
    Class/Subclass/Protocol = 0 / 0 / 0
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: USB
enumeration:
Product: Disk 2.0
enumeration:
Serial Number: 00001103230642337368
enumeration:
Config data length = 32
enumeration:
Configuration Descriptor:
  09 02 20 00 01 01 00 80 32 
    NumInterfaces = 1
    ConfigurationValue = 1
  09 04 00 00 02 08 06 50 00 
    Interface = 0
    Number of endpoints = 2
    Class/Subclass/Protocol = 8(Mass Storage) / 6(SCSI) / 80(Bulk Only)
  07 05 01 02 00 02 00 
    Endpoint = 1 OUT
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
  07 05 82 02 00 02 00 
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
enumeration:
USBHub memory usage = 960
USBHub claim_device this=1FFF2CE0
USBHub memory usage = 960
USBHub claim_device this=1FFF30A0
USBHub memory usage = 960
USBHub claim_device this=1FFF3460
USBHub memory usage = 960
USBHub claim_device this=1FFF2920
msController claim this=1FFF2020
Descriptor 4 = INTERFACE
msController claim this=1FFF2020
09 04 00 00 02 08 06 50 00 07 05 01 02 00 02 00 07 05 82 02 00 02 00 
numendpoint=2
endpointIn=82
endpointOut=1
packet size in (msController) = 512
packet size out (msController) = 512
polling intervalIn = 0
polling intervalOut = 0
new_Pipe
new_Pipe
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
control CallbackIn (msController)
00 00 00 00 00 00 00 00 
control CallbackIn (msController)
00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 01 00 00 00 00 00 00 00 80 00 06 1B 01 00 00 01 00 00 00 00 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 01 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 02 00 00 00 00 00 00 00 80 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 02 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 03 00 00 00 24 00 00 00 80 00 06 12 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 36
00 80 04 02 1F 00 00 00 56 65 6E 64 6F 72 43 6F 50 72 6F 64 75 63 74 43 6F 64 65 20 20 20 20 20 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 03 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 04 00 00 00 08 00 00 00 80 00 0A 25 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 8
01 D4 BF FF 00 00 02 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 04 00 00 00 00 00 00 00 00 
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 05 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
FA 33 C0 8E D0 BC 00 7C 8B F4 50 07 50 1F FB FC BF 00 06 B9 00 01 F2 A5 EA 1D 06 00 00 BE BE 07 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 05 00 00 00 00 00 00 00 00 
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 06 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 00 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
EB 5A 90 2B 6A 30 7C 38 49 48 43 00 02 10 F0 0A 02 00 00 00 00 F8 00 00 20 00 40 00 40 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 06 00 00 00 00 00 00 00 00 
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 07 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
FA 33 C0 8E D0 BC 00 7C 8B F4 50 07 50 1F FB FC BF 00 06 B9 00 01 F2 A5 EA 1D 06 00 00 BE BE 07 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 07 00 00 00 00 00 00 00 00 
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 08 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 00 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
EB 5A 90 2B 6A 30 7C 38 49 48 43 00 02 10 F0 0A 02 00 00 00 00 F8 00 00 20 00 40 00 40 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 08 00 00 00 00 00 00 00 00 
initialization done.
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 09 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 80 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
52 45 43 59 43 4C 45 52 20 20 20 12 00 96 D4 88 3A 51 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 09 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0A 00 00 00 00 02 00 00 00 00 0A 2A 00 00 00 80 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)512
52 45 43 59 43 4C 45 52 20 20 20 12 00 96 D4 88 3A 51 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0A 00 00 00 00 00 00 00 00 
Writing to test.txt...msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0B 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 0B 30 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
F8 FF FF 0F FF FF FF FF FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F 08 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0B 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0C 00 00 00 00 02 00 00 00 00 0A 2A 00 00 00 85 D0 00 00 01 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)512
74 65 73 74 69 6E 67 20 31 2C 20 32 2C 20 33 2E 0D 0A 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0C 00 00 00 00 00 00 00 00 
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0D 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 80 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
52 45 43 59 43 4C 45 52 20 20 20 12 00 96 D4 88 3A 51 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0D 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0E 00 00 00 00 02 00 00 00 00 0A 2A 00 00 00 80 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)512
52 45 43 59 43 4C 45 52 20 20 20 12 00 96 D4 88 3A 51 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0E 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0F 00 00 00 00 02 00 00 00 00 0A 2A 00 00 00 0B 30 00 00 01 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)512
F8 FF FF 0F FF FF FF FF FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F 08 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0F 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 10 00 00 00 00 02 00 00 00 00 0A 2A 00 00 00 45 B8 00 00 01 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)512
F8 FF FF 0F FF FF FF FF FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F 08 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 10 00 00 00 00 00 00 00 00 
done.
test.txt:
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 11 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 85 D0 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
74 65 73 74 69 6E 67 20 31 2C 20 32 2C 20 33 2E 0D 0A 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 11 00 00 00 00 00 00 00 00 
testing 1, 2, 3.

I tried 3 USB sticks. One worked. Above the log for the USB stick that worked.
 
@sharafat
From this post : pjrc.com/threads/55821-USBHost_t36-USB-Mass-Storage-Driver-Experiments
Code:
// These two defines are timeouts for detecting a connected drive
// and waiting for it to be operational.
#define MEDIA_READY_TIMEOUT	5000
#define MSC_CONNECT_TIMEOUT       5000

Set those to 5000 or 30000 and try your flash drives again.


Also editing these two BOLD lines in for the success case might show how long it takes the drives there to work when it hits the "initialization done":
Code:
  if (!MSC.begin(&msDrive1)) {
    Serial.println("initialization failed!");
    // Check Sense Codes
    MSC.mscfs.printMscError(&Serial);
    return;
  }
[B]  Serial.print( millis() );
  Serial.println(" ms >> initialization done.");
[/B]  
  // open the file. 
  myFile = MSC.open("test.txt", FILE_WRITE);

@wwatson : Seems large single timeout effort would be best - even 30 seconds - when the drives are known to be there and needed ... just have to wait for them to appear.

Was hoping the try twice might work - but unless the USB system is meant for handling that - I can see it might trip over itself.
 
Last edited:
Code:
sizeof Device = 36
sizeof Pipe = 96
sizeof Transfer = 64
power up USBHS PHY
 reset waited 5
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 1FFF4000
periodictable = 1FFF4000

Initializing USB MSC drive...port change: 10001803
    connect
  begin reset
port change: 18001205
  port enabled
  end recovery
new_Device: 480 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 00 02 00 00 00 40 FF FF 78 56 00 02 01 02 03 01 
    VendorID = FFFF, ProductID = 5678, Version = 0200
    Class/Subclass/Protocol = 0 / 0 / 0
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: USB
enumeration:
Product: Disk 2.0
enumeration:
Serial Number: 00001103230642337368
enumeration:
Config data length = 32
enumeration:
Configuration Descriptor:
  09 02 20 00 01 01 00 80 32 
    NumInterfaces = 1
    ConfigurationValue = 1
  09 04 00 00 02 08 06 50 00 
    Interface = 0
    Number of endpoints = 2
    Class/Subclass/Protocol = 8(Mass Storage) / 6(SCSI) / 80(Bulk Only)
  07 05 01 02 00 02 00 
    Endpoint = 1 OUT
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
  07 05 82 02 00 02 00 
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 512
    Polling Interval = 0
enumeration:
USBHub memory usage = 960
USBHub claim_device this=1FFF2CE0
USBHub memory usage = 960
USBHub claim_device this=1FFF30A0
USBHub memory usage = 960
USBHub claim_device this=1FFF3460
USBHub memory usage = 960
USBHub claim_device this=1FFF2920
msController claim this=1FFF2020
Descriptor 4 = INTERFACE
msController claim this=1FFF2020
09 04 00 00 02 08 06 50 00 07 05 01 02 00 02 00 07 05 82 02 00 02 00 
numendpoint=2
endpointIn=82
endpointOut=1
packet size in (msController) = 512
packet size out (msController) = 512
polling intervalIn = 0
polling intervalOut = 0
new_Pipe
new_Pipe
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
control CallbackIn (msController)
00 00 00 00 00 00 00 00 
control CallbackIn (msController)
00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 01 00 00 00 00 00 00 00 80 00 06 1B 01 00 00 01 00 00 00 00 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 01 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 02 00 00 00 00 00 00 00 80 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 02 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 03 00 00 00 24 00 00 00 80 00 06 12 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 36
00 80 04 02 1F 00 00 00 56 65 6E 64 6F 72 43 6F 50 72 6F 64 75 63 74 43 6F 64 65 20 20 20 20 20 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 03 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 04 00 00 00 08 00 00 00 80 00 0A 25 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 8
01 D4 BF FF 00 00 02 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 04 00 00 00 00 00 00 00 00 
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 05 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
FA 33 C0 8E D0 BC 00 7C 8B F4 50 07 50 1F FB FC BF 00 06 B9 00 01 F2 A5 EA 1D 06 00 00 BE BE 07 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 05 00 00 00 00 00 00 00 00 
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 06 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 00 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
EB 5A 90 2B 6A 30 7C 38 49 48 43 00 02 10 F0 0A 02 00 00 00 00 F8 00 00 20 00 40 00 40 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 06 00 00 00 00 00 00 00 00 
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 07 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
FA 33 C0 8E D0 BC 00 7C 8B F4 50 07 50 1F FB FC BF 00 06 B9 00 01 F2 A5 EA 1D 06 00 00 BE BE 07 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 07 00 00 00 00 00 00 00 00 
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 08 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 00 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
EB 5A 90 2B 6A 30 7C 38 49 48 43 00 02 10 F0 0A 02 00 00 00 00 F8 00 00 20 00 40 00 40 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 08 00 00 00 00 00 00 00 00 
initialization done.
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 09 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 80 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
52 45 43 59 43 4C 45 52 20 20 20 12 00 96 D4 88 3A 51 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 09 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0A 00 00 00 00 02 00 00 00 00 0A 2A 00 00 00 80 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)512
52 45 43 59 43 4C 45 52 20 20 20 12 00 96 D4 88 3A 51 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0A 00 00 00 00 00 00 00 00 
Writing to test.txt...msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0B 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 0B 30 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
F8 FF FF 0F FF FF FF FF FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F 08 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0B 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0C 00 00 00 00 02 00 00 00 00 0A 2A 00 00 00 85 D0 00 00 01 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)512
74 65 73 74 69 6E 67 20 31 2C 20 32 2C 20 33 2E 0D 0A 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0C 00 00 00 00 00 00 00 00 
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0D 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 80 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
52 45 43 59 43 4C 45 52 20 20 20 12 00 96 D4 88 3A 51 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0D 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0E 00 00 00 00 02 00 00 00 00 0A 2A 00 00 00 80 40 00 00 01 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)512
52 45 43 59 43 4C 45 52 20 20 20 12 00 96 D4 88 3A 51 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0E 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 0F 00 00 00 00 02 00 00 00 00 0A 2A 00 00 00 0B 30 00 00 01 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)512
F8 FF FF 0F FF FF FF FF FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F 08 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 0F 00 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 10 00 00 00 00 02 00 00 00 00 0A 2A 00 00 00 45 B8 00 00 01 00 00 00 00 00 00 00 
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)512
F8 FF FF 0F FF FF FF FF FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F FF FF FF 0F 08 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 10 00 00 00 00 00 00 00 00 
done.
test.txt:
msReadBlocks()
msController CallbackOut (static)
transfer->qtd.token = 1
msController dataOut (static)31
55 53 42 43 11 00 00 00 00 02 00 00 80 00 0A 28 00 00 00 85 D0 00 00 01 00 00 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 512
74 65 73 74 69 6E 67 20 31 2C 20 32 2C 20 33 2E 0D 0A 3A 51 00 00 D5 88 3A 51 03 00 00 00 00 00 
msController CallbackIn (static)
transfer->qtd.token = 0
msController dataIn (static): 13
55 53 42 53 11 00 00 00 00 00 00 00 00 
testing 1, 2, 3.

I tried 3 USB sticks. One worked. Above the log for the USB stick that worked.

What are the name brands of the 3 USB sticks you are using? I see this for the one that works:
Code:
Manufacturer: [COLOR="#FF0000"]USB[/COLOR]
enumeration:
Product: Disk 2.0
enumeration:
Serial Number: 00001103230642337368
Not sure who manufactures it.
I am glad to see you have one device working:)
 
@defragster @sdharafat - I guess what I am trying to say is that there is no real way to speed up the internal processes in any particular Mass Storage device. At least as far as my understanding of this goes. I do know that all of the Mass Storage devices are NOT created equal. There are some devices that require a delay after a reset command and some that do not. There are some devices that do not follow standards as far as following USB and SCSI standards. To make MSC work with everything would probably require having a database of PID's and VID's with known parameters for initialization and usage. So what we are left with is experimentation for every device we trying to use. Eventually This could happen. But for right now it is matter of testing each device and finding where within MSC we can make it work. Functionality now speed later:)

Cannot afford to purchase every device available for testing so info on the type of device that does not work is needed.

For research:)
 
Last edited:
@wwatson - understood as inarguably reasonable - 30 sec wait should assure max connectivity for devices to start, and if they work and connect early that is no problem.

Having a device not respond properly in time and not get mounted is not useful at all especially if another couple of seconds could make it work as happens with a timeout that is too short.

The 'Eventuality' of refinement is always promising. If having a known VID_PID helps maybe it could print out a parameter set for use embedded in the code for future use.
 
FWIW, UHS 3.0 is in a basically usable state now for EHCI on teensy 3.6.
What's tested so far:
HUB, bulk storage (UHS_FS, which contains FAT32, and a driver for the SDcard, although a small modification is required for that), HID (RAW/BOOT-MOUSE/BOOT-KEYBOARD), various USB-serial and USB printers, and MIDI.

Yes, the programming model is a little bit different, however it's all extendable in your own sketch without having to modify the library. You can take the base driver classes, and simply use them as a sub-class. This means you can write drivers for an interface directly in the sketch if something does not exist, and attach it to the USB core.

Currently, I am working on a few filesystem improvements. RAM size of Teensy 3.[01256](low speed USB OTG) and 3.6 (EHCI) (4.x is next...) will be able to cache reads and writes, which increases the speeds for thumb drives. Physical hard drives already can read and write 10Mbytes in 8 to 9 seconds, but should get an enormous boost, I have to finish that part yet.
More devices are going to be supported in the coming weeks.
 
FWIW, UHS 3.0 is in a basically usable state now for EHCI on teensy 3.6.
What's tested so far:
HUB, bulk storage (UHS_FS, which contains FAT32, and a driver for the SDcard, although a small modification is required for that), HID (RAW/BOOT-MOUSE/BOOT-KEYBOARD), various USB-serial and USB printers, and MIDI.

Yes, the programming model is a little bit different, however it's all extendable in your own sketch without having to modify the library. You can take the base driver classes, and simply use them as a sub-class. This means you can write drivers for an interface directly in the sketch if something does not exist, and attach it to the USB core.

Currently, I am working on a few filesystem improvements. RAM size of Teensy 3.[01256](low speed USB OTG) and 3.6 (EHCI) (4.x is next...) will be able to cache reads and writes, which increases the speeds for thumb drives. Physical hard drives already can read and write 10Mbytes in 8 to 9 seconds, but should get an enormous boost, I have to finish that part yet.
More devices are going to be supported in the coming weeks.

I need to pull out one of my T3.6's and check this out. I played around with UHS 3.0 when you first came out with it but have not had time to keep up. Trying to keep up with MSC, SdFat, UsbFat and LittleFS has kept me busy. Will check it out:)

Edit: Could you give me a link to the latest version?
 
@wwatson
Certainly!
Now note that it will have some issues depending on the SCSI version on the USB (same is true with any Mass storage/bulk storage) in particular, thumbdrives and external drives that are using UAS with scsi version 6 (USB 3.x), but most others do end up working just fine.
Here's the URL:
https://github.com/felis/UHS30
and the URL to all of the rest of my stuff:
https://github.com/xxxajk
 
Oh one other thing, You should be able to extend UHS_FS to accommodate littleFS, and even ISO9660 if you want to use it for CD/DVD. :)
 
@xxxajk - Having troubles with RTCLib.h no such file or directory trying to compile UHS_FS_NEW_DEMO.ino. Can you refresh my memory as to which library this is? Been a long time:)
 
@xxxajk - Kept doing the clone without recursively cloning. Did it the exactly the way you said and was albe to get things to compile. The only example I was able to use was in UHS_FS/examples/UHS_KINETIS_EHCI/UHS_FS_NEW_DEMO.ino. This gave me this:
Code:
Configuring: parent = 0, port = 1, speed = 2
dispatchPkt status code 01
*** Configuring error: 0x11 Can't get USB_DEVICE_DESCRIPTOR
Anything other examples would lock up the Teensy 3.6.
Obviously I am doing something else wrong:(
I have tried several thumb drives, a USB SD car reader, and HardDrives with a StarTech USB adapter. What else am I missing?
 
@wwatson More improvements have been pushed, pull and try again.
More information can be gathered by turning on the host debugging in the sketch
 
Hi all,
I am having some issue in removing a file. I am using a SD card reader as storage. tried the example "FilesUSB.ino".
When I run it 1st time it works fine. Creates the file then removes it. But when I have used a different file for it remove, it cannot remove it.
Attached is the file I tried to remove.
Code:
Initializing USB MSC drive...initialization done.
example.txt exists.
Creating example.txt...
example.txt exists.
Removing example.txt...
example.txt exists.
 

Attachments

  • example.txt
    2.1 KB · Views: 51
@wwatson More improvements have been pushed, pull and try again.
More information can be gathered by turning on the host debugging in the sketch

I will. Probably tomorrow before I can try it. I had some of the debug turned on but not all.

Thanks:)
 
Hi all,
I am having some issue in removing a file. I am using a SD card reader as storage. tried the example "FilesUSB.ino".
When I run it 1st time it works fine. Creates the file then removes it. But when I have used a different file for it remove, it cannot remove it.
Attached is the file I tried to remove.
Code:
Initializing USB MSC drive...initialization done.
example.txt exists.
Creating example.txt...
example.txt exists.
Removing example.txt...
example.txt exists.

I actually need to see the modified "FilesUSB.ino". Not This:
Code:
-1.25,0.00,0.00,-1.87,-2.49,19200.02,19200.02,19200.02,19200.02,19200.02,19200.02,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
-1.87,-2.49,-0.62,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
-1.25,-0.62,-0.62,-2.49,-3.11,19200.02,1.88,5.04,-3.11,0.63,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
-1.25,0.00,0.00,-1.87,-2.49,19200.02,19200.02,19200.02,19200.02,19200.02,19200.02,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
-1.87,-2.49,-0.62,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
-1.25,-0.62,-0.62,-2.49,-3.11,19200.02,1.88,5.04,-3.11,0.63,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
-1.25,0.00,0.00,-1.87,-2.49,19200.02,19200.02,19200.02,19200.02,19200.02,19200.02,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
-1.87,-2.49,-0.62,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
-1.25,-0.62,-0.62,-2.49,-3.11,19200.02,1.88,5.04,-3.11,0.63,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
-1.25,0.00,0.00,-1.87,-2.49,19200.02,19200.02,19200.02,19200.02,19200.02,19200.02,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
-1.87,-2.49,-0.62,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
-1.25,-0.62,-0.62,-2.49,-3.11,19200.02,1.88,5.04,-3.11,0.63,19200.02,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,999.00,
 
I actually didn't modify the FilesUSB.ino that is in the example. Here is the code I used:
Code:
/*
  MSC USB Drive basic file example
 
 This example shows how to create and destroy an MSC USB drive file 	
 The circuit:
 
 created   Nov 2010
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe
 modified 17 Nov 2020
 by Warren Watson
 
 This example code is in the public domain.
 	 
 */
#include <mscFS.h>

// Setup USBHost_t36 and as many HUB ports as needed.
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.
msController msDrive1(myusb);
msController msDrive2(myusb);

File myFile;

void setup()
{
  
 // Open serial communications and wait for port to open:
  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...");

  if (!MSC.begin(&msDrive1)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");

  if (MSC.exists("example.txt")) {
    Serial.println("example.txt exists.");
  }
  else {
    Serial.println("example.txt doesn't exist.");
  }

  // open a new file and immediately close it:
  Serial.println("Creating example.txt...");
  myFile = MSC.open("example.txt", FILE_WRITE);
  myFile.close();

  // Check to see if the file exists: 
  if (MSC.exists("example.txt")) {
    Serial.println("example.txt exists.");
  }
  else {
    Serial.println("example.txt doesn't exist.");  
  }

  // delete the file:
  Serial.println("Removing example.txt...");
  MSC.remove("example.txt");

  if (MSC.exists("example.txt")){ 
    Serial.println("example.txt exists.");
  }
  else {
    Serial.println("example.txt doesn't exist.");  
  }
}

void loop()
{
  // nothing happens after setup finishes.
}
 
I actually didn't modify the FilesUSB.ino that is in the example. Here is the code I used:
Code:
/*
  MSC USB Drive basic file example
 
 This example shows how to create and destroy an MSC USB drive file 	
 The circuit:
 
 created   Nov 2010
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe
 modified 17 Nov 2020
 by Warren Watson
 
 This example code is in the public domain.
 	 
 */
#include <mscFS.h>

// Setup USBHost_t36 and as many HUB ports as needed.
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.
msController msDrive1(myusb);
msController msDrive2(myusb);

File myFile;

void setup()
{
  
 // Open serial communications and wait for port to open:
  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...");

  if (!MSC.begin(&msDrive1)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");

  if (MSC.exists("example.txt")) {
    Serial.println("example.txt exists.");
  }
  else {
    Serial.println("example.txt doesn't exist.");
  }

  // open a new file and immediately close it:
  Serial.println("Creating example.txt...");
  myFile = MSC.open("example.txt", FILE_WRITE);
  myFile.close();

  // Check to see if the file exists: 
  if (MSC.exists("example.txt")) {
    Serial.println("example.txt exists.");
  }
  else {
    Serial.println("example.txt doesn't exist.");  
  }

  // delete the file:
  Serial.println("Removing example.txt...");
  MSC.remove("example.txt");

  if (MSC.exists("example.txt")){ 
    Serial.println("example.txt exists.");
  }
  else {
    Serial.println("example.txt doesn't exist.");  
  }
}

void loop()
{
  // nothing happens after setup finishes.
}

I see this in your first post:
Code:
Initializing USB MSC drive...initialization done.
example.txt exists.
Creating example.txt...
example.txt exists.
Removing example.txt...
[COLOR="#FF0000"]example.txt exists.[/COLOR]
Should be:
Code:
[COLOR="#00FF00"]example.txt doesn't exist.[/COLOR]

I tried several times with your "example.txt" and it worked correctly. Not sure why it's not working on your end. Did you check to see if the file was actually deleted or not on the SD card?

Things you can do:
- Maybe try reformatting the SD card and try it again.
- If using a HUB try without using the HUB. We have had issues with some HUBs.
- Try another SDcard.
- Or if you have one try a USB Thumb stick.

I know I have asked you this before, but which version of Arduino and Teensyduino are you using and which Teensy product are you using?
 
@wwatson More improvements have been pushed, pull and try again.
More information can be gathered by turning on the host debugging in the sketch

OK, did the pull and reset for it. Here is what I am seeing now (getting closer). With these debug settings:

Code:
// enable testing output
#define EHCI_TEST_DEV
//#define LED_STATUS 1
#define DEBUG_PRINTF_EXTRA_HUGE 1
//#define DEBUG_PRINTF_EXTRA_HUGE_UHS_HOST 1
#define DEBUG_PRINTF_EXTRA_HUGE_UHS_BULK_STORAGE 1
Without the HUB:
Code:
Start.

SWI_IRQ_NUM 30


USB HOST READY.
No media. Waiting to mount /



Configuring: parent = 0, port = 1, speed = 2
$$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
$$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
USBHub: checking numep 1, klass 09, interface.klass 09, protocol 00/01-00?01
USBHub: checking numep 1, klass 09, interface.klass 09, protocol 00/01-01?01
USBHub Accepting address assignment 01



Configuring: parent = 0, port = 1, speed = 2
$$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
$$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
USBHub: checking numep 2, klass 00, interface.klass 08, protocol 50/00-00?01
BulkOnly: checking numep 2, klass 00, subklass 00
BulkOnly: checking protocol 00, interface.klass 08, interface.subklass 06
BulkOnly: checking interface.protocol 50
USBHub: checking numep 2, klass 00, interface.klass 08, protocol 50/00-01?01
BulkOnly: checking numep 2, klass 00, subklass 00
BulkOnly: checking protocol 00, interface.klass 08, interface.subklass 06
BulkOnly: checking interface.protocol 50
BS SetInterface
ep: 0x00 bmAttributes: 0x02 index: 1

ep: 0x01 bmAttributes: 0x02 index: 2

BS Start, speed: 2
BS Start
GetMaxLUN 0x00
MaxLUN 0
Inquiry 0x24 0x00
LUN 0 `KingstonDataTraveler 3.0(four vertical rectangles, seen this before????)'
Qualifier 0 Device type 00 RMB 1 SSCS 0 SCSI version 06
Device conforms to T10/1731-D (SPC-4) standards.
CheckLUN...
9142
>>>>>>>>>>>>>>>>CAPACITY OK ON LUN 0
039a33f300000200

9142
Checked LUN...
Onstart begin
BS configured

With the HUB:
Code:
Start.

SWI_IRQ_NUM 30


USB HOST READY.
No media. Waiting to mount /



Configuring: parent = 0, port = 1, speed = 2
$$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
$$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
USBHub: checking numep 1, klass 09, interface.klass 09, protocol 00/01-00?01
USBHub: checking numep 1, klass 09, interface.klass 09, protocol 00/01-01?01
USBHub Accepting address assignment 01

Now with this debug setting I get:
Code:
// enable testing output
#define EHCI_TEST_DEV
//#define LED_STATUS 1
#define DEBUG_PRINTF_EXTRA_HUGE 1
#define DEBUG_PRINTF_EXTRA_HUGE_UHS_HOST 1
#define DEBUG_PRINTF_EXTRA_HUGE_UHS_BULK_STORAGE 1

No Hub:
Code:
Start.

SWI_IRQ_NUM 30
power up EHCI PHY
init EHCI PHY & PLL
PLL locked, waited 2809
begin ehci reset
reset waited 5


USB HOST READY.
No media. Waiting to mount /
PCI Vbus state changed to 0
USB host speed now 1
PCI Vbus state changed to 3
USB host speed now f
PCI Vbus state changed to 0
USB host speed now 1
PCI Vbus state changed to 2
USB host speed now 2
ISRbottom, UHS_USB_HOST_STATE_CONFIGURING



Configuring: parent = 0, port = 1, speed = 2


Configuring PktSize 0x40,  rcode: 0x00, retries 0
SetAddress, addr=0, ep=0


********* Got UsbDevicePtr for 0x00, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

ctrlReq2: left: 64, read:64, nbytes 64
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 64, nbytes: 64, dataptr: 2002fe4c
InTransfer 64 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 18 Bytes
InTransfer done.
ctrlReqRead left: 46, read 18
RESULT: 0x00 0x00 0x12 0x0040000001000680
ctrlReq3: acceptBuffer sz 18 nbytes 64 left 46

PCI Vbus state changed to 2
USB host speed now 2
SetAddress, addr=0, ep=0


********* Got UsbDevicePtr for 0x00, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

USBHS_USBSTS_UI
$$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
DevDescr 2nd poll, bMaxPacketSize0:64
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x2002fe44
ep entry for interface 9 ep 0 max packet size = 64

ctrlReq2: left: 18, read:18, nbytes 18
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 18, nbytes: 18, dataptr: 2002fe4c
InTransfer 18 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 18 Bytes
InTransfer done.
ctrlReqRead left: 0, read 18
RESULT: 0x00 0x01 0x12 0x0012000001000680
((((((((((((((((((address 1 parent 0 
PCI Vbus state changed to 2
USB host speed now 2
SetAddress, addr=0, ep=0


********* Got UsbDevicePtr for 0x00, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

USBHS_USBSTS_UI
$$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
configs: 1
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

ctrlReq2: left: 9, read:9, nbytes 9
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 9, nbytes: 9, dataptr: 2002fe4c
InTransfer 9 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 9 Bytes
InTransfer done.
ctrlReqRead left: 0, read 9
RESULT: 0x00 0x01 0x09 0x0009000002000680
CONFIGURATION: 0, bNumInterfaces 1, wTotalLength 32
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 32, nbytes: 32, dataptr: 2002fdc8
InTransfer 32 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 32 Bytes
InTransfer done.
ctrlReqRead left: 0, read 32
bLength: 9 bDescriptorType: 02
eating 8
bLength: 9 bDescriptorType: 04
INTERFACE DESCRIPTOR FOUND
Getting 2 endpoints
bLength: 7 bDescriptorType: 05
ENDPOINT DESCRIPTOR: 0
ENDPOINT DESCRIPTOR OK
eating 0
bLength: 7 bDescriptorType: 05
ENDPOINT DESCRIPTOR: 1
ENDPOINT DESCRIPTOR OK
eating 0
eating 1
ENDPOINT DESCRIPTORS FILLED
TestInterface VID:0951 PID:1666 Class:00 Subclass:00 Protocol 00
Interface data: Class:08 Subclass:06 Protocol 06, number of endpoints 2
Parent: 00, bAddress: 01
USBHub: checking numep 2, klass 00, interface.klass 08, protocol 50/00-00?01
BulkOnly: checking numep 2, klass 00, subklass 00
BulkOnly: checking protocol 00, interface.klass 08, interface.subklass 06
BulkOnly: checking interface.protocol 50
Driver 1 supports this interface
Driver 1 can be used for this interface
USB_INTERFACE END OF STREAM
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

ctrlReq2: left: 9, read:9, nbytes 9
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 9, nbytes: 9, dataptr: 2002fe4c
InTransfer 9 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 9 Bytes
InTransfer done.
ctrlReqRead left: 0, read 9
RESULT: 0x00 0x01 0x09 0x0009000002000680
CONFIGURATION: 1, bNumInterfaces 1, wTotalLength 32
Best configuration is 1, enumerating interfaces.
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 32, nbytes: 32, dataptr: 2002fdc8
InTransfer 32 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 32 Bytes
InTransfer done.
ctrlReqRead left: 0, read 32
bLength: 9 bDescriptorType: 02
eating 8
bLength: 9 bDescriptorType: 04
INTERFACE DESCRIPTOR FOUND
Getting 2 endpoints
bLength: 7 bDescriptorType: 05
ENDPOINT DESCRIPTOR: 0
ENDPOINT DESCRIPTOR OK
eating 0
bLength: 7 bDescriptorType: 05
ENDPOINT DESCRIPTOR: 1
ENDPOINT DESCRIPTOR OK
eating 0
eating 1
ENDPOINT DESCRIPTORS FILLED
AttemptConfig: parent = 0, port = 1
USBHub: checking numep 2, klass 00, interface.klass 08, protocol 50/00-01?01
BulkOnly: checking numep 2, klass 00, subklass 00
BulkOnly: checking protocol 00, interface.klass 08, interface.subklass 06
BulkOnly: checking interface.protocol 50
Driver 1 supports this interface
BS SetInterface
ep: 0x00 bmAttributes: 0x02 index: 1

ep: 0x01 bmAttributes: 0x02 index: 2

Interface Configured
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

USBHS_USBSTS_UI
Driver 0 @ 00 Skipped
Driver 1 @ 01 Initialize
BS Start, speed: 2
BS Start
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 3 endpoints...
PEP @ 0x1fff6598
ep entry for interface 2 ep 0 max packet size = 64

ctrlReq2: left: 1, read:1, nbytes 1
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 1, nbytes: 1, dataptr: 1fff653c
InTransfer 1 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 1 Bytes
InTransfer done.
ctrlReqRead left: 0, read 1
RESULT: 0x00 0x01 0x01 0x000100000000fea1
GetMaxLUN 0x00
MaxLUN 0
outTransfer: addr: 0x01 ep: 0x02 nbytes: 0x001f data: 0x0x2002fd48
SetAddress, addr=1, ep=2


********* Got UsbDevicePtr for 0x01, scanning 3 endpoints...
PEP @ 0x1fff6598
ep entry not 0x00...
ep entry not 0x01...
ep entry for interface 0 ep 2 max packet size = 512

outTransfer: SetAddress 0x00
OutTransfer 31, NAKS:14 toggle 0
OutTransfer done.
SetAddress, addr=1, ep=1


********* Got UsbDevicePtr for 0x01, scanning 3 endpoints...
PEP @ 0x1fff6598
ep entry not 0x00...
ep entry for interface 0 ep 1 max packet size = 512

InTransfer 36 NAKS: 14
USBHS_USBSTS_UI
InTransfer Got 36 Bytes
InTransfer done.
SetAddress, addr=1, ep=1


********* Got UsbDevicePtr for 0x01, scanning 3 endpoints...
PEP @ 0x1fff6598
ep entry not 0x00...
ep entry for interface 0 ep 1 max packet size = 512

InTransfer 13 NAKS: 14
USBHS_USBSTS_UI
InTransfer Got 13 Bytes
InTransfer done.
Inquiry 0x24 0x00
LUN 0 `KingstonDataTraveler 3.0

And the spew continues....

With the HUB I get:
Code:
Start.

SWI_IRQ_NUM 30
power up EHCI PHY
init EHCI PHY & PLL
PLL locked, waited 2817
begin ehci reset
reset waited 5


USB HOST READY.
No media. Waiting to mount /
PCI Vbus state changed to 0
USB host speed now 1
PCI Vbus state changed to 3
USB host speed now f
PCI Vbus state changed to 0
USB host speed now 1
PCI Vbus state changed to 2
USB host speed now 2
ISRbottom, UHS_USB_HOST_STATE_CONFIGURING



Configuring: parent = 0, port = 1, speed = 2


Configuring PktSize 0x40,  rcode: 0x00, retries 0
SetAddress, addr=0, ep=0


********* Got UsbDevicePtr for 0x00, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

ctrlReq2: left: 64, read:64, nbytes 64
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 64, nbytes: 64, dataptr: 2002fe7c
InTransfer 64 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 18 Bytes
InTransfer done.
ctrlReqRead left: 46, read 18
RESULT: 0x00 0x00 0x12 0x0040000001000680
ctrlReq3: acceptBuffer sz 18 nbytes 64 left 46

PCI Vbus state changed to 2
USB host speed now 2
SetAddress, addr=0, ep=0


********* Got UsbDevicePtr for 0x00, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

USBHS_USBSTS_UI
$$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
DevDescr 2nd poll, bMaxPacketSize0:64
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x2002fe74
ep entry for interface 9 ep 0 max packet size = 64

ctrlReq2: left: 18, read:18, nbytes 18
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 18, nbytes: 18, dataptr: 2002fe7c
InTransfer 18 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 18 Bytes
InTransfer done.
ctrlReqRead left: 0, read 18
RESULT: 0x00 0x01 0x12 0x0012000001000680
((((((((((((((((((address 1 parent 0 
PCI Vbus state changed to 2
USB host speed now 2
SetAddress, addr=0, ep=0


********* Got UsbDevicePtr for 0x00, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

USBHS_USBSTS_UI
$$$$$$$$$$$$$$$$$$$$$$$$$ ADDRESS 1: 0 retries.
configs: 1
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

ctrlReq2: left: 9, read:9, nbytes 9
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 9, nbytes: 9, dataptr: 2002fe7c
InTransfer 9 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 9 Bytes
InTransfer done.
ctrlReqRead left: 0, read 9
RESULT: 0x00 0x01 0x09 0x0009000002000680
CONFIGURATION: 0, bNumInterfaces 1, wTotalLength 25
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 25, nbytes: 25, dataptr: 2002fdf8
InTransfer 25 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 25 Bytes
InTransfer done.
ctrlReqRead left: 0, read 25
bLength: 9 bDescriptorType: 02
eating 8
bLength: 9 bDescriptorType: 04
INTERFACE DESCRIPTOR FOUND
Getting 1 endpoints
bLength: 7 bDescriptorType: 05
ENDPOINT DESCRIPTOR: 0
ENDPOINT DESCRIPTOR OK
eating 0
eating 1
ENDPOINT DESCRIPTORS FILLED
TestInterface VID:05e3 PID:0608 Class:09 Subclass:00 Protocol 01
Interface data: Class:09 Subclass:00 Protocol 00, number of endpoints 1
Parent: 00, bAddress: 01
USBHub: checking numep 1, klass 09, interface.klass 09, protocol 00/01-00?01
Driver 0 supports this interface
Driver 0 can be used for this interface
USB_INTERFACE END OF STREAM
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

ctrlReq2: left: 9, read:9, nbytes 9
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 9, nbytes: 9, dataptr: 2002fe7c
InTransfer 9 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 9 Bytes
InTransfer done.
ctrlReqRead left: 0, read 9
RESULT: 0x00 0x01 0x09 0x0009000002000680
CONFIGURATION: 1, bNumInterfaces 1, wTotalLength 25
Best configuration is 1, enumerating interfaces.
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 25, nbytes: 25, dataptr: 2002fdf8
InTransfer 25 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 25 Bytes
InTransfer done.
ctrlReqRead left: 0, read 25
bLength: 9 bDescriptorType: 02
eating 8
bLength: 9 bDescriptorType: 04
INTERFACE DESCRIPTOR FOUND
Getting 1 endpoints
bLength: 7 bDescriptorType: 05
ENDPOINT DESCRIPTOR: 0
ENDPOINT DESCRIPTOR OK
eating 0
eating 1
ENDPOINT DESCRIPTORS FILLED
AttemptConfig: parent = 0, port = 1
USBHub: checking numep 1, klass 09, interface.klass 09, protocol 00/01-01?01
Driver 0 supports this interface
USBHub Accepting address assignment 01
Interface Configured
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

USBHS_USBSTS_UI
Driver 0 @ 01 Initialize
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

ctrlReq2: left: 3, read:3, nbytes 3
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 3, nbytes: 3, dataptr: 2002fdfc
InTransfer 3 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 3 Bytes
InTransfer done.
ctrlReqRead left: 0, read 3
RESULT: 0x00 0x01 0x03 0x00030000290006a0
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

ctrlReq2: left: 9, read:9, nbytes 9
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 9, nbytes: 9, dataptr: 2002fde8
InTransfer 9 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 9 Bytes
InTransfer done.
ctrlReqRead left: 0, read 9
RESULT: 0x00 0x01 0x09 0x00090000290006a0
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

USBHS_USBSTS_UI
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 1 endpoints...
PEP @ 0x1fff1384
ep entry for interface 0 ep 0 max packet size = 64

ctrlReq2: left: 2, read:2, nbytes 2
*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*& ctrlReqRead left: 2, nbytes: 2, dataptr: 2002fde8
InTransfer 2 NAKS: 0
USBHS_USBSTS_UI
InTransfer Got 2 Bytes
InTransfer done.
ctrlReqRead left: 0, read 2
RESULT: 0x00 0x01 0x02 0x0002000000000080
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 2 endpoints...
PEP @ 0x1fff59bb
ep entry for interface 0 ep 0 max packet size = 64

USBHS_USBSTS_UI
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 2 endpoints...
PEP @ 0x1fff59bb
ep entry for interface 0 ep 0 max packet size = 64

USBHS_USBSTS_UI
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 2 endpoints...
PEP @ 0x1fff59bb
ep entry for interface 0 ep 0 max packet size = 64

USBHS_USBSTS_UI
SetAddress, addr=1, ep=0


********* Got UsbDevicePtr for 0x01, scanning 2 endpoints...
PEP @ 0x1fff59bb
ep entry for interface 0 ep 0 max packet size = 64

USBHS_USBSTS_UI
SetAddress, addr=1, ep=0

And again it continues but does not seem to get past the inquiry phase.
The inquiry phase is seeing the thumb drive.
 
Back
Top