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

Thread: Does Teensy 3.6 support virtual USB-reconnect

  1. #1
    Junior Member
    Join Date
    Mar 2017
    Posts
    3

    Does Teensy 3.6 support virtual USB-reconnect

    Hello,

    I would like to have a solution to reconfigure the USB-Parameters (Especially the Device-Descriptor) at runtime.
    To accomplish that I tried to override the parameters right in usb_dev.c an call usb_init() - diry hack, but whatever that didn't work - nothing happens.
    I heard of some Chips that support a reconfiguration of the USB-Parameters (e.g. the chip on a board called Facedancer). Basically I want that feature with the Tennsy.
    I wonder if the Teensy 3.6 does at all support that kind of feature and if I would really appreciate an advice on how to enable it and maybe even some tips on how to implement the follwing.

    My idee:
    1. start the Tennsy in NO-USB modus
    2. configure the USB-Parameters
    3. call usb_init()

    2 + 3 => virtual reconnect - it should be possible to make such a reconnect multiple times at runtime.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,518
    The software does not support this, but it certainly is possible with the hardware. You'll just have some programming work to do. Maybe you can reuse most of the existing code with only moderate hacks, but some amount of digging into the USB code would be needed. It just wasn't written to do this.

    In terms of "reconnect multiple times at runtime", this too is possible with some programming work. You'll need to disable the USB port. To your PC, it will appear as if the cable was unplugged. Then after a brief delay reinitialize it.

    Here's a direct link to the USB spec.

    https://www.pjrc.com/teensy/beta/usb20.pdf

    Even though this project doesn't involve anything really difficult, I still recommend at least skimming chapter 4. USB has a lot of very specific terminology. Knowing the right terms can help you find the right info by searching. It can also save a lot of time and avoid confusion when talking online about USB projects.

Posting Permissions

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