USBHost_t36 HUB issue on power up with T4.x connected.

Status
Not open for further replies.

wwatson

Well-known member
I am having a minor issue with MSC and USB thumb drives on power up. When I have a T4.x connected to a PC USB port and power up the PC the T4.x will not complete the initialization process. Here is the response:
Code:
USB2 PLL running
 reset waited 6
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 2000E000
periodictable = 2000E000
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 09 00 01 40 E3 05 08 06 63 77 00 01 00 01 
    VendorID = 05E3, ProductID = 0608, Version = 7763
    Class/Subclass/Protocol = 9(Hub) / 0 / 1(Single-TT)
    Number of Configurations = 1
enumeration:
enumeration:
Product: USB2.0 Hub
enumeration:
Config data length = 25
enumeration:
Configuration Descriptor:
  09 02 19 00 01 01 00 E0 32 
    NumInterfaces = 1
    ConfigurationValue = 1
  09 04 00 00 01 09 00 00 00 
    Interface = 0
    Number of endpoints = 1
    Class/Subclass/Protocol = 9(Hub) / 0 / 0
  07 05 81 03 01 00 0C 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 1
    Polling Interval = 12
enumeration:
USBHub memory usage = 960
USBHub claim_device this=200034C0
found possible interface, altsetting=0
number of interfaces found = 1
USBHub control callback
09 29 04 E0 00 32 64 00 FF 00 00 00 00 00 00 00 
Hub ports = 4
USBHub control callback
USBHub control callback
USBHub control callback
USBHub control callback
power turned on to all ports
device addr = 1
new_Pipe
allocate_interrupt_pipe_bandwidth
  ep interval = 12
  interval = 256
 best_bandwidth = 2, at offset = 0
pipe cap1 = F0012101
HUB Callback (member)
status = 2
getstatus, port = 1
USBHub control callback
01 01 01 00 
New Port Status
  status=10101  port=1
  state=0
  Device is present: 
  Has Power
USBHub control callback
Port Status Cleared, port=1
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=2
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=3
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=4
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=5
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=6
  Device is present: 
  Has Power
sending reset
send_setreset
USBHub control callback
unhandled setup, message = 40323
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 0
HUB Callback (member)
status = 2
getstatus, port = 1
USBHub control callback
03 05 10 00 
New Port Status
  status=100503  port=1
  state=7
  Device is present: 
  Enabled, speed = 480 Mbit/sec
  Has Power
USBHub control callback
unhandled setup, message = 140123
timer event (29999 us): Hello, I'm resettimer, this = 200034C0, timer = 200037F4
port_doing_reset = 1
PORT_RECOVERY
new_Device: 480 Mbit/sec
new_Pipe
HUB Callback (member)
status = 2
getstatus, port = 1
USBHub control callback
00 01 01 00 
New Port Status
  status=10100  port=1
  state=9
  Has Power
disconnect_Device:
USBDriver (available_drivers) list: 2000B880 -> 2000BC40 -> 20003100 -> 2000C660 -> 2000C280
USBDriver (dev->drivers) list: (empty
USBDriver (available_drivers) list: 2000B880 -> 2000BC40 -> 20003100 -> 2000C660 -> 2000C280
delete_Pipe 2000C300
  remove QH from async schedule
  Free transfers
    * 536929472 * remove * free
    * 536929536
    * 536929408 * remove * defer free until QH
    * 536922080
  Free transfers attached to QH
    * 536929536
    * 536929408
    * 536921088
* Delete Pipe completed
removed Device_t from devlist
USBHub control callback
Port Status Cleared, port=1
HUB Callback (member)
status = 2
getstatus, port = 1
USBHub control callback
01 01 01 00 
New Port Status
  status=10101  port=1
  state=1
  Device is present: 
  Has Power
USBHub control callback
Port Status Cleared, port=1
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=2
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=3
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=4
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=5
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=6
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=6
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=6
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=6
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=6
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=6
  Device is present: 
  Has Power
And just keeps repeating the USBHub control callback...

The USBHub control callback just keeps repeating as seen above.

While the the PC is still powered I unplug the USB cable for the T4.x and plug it back in and get this:
Code:
USB2 PLL running
 reset waited 6
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 2000E000
periodictable = 2000E000
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 09 00 01 40 E3 05 08 06 63 77 00 01 00 01 
    VendorID = 05E3, ProductID = 0608, Version = 7763
    Class/Subclass/Protocol = 9(Hub) / 0 / 1(Single-TT)
    Number of Configurations = 1
enumeration:
enumeration:
Product: USB2.0 Hub
enumeration:
Config data length = 25
enumeration:
Configuration Descriptor:
  09 02 19 00 01 01 00 E0 32 
    NumInterfaces = 1
    ConfigurationValue = 1
  09 04 00 00 01 09 00 00 00 
    Interface = 0
    Number of endpoints = 1
    Class/Subclass/Protocol = 9(Hub) / 0 / 0
  07 05 81 03 01 00 0C 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 1
    Polling Interval = 12
enumeration:
USBHub memory usage = 960
USBHub claim_device this=200034C0
found possible interface, altsetting=0
number of interfaces found = 1
USBHub control callback
09 29 04 E0 00 32 64 00 FF 00 00 00 00 00 00 00 
Hub ports = 4
USBHub control callback
USBHub control callback
USBHub control callback
USBHub control callback
power turned on to all ports
device addr = 1
new_Pipe
allocate_interrupt_pipe_bandwidth
  ep interval = 12
  interval = 256
 best_bandwidth = 2, at offset = 0
pipe cap1 = F0012101
HUB Callback (member)
status = 2
getstatus, port = 1
USBHub control callback
01 01 01 00 
New Port Status
  status=10101  port=1
  state=0
  Device is present: 
  Has Power
USBHub control callback
Port Status Cleared, port=1
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=2
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=3
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=4
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=5
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=6
  Device is present: 
  Has Power
sending reset
send_setreset
USBHub control callback
unhandled setup, message = 40323
timer event (19999 us): Debounce Timer, this = 200034C0, timer = 200037D8
ports in use bitmask = 0
HUB Callback (member)
status = 2
getstatus, port = 1
USBHub control callback
03 05 10 00 
New Port Status
  status=100503  port=1
  state=7
  Device is present: 
  Enabled, speed = 480 Mbit/sec
  Has Power
USBHub control callback
unhandled setup, message = 140123
timer event (29999 us): Hello, I'm resettimer, this = 200034C0, timer = 200037F4
port_doing_reset = 1
PORT_RECOVERY
new_Device: 480 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 10 02 00 00 00 40 51 09 66 16 01 00 01 02 03 01 
    VendorID = 0951, ProductID = 1666, Version = 0001
    Class/Subclass/Protocol = 0 / 0 / 0
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: Kingston
enumeration:
Product: DataTraveler 3.0
enumeration:
Serial Number: D067E516489AF1B0B60F06F0
enumeration:
Config data length = 32
enumeration:
Configuration Descriptor:
  09 02 20 00 01 01 00 80 96 
    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 81 02 00 02 FF 
    Endpoint = 1 IN
    Type = Bulk
    Max Size = 512
    Polling Interval = 255
  07 05 02 02 00 02 FF 
    Endpoint = 2 OUT
    Type = Bulk
    Max Size = 512
    Polling Interval = 255
enumeration:
USBHub memory usage = 960
USBHub claim_device this=2000B880
USBHub memory usage = 960
USBHub claim_device this=2000BC40
USBHub memory usage = 960
USBHub claim_device this=20003100
msController claim this=2000C660
msController claim this=2000C280
Descriptor 4 = INTERFACE
msController claim this=2000C660
09 04 00 00 02 08 06 50 00 07 05 81 02 00 02 FF 07 05 02 02 00 02 FF 
numendpoint=2
endpointIn=81
endpointOut=2
packet size in (msController) = 512
packet size out (msController) = 512
polling intervalIn = 255
polling intervalOut = 255
new_Pipe
new_Pipe
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT

I have tested this with all three versions of MSC and get the same results. It only happens with USB thumb drives. The slowest USB drives I have ever seen:) All other USB drives like SSD, USB card readers and USB HDD's through a SATA to USB adapter do not seem to exhibit this condition.

This is the test sketch I am using:
Code:
#include "Arduino.h"
#include "MassStorage.h"
#include "msc.h"

USBHost myusb;
USBHub hub1(myusb);
USBHub hub2(myusb);
USBHub hub3(myusb);
USBHub hub4(myusb);

void setup() {
	while(!Serial);

	Serial.printf("Sketch to demonstrate power up problem with MSC and USBHost_t36\n");
	Serial.printf("Debug output must be uncommented in USBHost_t36.h\n");

	myusb.begin();
}

void loop() {
}

I know Paul and Robin are really busy right now with it only being the two of them that are running the show so this post is meant to be a point of reference. It just means if using thumb drives (at least in my case) you may have to power up the PC with the T4.x unplugged then plug it in after the PC is powered up. I am using Linux with the latest Arduino and TD1.52.
I have not seen this problem with USB devices like USB keyboards and USB mice.
 
Replying to my own thread because it was to late to edit it. Come to find out the problem does not happen on the T4.1. Only the T4.0.
 
The T_4.1 has the startup power control part - but if using a powered HUB (?) it seemed the hub would take care of that - if not using a powered hub and the startup power chip not there that might explain it - except for the notes on other devices especially SSD/HDD require external power ( HUB or through the SATA converter ) to work.

Working with the T_4.0 on the USBHost T_3.6 thread found it to work including USB to wired ethernet with powered HUB. The thumb drives used here worked without a hub - though the PJRC and loglow/TallDog breakout boards used both have the USBHost power control chip installed.
 
The T_4.1 has the startup power control part - but if using a powered HUB (?) it seemed the hub would take care of that - if not using a powered hub and the startup power chip not there that might explain it - except for the notes on other devices especially SSD/HDD require external power ( HUB or through the SATA converter ) to work.

Working with the T_4.0 on the USBHost T_3.6 thread found it to work including USB to wired ethernet with powered HUB. The thumb drives used here worked without a hub - though the PJRC and loglow/TallDog breakout boards used both have the USBHost power control chip installed.

I actually have not tried it with a powered HUB yet. I was using a Belkin and another no name brand HUB that works with the T4.1. The T4.0 board I was testing with was @Paul's original beta breakout board used during the T4.0 beta testing. I thought that board had the same USB Host power control chip. I will test with a powered HUB and see if the results are the same. I guess it's not an earth ending problem but I am curious as to what the actual difference is causing USBHost to fail initializing a HUB when using a USB stick drive on the T4.0 beta breakout board. I also have a T4.0 breakout board from Chris Burgess at BurgessWorld Custom Electronics with the same USB Host power control chip that exhibits the same issue.
 
I actually have not tried it with a powered HUB yet. I was using a Belkin and another no name brand HUB that works with the T4.1. The T4.0 board I was testing with was @Paul's original beta breakout board used during the T4.0 beta testing. I thought that board had the same USB Host power control chip. I will test with a powered HUB and see if the results are the same. I guess it's not an earth ending problem but I am curious as to what the actual difference is causing USBHost to fail initializing a HUB when using a USB stick drive on the T4.0 beta breakout board. I also have a T4.0 breakout board from Chris Burgess at BurgessWorld Custom Electronics with the same USB Host power control chip that exhibits the same issue.

That is odd - have used thumb drives - and SD cards in USB adapters on and off hub in T_4.0 beta with PJRC breakout. Thumb drives were the goto thing that worked without a hub IIRC - though the ethernet USB dongle was okay unless over clocked on that thread. HDD & SSD all failed without being powered by HUB or drive box adapter. Pretty sure the PRJC beta breakout does use that chip :: 1 TPS2055A USB Current Limit Switch, Digikey 296-3418-5-ND
 
That is odd - have used thumb drives - and SD cards in USB adapters on and off hub in T_4.0 beta with PJRC breakout. Thumb drives were the goto thing that worked without a hub IIRC - though the ethernet USB dongle was okay unless over clocked on that thread. HDD & SSD all failed without being powered by HUB or drive box adapter. Pretty sure the PRJC beta breakout does use that chip :: 1 TPS2055A USB Current Limit Switch, Digikey 296-3418-5-ND
It all works but on power up of a PC with thumb drive connected to a T4.0 through a HUB the T4.0 hangs in the HUB part of initialization.What you have to do is unplug the T4.0 from the PC after the PC power up and plug the T4.0 back into the PC USB port then the T4.0 will complete initialization of the T4.0 USB host port and boot up. Or plug the T4.0 into the PC after the PC has been powered up:)
 
@wwatson - not sure I ever did that - my PC's Hub always keeps Teensy's powered on/off/restart ... when on powered hub as I have it. So they never do anything if PC comes or goes.
 
Status
Not open for further replies.
Back
Top