Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: bump USB spec version in device descriptor to 2.0 #13078

Merged
merged 3 commits into from
Jun 6, 2021

Conversation

stapelberg
Copy link
Contributor

Description

The Teensy 4.x comes with USB 2.0 support. This change is required to make the device advertise itself as USB 2.0 in the USB device descriptor.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Copy link
Member

@drashna drashna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n

@stapelberg stapelberg changed the title core: allow setting USB version in descriptor to 2.00 from config.h core: allow setting USB version in descriptor to USB 2 from config.h Jun 5, 2021
@drashna drashna requested a review from a team June 5, 2021 14:44
@drashna
Copy link
Member

drashna commented Jun 5, 2021

Honestly, I'm not exactly happy with the name for the define, but ... I suck at naming.

Also, could this be documented in: https://github.com/qmk/qmk_firmware/blob/master/docs/config_options.md

@stapelberg
Copy link
Contributor Author

Sure. Updated the docs.

@drashna drashna removed the needs doc label Jun 5, 2021
Copy link
Member

@fauxpark fauxpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kinda wondering if this even needs a define - all of the MCUs these descriptors currently cover seem to comply with USB 2.0 FS. My previous assumption was this value had to be 1.1 because a USB 2.0 device must also provide a device qualifier descriptor, but I'm now thinking that's only if it is capable of running at high speed and full speed:

https://www.keil.com/pack/doc/mw/USB/html/_u_s_b__device__qualifier__descriptor.html

A high-speed capable device that has different device information for full-speed and high-speed must have a Device Qualifier Descriptor (USB_DEVICE_QUALIFIER_DESCRIPTOR). For example, if the device is currently operating at full-speed, the Device Qualifier returns information about how it would operate at high-speed and vice-versa.

What happens if you define this for, say, an ATmega32U4? If the Windows, macOS and Linux don't complain, I'd say just change it...

@stapelberg
Copy link
Contributor Author

What happens if you define this for, say, an ATmega32U4

Unfortunately, I don’t have an ATmega32U4 handy. Could you test it, or should we file an issue and address that separately from this change at a later point?

@fauxpark
Copy link
Member

fauxpark commented Jun 5, 2021

Just tried on my Satan, it (and/or Windows) didn't like 2, 1, 0 but 2, 0, 0 seems to work fine.
image

Some Googling around suggests that 2.10 is not a "real" value, and is what is reported when a USB 3 device is plugged into a USB 2 port. So, that may explain why Windows was confused.

@stapelberg
Copy link
Contributor Author

Some Googling around suggests that 2.10 is not a "real" value, and is what is reported when a USB 3 device is plugged into a USB 2 port. So, that may explain why Windows was confused.

Ah, yeah, https://community.osr.com/discussion/249588/where-is-the-usb-2-1-specification seems to confirm.

Changed it to 2, 0, 0.

tmk_core/protocol/usb_descriptor.c Outdated Show resolved Hide resolved
docs/config_options.md Outdated Show resolved Hide resolved
stapelberg and others added 2 commits June 5, 2021 20:33
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
@stapelberg
Copy link
Contributor Author

Done

@fauxpark fauxpark changed the title core: allow setting USB version in descriptor to USB 2 from config.h core: bump USB spec version in device descriptor to 2.0 Jun 6, 2021
@fauxpark fauxpark merged commit 7e4f01f into qmk:develop Jun 6, 2021
@stapelberg stapelberg deleted the teensy4-usb2 branch June 7, 2021 07:31
mechlovin pushed a commit to mechlovin/qmk_firmware that referenced this pull request Jul 30, 2021
mechlovin pushed a commit to mechlovin/qmk_firmware that referenced this pull request Jul 30, 2021
nhongooi pushed a commit to nhongooi/qmk_firmware that referenced this pull request Dec 5, 2021
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants