-
Notifications
You must be signed in to change notification settings - Fork 7.6k
ESP32 {S2, S3} CDC and HID stall when using simultaneously #10307
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
Your Platformio setup is mixing versions. Bad idea. If you want to use core 3.0.4 with Platformio you should consider using pioarduino. https://github.com/pioarduino/platform-espressif32 |
Ideally I would want to use core version 2.x due to library compatibility |
Development is done with actual core. So if anything is not working with core 2.0.x as wanted/expected it will not be changed/fixed in core 2.0.x. |
Can you tell me where the versions are mixed? I've checked the platformio file and it only references espressif32, see |
But that's a completely different project!? |
So you are using core 2.0.x. Not core 3.0.4 as you wrote in the issue template. |
No. The issue happens on core 3 too. Please try the toy example from the top. |
We have found a couple problems with the TinyUSB version/commit used within the ESP32 Arduino Core. It will take some time to fix. This issue will be kept in the list to be tested. |
@ChrGri - Could you please test it using Arduino 3.0.0-RC1 version? This uses the last stable TinyUSB version that I have found. |
Tried it, but it won't even compile What am I doing wrong? |
Did you remove the packages, platforms and cache folder from your .platformio directory? Edit: |
Thank you, I tried with |
This setup
is mixing different source and libs. Result will be unpredictable
|
@Jason2866 HID_CDC_stall.mp4 |
So this issue is known since a few months and hasn't been fixed. Any hints on how I can approach the fix myself? BR |
I've disabled CDC in the script and connected both USB ports (USB-OTG + USB-UART-bridge via CH343) to the PC. The serial output stalls randomly even with the CH343 output, see video: I'm not sure if this still is a TinyUSB related issue. |
A small example where the issue happens would be good for bug hunting. |
Hello @Jason2866, the "small example" is referenced in the first message, see "The steps to reproduce this issue:" |
@ChrGri Thx, overlooked. Is there a possibility to test when not using Windows? Dont use Windows and afaik most developers here don't use too. |
@Jason2866 I've tried it on Windows 11 and Mac M1. On both machines the serial output (from CH343) stalls after a few cycles. Adding ============================================================================== 2.mp4============================================================================== |
@Jason2866 The UART serial output is caused by a missing |
I am experiencing this same issue, not using TinyUSB but using schnoog/Joystick_ESP32S2@^0.9.4 instead.
my platformio.ini is much simpler
HID works find on it's own, CDC Serial works find on it own. only way to get it back is to reboot the device. My Serial device (output from DCS-BIOS) is a large amount of simulator data at 250K baud. I was going to try tinyUSB thinking it would be a better solution but since this is happening in more than one packing doing HID devices, I would tend to believe the issue is not Joystick_ESP32S2 nor is it tinyUSB either |
One thing I just tried was the not send HID messages with every button press but to do it one time in loop() |
I experience the same problem on ESP32-S2 with this code. CDC + HID works for a short time, then it stalls. Disabling CDC makes HID work flawlessly. Tested on Linux. |
Board
ESP32 S3 dev and S2 mini
Device Description
Hardware Configuration
USB-OTG port used
Version
latest master (checkout manually)
IDE Name
PlatformIO
Operating System
Win 11
Flash frequency
PSRAM enabled
yes
Upload speed
Description
This issue was found during investigation of this ticket. I've opened this ticket, to clean up the issue tracking.
The issue is, that when sending signals over CDC (serial data) and HID (game controller output) at the same time, at least one of the channels will stall after a while and therefore isn't sending data to the PC anymore.
The steps to reproduce this issue:
https://github.com/ChrGri/DIY-Sim-Racing-FFB-Pedal/tree/develop/Validation/Joystick_Serial_test
https://github.com/ChrGri/DIY-Sim-Racing-FFB-Pedal/blob/e2798eca295c65b02d2448eeabd65c69a27d08bd/Validation/Joystick_Serial_test/src/Joystick_Serial_test.ino#L54
The expected behaviour is that CDC and HID output streams are stable and don't collapse.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: