PaulStoffregen / USBHost_t36

USB Host Library for Teensy 3.6 and 4.0
171 stars 87 forks source link

ListFiles.ino not working #105

Closed pr8x closed 1 year ago

pr8x commented 1 year ago

The example just gets stuck and the partition is not loaded. Output:

enumeration:
Device Descriptor:
  12 01 10 02 00 00 00 40 64 85 00 10 00 11 01 02 03 01 
    VendorID = 8564, ProductID = 1000, Version = 1100
    Class/Subclass/Protocol = 0 / 0 / 0
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: JetFlash
enumeration:
Product: Mass Storage Device
enumeration:
Serial Number: 35TYDY6K7B808GCI
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 01 02 40 00 00 
    Endpoint = 1 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
  07 05 82 02 40 00 00 
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 0
enumeration:
USBHub memory usage = 960
USBHub claim_device this=2000A1E0
USBHub memory usage = 960
USBHub claim_device this=2000A5A0
USBHub memory usage = 960
USBHub claim_device this=2000A960
USBHub memory usage = 960
USBHub claim_device this=2000AD20
USBDrive claim this=2000B0E0
Descriptor 4 = INTERFACE
USBDrive claim this=2000B0E0
09 04 00 00 02 08 06 50 00 07 05 01 02 40 00 00 07 05 82 02 40 00 00 
numendpoint=2
endpointIn=82
endpointOut=1
packet size in (USBDrive) = 64
packet size out (USBDrive) = 64
polling intervalIn = 0
polling intervalOut = 0
new_Pipe
new_Pipe
   connected = 1
   initialized = 0
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT

I forced 12 Mbit/sec by uncommenting:

//USBHS_PORTSC1 |= USBHS_PORTSC_PFSC; // force 12 Mbit/sec

I am using an external power supply to power the usb (5V), Ground is shared.

This part seems a bit odd:

new_Pipe
   connected = 1
   initialized = 0

What does the initialized = 0 mean here? @PaulStoffregen @KurtE

pr8x commented 1 year ago

Turned out I that all usb objects need to be static (I was putting them into a field). Works as intended now.