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

Thread: Windows GET_DESCRIPTOR won't accept > 255 bytes?

  1. #1
    Junior Member
    Join Date
    Sep 2018
    Posts
    15

    Windows GET_DESCRIPTOR won't accept > 255 bytes?

    Howdy forum.

    I am using the teensy audio usb descriptors as an example for implementing a usb audio class device on the arduino zero.

    I ran into a puzzling issue while creating a USB device descriptor, and sending it to the host machine.

    The host machine during enumeration, asks in a setup packet for the Configuration Descriptor (0x02). I have the MCU responding with my configuration descriptor, which, when I implement the USB speaker device, it works fine :-)

    But unfortunately when I add the microphone terminals, I end up with an error in the device manager that the Get Configuration Descriptor failed.

    I believe the reason is because my USB configuration descriptor with the microphone enabled, is greater than 255 bytes!

    I found a document from microsoft that explains, "For compatibility reasons the configuration descriptor request will specify a length of 255 bytes.", but it does not explain why.

    I have ensured that there are no buffer overflows on my device side, and that I indeed should be sending the entire descriptor.

    Now where I am puzzled, is how can I work around this bug?

    The teensy device descriptor is absolutely huge when everything is enabled --far greater than 255 bytes.

    Surely there must be a way to do it, but I am puzzled :-)

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,679
    Any way we could talk you into just using Teensy, rather than Arduino Zero?

  3. #3
    Junior Member
    Join Date
    Sep 2018
    Posts
    15
    I strongly considered it, but for this project, it looks like I would need to heavily modify the teensy core scripts to re-purpose some of the timers, interrupts, and DMA, and to further hack things in other parts to get byte-perfect HID descriptors. The time it would take to do this and port over existing code, is likely more trouble than it is worth. I am working on a VR library that I would like to share in the future, but I would rather not have to fork teensy core to do it

    I have used the teensy for past projects though, and very much like it! I'tll be even more awesome if teensy 3.3 breaks out the serial wire debug pins on the bottom of the board

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,679
    Maybe there are ways to override some of that stuff. The timers can be used pretty much any way. Likewise for interrupts, if you need to commandeer one of the few interrupts the code lib uses, you can with attachInterruptVector().

    There's a reason all the audio stuff has never been ported to Teensy LC. Cortex-M0+ at only 48 MHz and its much simpler bus structure is woefully underpowered for this sort of audio processing. Even if you get the USB stuff solved, I'm pretty sure you're going to find working with audio quite difficult on Cortex-M0+.

    Teensy 3.2, 3.5 or 3.6, or even Arduino Due (but of course I'd suggest Teensy), would be a much better choice.

  5. #5
    Junior Member
    Join Date
    Sep 2018
    Posts
    15
    I'm going to give the teensy another shot Paul, I managed to get it compiling in atmel studio, with the core as a component of the project so it's easy to refactor.

    It is likely I will have to modify the core, but maybe it can be done so in such a way as to add useful features to the mainline.

    Let's close out this thread --the questions I have now are of a different topic :-)

Posting Permissions

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