Skip to content

Update tinyusb to fix gamepad;add HID OUT interface descriptor #2185

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

Merged
merged 2 commits into from
Oct 3, 2019

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Oct 1, 2019

Fixes #1696.

  • Needed to update tinyusb to bring in HID fixes necessary for gamepad to work on XAC controller.
  • Added HID OUT interface descriptor to match many existing devices. Not yet supported by CircuitPython libraries.

To use the XAC-compatible gamepad descriptor, add a line like this to, say, ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk:

USB_HID_DEVICES=XAC_COMPATIBLE_GAMEPAD

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Code looks ok. CI failed because STM files got shuffled around in the TinyUSB update.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Oct 3, 2019

@hierophect Note the change in 463415a. Now tinyusb distinguishes which STM32 USB device to support based on the origin (IP) of the USB device. In this case, synopsys.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Oct 3, 2019

@tannewt I fixed stm builds.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Great! Thank you!

@tannewt tannewt merged commit 6827354 into adafruit:master Oct 3, 2019
@dhalbert dhalbert deleted the xac-gamepad-fixes branch October 3, 2019 19:46
@hierophect
Copy link
Collaborator

hierophect commented Oct 7, 2019

@dhalbert @tannewt Sadly, this has broken USB on the STM32F412, by excessively restricting the FS endpoints on that device. Also testing F411 which may suffer from the same issue. There are 6 FS endpoints on the F412, should be enough to support all circuitpython devices. Specific error:

0x0804a8aa in dcd_edpt_open (rhport=0 '\000', desc_edpt=0x8068862 <usb_desc_cfg+194>) at ../../lib/tinyusb/src/portable/st/synopsys/dcd_synopsys.c:273
273	  TU_ASSERT(epnum < EP_MAX);

@hierophect
Copy link
Collaborator

hierophect commented Oct 7, 2019

Has something to do with the endpoint count. Could you loop me in as a reviewer next time you push an ST update? I'd like to help out with testing to help prevent issues like this. I didn't realize from the mention that this changed anything other than file names.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Oct 7, 2019

@hierophect Sorry about this. Is this due to the OUT endpoint for HID? I thought this would not be an issue because it's the OUT half of an endpoint pair.

@hierophect
Copy link
Collaborator

hierophect commented Oct 7, 2019

@dhalbert if you gave it a different index, probably - that would be similar to the doubled CDC index causing the same issue in the past. you didn't, though. Endpoint pairs should not count. So I think this is a tinyusb update error relating to the incrementation of epnum.

@hierophect
Copy link
Collaborator

@dhalbert My fix at the moment, by the way, is simply increasing the number of endpoints allowed by 1, and everything is working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XBox Adaptive Controller needs custom HID Descriptor & tweaks
3 participants