Sending feature report while waiting for report via interrupt causes tinyusb to be stuck? #285
Unanswered
elianterelle
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, so first of all, this is probably user error as i know relatively little about the usb protocol and tinyusb, maybe someone can help me here:
I have a USB Hid device (an Elgato Streamdeck) that i want to connect to an rp2040. So the rp2040 acts as a usb host.
The streamdeck sends hid reports when a button is pressed and can be controlled via feature / out reports(brightness, pixel data for the displays,...).
The first issue was, that the streamdeck seems to falsely report itself as a full-speed device with a max packet size of 512 byte, which, from what i can tell, isn't possible. I tried "fixing" this, by adding this between lines 186 and 187 of tusb.c:
after doing this, the streamdeck gets detectedt by the "hid_device_report" example and button presses are received just fine.
I now proceeded to modify this example to toggle the brightness between 0 and 100 every second by sending a feature report. This works fine, the screen toggles between on and off. Until pressing a button. The report of the button press gets received just fine, but then
tuh_hid_set_report
returns false when sending the feature report for setting the brightness and subsequent button presses aren't received until resetting the rp2040.After investigating further(as someone who doesn't know anything about usb), it seems like the transfer didn't complete, which causes the transfer stage to be stuck at something other than CONTROL_STAGE_IDLE, which is why the following feature reports can't be sent.
However i have absolutely no idea how to debug this, maybe someone can point me in the right direction, hopefully my mistake is obvious to someone who knows this a little better than me.
My Code:
Beta Was this translation helpful? Give feedback.
All reactions