-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[RP2040] First byte of X52 Pro HID report is zero, unless CFG_TUSB_DEBUG >= 2. #1883
Comments
Well, it's not a solution at all, but if I change the main loop in my test to be: for(;;) {
tuh_task();
sleep_ms(10);
} It appears to "work" without This was after determining that the log line which seemed to affect the timing enough for things to work was in TU_LOG2(" Get Report callback (%u, %u)\r\n", dev_addr, instance); Replacing that with I haven't made much progress on figuring out what the actual problem is beyond tracing out the code-path, but it's clearly affected by the timing of the callback. A buffer or value being overwritten/cleared with the wrong timing or... something? |
|
OK tried that; exactly the same issue. Here are the log reports from the With each run I move the joystick in a way which should affect the first byte (containing part of the 10-bit X axis), but the first byte is always zero. EDIT: Removed inline logs, attached as text files to next message. Thanks for looking into it! |
please ATTACHED log as txt file for readibitly |
Sure, here you go: debug-1.txt EDIT: Here's another max debug one; plugging in the X52 Pro, taking the X/Y axes through their range, and then unplugging it. Stating the obvious but with this |
Setup : Logitech G940 ; rp2040 boards : raspberry pi pico & waveshare One ; |
This is a ShanWan (PS3) wireless controller, it configures EP 0x81 & 0x02 as 32 bytes longs, but by my calculations the HID report is 35 bytes long and I suspect those extra 3 bytes make the Pico's USB device hold the EP inactive... Normally, it crashes the Pico on these assert &| panic lines (which I've disabled for this dump, because I don't want my Pico to crash if a user plugs in such a device, and in the logging it gets a bit further): tinyusb/src/portable/raspberrypi/rp2040/hcd_rp2040.c Lines 101 to 105 in 46f7cf4
...and... tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c Lines 338 to 346 in 46f7cf4
With these lines enabled the log only gets as far as: HID has 1 reports And the Pico dies. Commenting them out, I don't actually get a report, but the Pico doesn't crash and I can unplug the wireless dongle and plug it back in to see it go through the same setup process. Something is amiss. |
@AllTinker-Lance, were you able to get this issue resolved? |
@BillPlunkett - I'm afraid not; it's pretty much stalled my project. I never found a workaround which was consistent enough to use, and not enough time/domain expertise to track down the actual issue. 😞 I'm not aware of any alternative libraries for the Pico, so I'm pretty much stuck. |
@hathach, could you please comment on this? This and some other host/hub issues seem to be stalled. |
sorry, I don't manage to have time fixing my own issues as well and therefore haven't looked at this. |
Operating System
Others
Board
RP2040-Zero
Firmware
Minimal example code which demonstrates my issue:
The content of
tusb_config.h
is:What happened ?
I'm trying to read data from USB joysticks/gamepads on the RP2040. Every other HID device I have tried has worked perfectly, except the Saitek/Logitech X52 Pro. Its HID reports are 15 bytes long, and the first byte of the report in
tuh_hid_report_received_cb
is always zero, which is not the expected result.This is where it gets pretty strange:
CFG_TUSB_DEBUG
to2
, the first byte is now reported correctly.stdio
from the UART (i.e. preventing the actual printout of the debug messages), then it again stops working, even ifCFG_TUSB_DEBUG >= 2
.Perhaps this indicates some kind of timing issue? I've been looking a bit at the TinyUSB code today, but I haven't noticed anything yet which might explain it; then again I'm not very familiar with deeper USB implementation details at present...
I have tried both
0.14.0
and the latest git commit with no change.How to reproduce ?
The X52 Pro is the only device I've found which has the issue. I'm not sure if this is due to the large(?) report size, or some other factor. I'm providing separate +5V power to the joystick itself, and everything seems fine electrically.
Running the code I posted and using an X52 Pro (or perhaps a similarly complex HID joystick) may be the only way to reproduce...
Debug Log as txt file
When working (
CFG_TUSB_DEBUG >= 2
and stdio output attached to UART), report log output is like so:When not working (
CFG_TUSB_DEBUG < 2
or stdio output detached), log output is like this:Screenshots
No response
I have checked existing issues, dicussion and documentation
The text was updated successfully, but these errors were encountered: