Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: Teensy 4.1 serial host can't recognize another teensy

  1. #1
    Junior Member
    Join Date
    Jan 2022
    Posts
    3

    Teensy 4.1 serial host can't recognize another teensy

    Hi everyone,
    for a project I need to control a few different systems with the host serial of teensy.
    Among these systems I will have to be able to control another Teensy with a Hub.

    I soldered a usb connector to the USB host pins of my master teensy. And can recognize successfully some commercial USB thermometers and hubs.
    I am using the library USBHost_t36 with the exemple USBHost_t36/Test/SerialTest.ino
    If I plug a hub and my thermometer (which send the line #CT periodically before I unplug it in my test). The program recognize it without any problem.

    Code:
    USB Host Testing - Serial
    
    *** Device Hub1 1a40:101 - connected ***
      product: USB 2.0 Hub
    *** Device Hub2 1a40:101 - connected ***
      product: USB 2.0 Hub
    #CT
    
    #CT
    
    #CT
    
    *** Device USerial 483:5740 - connected ***
      manufacturer: STMicroelectronics
      product: STM32 Virtual COM Port  
      Serial: CT000
    #CT
    
    #CT
    
    #CT
    
    #CT
    
    *** Device USerial - disconnected ***



    But when I try to plug another Teensy to my USB host nothing happen. (same thing with the HUB or without).

    I digged a bit in the code and uncommented the line :
    //#define USBHOST_PRINT_DEBUG in USBHost_t36.h to get a bit more informations. When I plug the teensy I get:

    Code:
    USB Host Testing - Serial
    
    USB2 PLL running
    
     reset waited 6
    
    USBHS_ASYNCLISTADDR = 0
    
    USBHS_PERIODICLISTBASE = 20005000
    
    periodictable = 20005000
    
    port change: 10001803
    
        connect
    
    port change: 1C001002
    
        disconnect
    
    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 02 00 00 40 C0 16 83 04 80 02 01 02 03 01 
    
        VendorID = 16C0, ProductID = 0483, Version = 0280
    
        Class/Subclass/Protocol = 2 / 0 / 0
    
        Number of Configurations = 1
    
    enumeration:
    
    enumeration:
    
    Manufacturer: Teensyduino
    
    enumeration:
    
    Product: USB Serial
    
    enumeration:
    
    Serial Number: 8823250
    
    enumeration:
    
    Config data length = 67
    
    enumeration:
    
    Configuration Descriptor:
    
      09 02 43 00 02 01 00 C0 32 
    
        NumInterfaces = 2
    
        ConfigurationValue = 1
    
      09 04 00 00 01 02 02 01 00 
    
        Interface = 0
    
        Number of endpoints = 1
    
        Class/Subclass/Protocol = 2 / 2 / 1
    
      05 24 00 10 01 
    
      05 24 01 01 01 
    
      04 24 02 06 
    
      05 24 06 00 01 
    
      07 05 82 03 10 00 05 
    
        Endpoint = 2 IN
    
        Type = Interrupt
    
        Max Size = 16
    
        Polling Interval = 5
    
      09 04 01 00 02 0A 00 00 00 
    
        Interface = 1
    
        Number of endpoints = 2
    
        Class/Subclass/Protocol = 10 / 0 / 0
    
      07 05 03 02 00 02 00 
    
        Endpoint = 3 OUT
    
        Type = Bulk
    
        Max Size = 512
    
        Polling Interval = 0
    
      07 05 84 02 00 02 00 
    
        Endpoint = 4 IN
    
        Type = Bulk
    
        Max Size = 512
    
        Polling Interval = 0
    
    enumeration:
    
    USBHub memory usage = 960
    
    USBHub claim_device this=20003C40
    
    USBHub memory usage = 960
    
    USBHub claim_device this=20003880
    
    HIDParser claim this=20002C40
    
    HIDParser claim this=20003260
    
    HIDParser claim this=200046C0
    
    USBSerial claim this=20004080
    
    vid=16C0, pid=483, bDeviceClass = 2, bDeviceSubClass = 0, bDeviceProtocol = 0
    
    09 04 00 00 01 02 02 01 00 05 24 00 10 01 05 24 01 01 01 04 24 02 06 05 24 06 00 01 07 05 82 03 10 00 05 09 04 01 00 02 0A 00 00 00 07 05 03 02 00 02 00 07 05 84 02 00 02 00 
    
      Interface is Serial
    
        CS_INTERFACE - subtype: 0 10 1 - Header Functional Descriptor
    
        CS_INTERFACE - subtype: 1 1 1 - Call Management Functional
    
        CS_INTERFACE - subtype: 2 6 - Abstract Control Management
    
        CS_INTERFACE - subtype: 6 0 1  - union Functional
    
        Interface: 1
    
         Endpoint: 3
    
          tx_size = 512
    
         Endpoint: 84
    
          rx_size = 512
    
      exited loop rx:4, tx:3
    
    Descriptor 4 = INTERFACE
    
    HIDParser claim this=20002C40
    
    HIDParser claim this=20003260
    
    HIDParser claim this=200046C0
    
    USBSerial claim this=20004080
    
    vid=16C0, pid=483, bDeviceClass = 2, bDeviceSubClass = 0, bDeviceProtocol = 0
    
    09 04 00 00 01 02 02 01 00 05 24 00 10 01 05 24 01 01 01 04 24 02 06 05 24 06 00 01 07 05 82 03 10 00 05 09 04 01 00 02 0A 00 00 00 07 05 03 02 00 02 00 07 05 84 02 00 02 00 
    
    Descriptor 36 =  ???
    
    Descriptor 36 =  ???
    
    Descriptor 36 =  ???
    
    Descriptor 36 =  ???
    
    Descriptor 5 = ENDPOINT
    
    Descriptor 4 = INTERFACE
    
    HIDParser claim this=20002C40
    
    HIDParser claim this=20003260
    
    HIDParser claim this=200046C0
    
    USBSerial claim this=20004080
    
    vid=16C0, pid=483, bDeviceClass = 2, bDeviceSubClass = 0, bDeviceProtocol = 0
    
    09 04 01 00 02 0A 00 00 00 07 05 03 02 00 02 00 07 05 84 02 00 02 00 
    
    Descriptor 5 = ENDPOINT
    
    Descriptor 5 = ENDPOINT

    For comparison if I do the same with the termometer I get that:

    Code:
    USB Host Testing - Serial
    
    USB2 PLL running
    
     reset waited 6
    
    USBHS_ASYNCLISTADDR = 0
    
    USBHS_PERIODICLISTBASE = 20005000
    
    periodictable = 20005000
    
    port change: 10001803
    
        connect
    
    port change: 1C001002
    
        disconnect
    
    port change: 10001803
    
        connect
    
      begin reset
    
    port change: 10001005
    
      port enabled
    
      end recovery
    
    new_Device: 12 Mbit/sec
    
    new_Pipe
    
    enumeration:
    
    enumeration:
    
    enumeration:
    
    Device Descriptor:
    
      12 01 00 02 02 00 00 40 83 04 40 57 00 02 01 02 03 01 
    
        VendorID = 0483, ProductID = 5740, Version = 0200
    
        Class/Subclass/Protocol = 2 / 0 / 0
    
        Number of Configurations = 1
    
    enumeration:
    
    enumeration:
    
    Manufacturer: STMicroelectronics
    
    enumeration:
    
    Product: STM32 Virtual COM Port  
    
    enumeration:
    
    Serial Number: CT00001
    
    
    
    enumeration:
    
    Config data length = 67
    
    enumeration:
    
    Configuration Descriptor:
    
      09 02 43 00 02 01 00 C0 FA 
    
        NumInterfaces = 2
    
        ConfigurationValue = 1
    
      09 04 00 00 01 02 02 01 00 
    
        Interface = 0
    
        Number of endpoints = 1
    
        Class/Subclass/Protocol = 2 / 2 / 1
    
      05 24 00 10 01 
    
      05 24 01 00 01 
    
      04 24 02 02 
    
      05 24 06 00 01 
    
      07 05 82 03 08 00 FF 
    
        Endpoint = 2 IN
    
        Type = Interrupt
    
        Max Size = 8
    
        Polling Interval = 255
    
      09 04 01 00 02 0A 00 00 00 
    
        Interface = 1
    
        Number of endpoints = 2
    
        Class/Subclass/Protocol = 10 / 0 / 0
    
      07 05 03 02 40 00 00 
    
        Endpoint = 3 OUT
    
        Type = Bulk
    
        Max Size = 64
    
        Polling Interval = 0
    
      07 05 81 02 40 00 00 
    
        Endpoint = 1 IN
    
        Type = Bulk
    
        Max Size = 64
    
        Polling Interval = 0
    
    enumeration:
    
    USBHub memory usage = 960
    
    USBHub claim_device this=20003C40
    
    USBHub memory usage = 960
    
    USBHub claim_device this=20003880
    
    HIDParser claim this=20002C40
    
    HIDParser claim this=20003260
    
    HIDParser claim this=200046C0
    
    USBSerial claim this=20004080
    
    vid=483, pid=5740, bDeviceClass = 2, bDeviceSubClass = 0, bDeviceProtocol = 0
    
    09 04 00 00 01 02 02 01 00 05 24 00 10 01 05 24 01 00 01 04 24 02 02 05 24 06 00 01 07 05 82 03 08 00 FF 09 04 01 00 02 0A 00 00 00 07 05 03 02 40 00 00 07 05 81 02 40 00 00 
    
      Interface is Serial
    
        CS_INTERFACE - subtype: 0 10 1 - Header Functional Descriptor
    
        CS_INTERFACE - subtype: 1 0 1 - Call Management Functional
    
        CS_INTERFACE - subtype: 2 2 - Abstract Control Management
    
        CS_INTERFACE - subtype: 6 0 1  - union Functional
    
        Interface: 1
    
         Endpoint: 3
    
          tx_size = 64
    
         Endpoint: 81
    
          rx_size = 64
    
      exited loop rx:1, tx:3
    
      rx buffer size:196
    
      tx buffer size:196
    
    new_Pipe
    
    new_Pipe
    
    Control - CDCACM DTR...
    
    *** Device USERIAL1 483:5740 - connected ***
      manufacturer: STMicroelectronics
      product: STM32 Virtual COM Port  
      Serial: CT000
    control callback (serial) 6
    
    CDCACM setup: 00 C2 01 00 00 00 08 
    
    control callback (serial) 4
    
    Control - 0x21,0x22, 0x3
    
    control callback (serial) 0
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 3B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT
    
    rx token: 803B8100 transfer length: 64 len:5 - 23 43
    
    rx: 23 43 54 0D 0A 
    
    #CT

    It looks like some descriptors (Descriptor 36 = ???) are not recognized and the program just loop trying to get the missing informations.
    If someone has an idea how to proceed from here it would be helpful.

    Thanks

    Alex

  2. #2
    Member
    Join Date
    Feb 2020
    Location
    Dublin, Ireland
    Posts
    81
    Hi Alex,

    I'm seeing a similar problem when connecting a Teensy 4.0 programmed as a MIDI device to a T4 USB Host port. In my case the same issue doesn't occur when connecting a T3.6 to the T4 USB Host port - so my issue occurs with High Speed USB and not with Full Speed USB, as with yours (one of your debug listings gives 480 Mbits/sec, while the other gives 12 Mbits/sec).

    All the best,

    Alan

  3. #3
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    10,316
    You might try changing the example (or your sketch) from using USBSerial and instead try USBSerial_BigBuffer

    It was setup to handle at the 480 MBits and larger packet sizes

  4. #4
    Member
    Join Date
    Feb 2020
    Location
    Dublin, Ireland
    Posts
    81
    Hi,

    Adding
    USBSerial_BigBuffer userial(myusb);
    does not help with my MIDI problem (USBHost_t36 and High Speed USB MIDI messages (pjrc.com)),

    All the best,
    Alan

  5. #5
    Junior Member
    Join Date
    Jan 2022
    Posts
    3
    Hi,
    indeed changing the line:
    Code:
     USBSerial userial(myusb)
    by
    Code:
    USBSerial_BigBuffer userial(myusb)
    solved my problem.
    Thanks a lot KurtE for the help

    Alex

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •