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

Thread: An easy way to get Serial with HID?

  1. #1
    Senior Member
    Join Date
    Dec 2014
    Posts
    253

    An easy way to get Serial with HID?

    Because the Linux USB serial driver keeps wedging on high data amounts, I'm using HID to send/receive data to the Teensy. This is not wedging, so yay!
    But, I'd like to also use the serial port for smaller debug data type stuff.
    Is there an easy way to get HID + Serial on the Teensy 3.2? The default project settings don't have an option like that, but perhaps there's some simple config file change that will enable this?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    You could try editing usb_desc.h. See the comments in that file for instructions.

    What specifically does "wedging" mean?

  3. #3
    Senior Member
    Join Date
    Dec 2014
    Posts
    253
    Wedging typically means stopping reading/writing data, or being very intermittent about how much it reads/writes.

    As I increase throughput on USB serial on Linux, I end up running into this. It's been happening for years, with more than one kind of device (for example, LUFA on ATMega32u4, as well as Teensy 3, as well as OpenCM 9.04 which is a STM ARM.) And it's happened with several different code bases, that just open the device, and makes it raw using <termios.h>

    It may, of course, be something I'm doing wrong on the Linux side, in several different code bases, against several different devices. Perhaps something about flow control? Never been able to figure it out.
    I also don't have a good setup to do USB bus analysis at the electrical/packet level; maybe that would let me see what's going on. (Is there a plugin for Saleae that does this?)
    But I don't get that problem using HID (or, for LUFA, raw bulk,) so I just use that!

  4. #4
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    442
    Quote Originally Posted by jwatte View Post
    Is there a plugin for Saleae that does this?!
    Yes there is (look for USB LS and FS in 'More Analyzers'). Unfortunately it is a bit unstable and often detects error packets if they are perfectly ok. But it is definitely better than nothing.

    Trace 6/7
    Click image for larger version. 

Name:	usb.jpg 
Views:	47 
Size:	85.3 KB 
ID:	11833

  5. #5
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,891
    Which pins do you hook up the Logic Analyzer to for these pin... Obviously seeing some USB information for the USB host code might be beneficial.

  6. #6
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    442
    Obviously seeing some USB information for the USB host code might be beneficial.
    Yes, it definitely is! I'm currently programming the MAX3241 on a USB Host shield and I felt somehow blind before I found that the Saleae has that analyzer :-)) Just connect it to D+ and D-.
    Last edited by luni; 10-19-2017 at 06:15 PM.

  7. #7
    Senior Member
    Join Date
    Dec 2014
    Posts
    253
    Oh, nice! I have to try that out.

Posting Permissions

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