xinput gamepad descriptor parsing issues #66343
Replies: 1 comment
-
@johndoe3535 Hello! Were you able to get it to work? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, right now I'm looking to port an xinput gamepad (xbox 360 gamepad) that I have working with the tinyusb stack
to zephyr. After a few hours and unsuccessfuly tries later, I hope that someone can point me in the right direction.
Down below are the descriptors
The xinput standard is missing the hid report descriptor.
Instead there is this custom vendor descriptor, see "Custom Vendor Stuff" above. Without it
the Microsoft Driver doesn't identify the device as xinput.
The Input Report itself is sent via 0x81, and the rumble and led data are received via endpoint 0x01.
When looking at the dfu class here
https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/usb/device/class/dfu/usb_dfu.c
and
https://github.com/zephyrproject-rtos/zephyr/blob/main/include/zephyr/usb/usb_ch9.h
I came up with the following structure to make the descriptors working with zephyr:
prj.conf
First I tried it with USBD_DEVICE_DESCR_DEFINE only. This works
and I can view the data with thesycon usb descriptor dumper.
However as soon as I use USBD_CLASS_DESCR_DEFINE in conjunction with USBD_DEVICE_DESCR_DEFINE
it sadly crashes the usb stack.
I tried it a 2nd time by packing my uint_8t[] arrays directly into the structs for the two macros,
with the same outcome.
My assumption is that the data which I defined as
.custom_vendor struct is in an unexpected format that can't be parsed by zephyr.
Maybe I'm also missing some other crucial parts, for correct initialization of the stack.
Does anyone have any idea?
Beta Was this translation helpful? Give feedback.
All reactions