-
Notifications
You must be signed in to change notification settings - Fork 148
Wireless mouse leads to core hang up / How to enable logging #527
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
Comments
There is a few update to pio-usb which isn't released yet, make sure
|
Hi, I’m experiencing a very similar issue where the core hangs after a few minutes. Observation: |
Update:
Unfortunately it did not help :( The logs are quite verbose (with The fact that it happens so inconsistently and I cannot correlate it to anything makes the troubleshooting process quite uncomfortable. If anyone has any idea of how it can be fixed please let me know, I'm planning to try another board to see if it's gonna be any better there. |
use CFG_TUSB_DEBUG=2, then uncomment to have CFG_TUD_LOG_LEVEL=3, https://github.com/adafruit/Adafruit_TinyUSB_Arduino/blob/master/src/arduino/ports/rp2040/tusb_config_rp2040.h#L72 that would disable device stack log. Which make thing easier to follow the host stack. |
Operating System
Linux
Arduino IDE version
2.3.6
Board
Adafruit Feather RP2040 with USB Type A Host
ArduinoCore version
4.5.3 (not sure)
TinyUSB Library version
3.4.4
Sketch as ATTACHED TXT
I used some examples from here: https://github.com/adafruit/Adafruit_TinyUSB_Arduino/blob/master/examples/DualRole/HID/hid_mouse_tremor_filter/hid_mouse_tremor_filter.ino
I did slight modifications: I added
HEARTBEAT
logging, but code behaves the same way without this changes, I also tried other examples it always behaves the same.Compiled Log as ATTACHED TXT
What happened ?
Disclaimer: I started a topic on the forum: https://forums.adafruit.com/viewtopic.php?p=1055930#p1055930 but it was a bit fruitless (pun intended).
All context info I have (I'll share more if needed):
I connect a wireless mouse with dongle to a board (USB A) while the board connected to a laptop (or PC it did not matter) over USB C.
Everything works as expected, I can move mouse over screen for some time (1 - 5 minutes), then it stops, the board apparently stops receiving HID reports (if I can trust Serial.printf logging) and it does not react on any mouse movement and even plugging unplugging the dongle (I don't get mount / unmount messages).
...then I did more investigating)...
I added 2
heartbeat
serial logs like so:Which resulted in this log:
Which I understand as either the core 1 (the one that handles USB host) "crashes" (I'm not sure if it applicable or possible) or goes into infinite loop. So it makes sense that the board does not react to mouse anymore.
...(then I did more digging)...
I used 120 MHz CPU clock at first and it lasts a couple of minutes and then randomly stops working.
I tried 240 MHz clock and it much better, it would last 30 minutes without a problem but then it stops working again.
I also tried 10ms timeout in
task()
, likeIt might have had a good effect (mouse was responsive for longer period of time, around 5 minutes instead of 2), but it might have been an measurement error. (these hangups feel really random and not consistent)
All mice work without any issues with regular PC's of course.
How to reproduce ?
Debug Log
I actually could not enable TinyUSB internal logging, it possibly would really helpful to see if there are any messages leading to the issue. I would appreciate any advice on how to enable the logs.
I use Arduino IDE 2.3.6 on Linux + Adafruit board and Adafruit_TinyUSB, I tried editing
~/.arduino15/packages/rp2040/hardware/rp2040/4.5.3/platform.txt
, and addingCFG_TUSB_DEBUG=3
:I tried
#define CFG_TUSB_DEBUG=3
at the top of the sketch source code and some other things but I cannot see any logs. I also noticed that TinyUSB uses Serial1 for logging (I might be completely wrong though) and I triedSERIAL_TUSB_DEBUG=Serial
but it did not work neither.So if someone can help me turn with that it would be great.
Screenshots
No response
The text was updated successfully, but these errors were encountered: