-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
ESP32-S3 - Version 3.0 breaks USBHIDKeyboard LEDs events (Caps Lock, Num Lock, etc.) #10296
Comments
@SuGlider PTAL |
@TheCrypt0 can you please try with 3.1.0-RC1? We have switched the driver that TinyUSB uses internally and that might cause better behavior. |
@me-no-dev thanks, sure thing! Is there a way I can manually install the pre-release version with the latest Arduino IDE? |
@TheCrypt0 - In order to see the version 3.1.0-RC1 in the https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json |
In the mean time, I'll reproduce the issue and verify what may have changed. |
@SuGlider thanks for the input! With the 3.1.0-RC1 I get the following error when compiling:
|
This error also ocours within Arduino Core 3.0.4. |
You are right, I can now compile but the output is still as follows without any reference to CapsLock, etc.
|
This is the log with 3.0.4 and 3.1.0-RC. It seems to send the report, but it gets no report back from USB Host.
|
Yep, I can confirm sending the HID Code works, it's just the report back from the USB Host not working. |
Apparently, PR #6964 has introduced the problem into Arduno Core 3.0.x |
Investigation demonstrates that reverting PR #6954 doesn't change/solve the issue. Something else in the TinyUSB implementation may have changed. |
Just tested and I can confirm Arduino Core 3.0.0-RC1 works correctly. |
There is something different from the TinyUSB Lib from RC1 to RC2. The function |
@TheCrypt0 | @me-no-dev When I use commit https://github.com/hathach/tinyusb/commits/0877a486c to build the ESP32 Arduino libraties, it works. After 3.0.0-RC2, Lib Builder is using whatever found in @me-no-dev - I think that we shall not use I'll work on a PR for Arduino Lib Builder script https://github.com/espressif/esp32-arduino-lib-builder/blob/master/tools/update-components.sh |
Let's figure it out and report it to @hathach . I am partial about not using upstream TinyUSB |
I did some tests myself based on SuGlider's discoveries and I found 2 different issues that IMO should not be mixed. My setup for production firmware is not standard but I'll try my best to explain it. I have a platformio project running pioarduino Arduino core 3.1.0 rc1 based on IDF 5.3.0+, I use arduino as an IDF component so I had to include arduino-tinyusb as component and tinyusb repo as submodule to use the functionalities. This allows me to manually select the tinyusb commit I want to use for the project, and not be dependent on the Arduino Core version. What I found is pretty interesting. By going back to a previous commit in the tinyusb submodule (a0e5626bc5), I get the following compiling errors in USBHIDMouse:
Not a big deal, I just commented out the problematic parts and went on with the build process. What's interesting is that the code works fine and the HID reports comes back successfully, I can actually check the CapsLock, NumLock, etc. status. This is with Arduino Core 3.1.0 RC1 and tinyusb a0e5626bc5. But the problem @SuGlider noticed is still present:
This happens to my setup too, even though the other issue seems to not happen anymore. This tell me, that the issue with the NumLock, CapsLock, etc. could be tinyusb related, but the other problem might have been introduced with the latest Arduino release. I hope this helps clarify things up, if you have some other suggestion for tests please let me know! |
I don't think we have introduced either problem in Arduino. If the issue persists with our libs and 3.1.0-RC1, that means that it's not caused by the different DCD that we used. I would guess that the changes are in TinyUSB's HID module. There is a @SuGlider as far as I understand in 3.0.0-RC1 is broken the callback for the LEDs and in 3.0.0-RC2 |
All problems started with 3.0.0-RC2 forward:
When I build 3.0.4 using Hathach TinyUSB commit from nov/2023, it works fine again. ESP-IDF uses a specific working branch which is a fork from Hathach (https://github.com/espressif/tinyusb/tree/release/v0.15) . |
@hathach does any of this ring a bell? |
@me-no-dev @hathach Any news on this? |
investigation is on going this week. |
We tried to find the offending commit, but we have failed. Since @hathach is not responding here, it seems only fair to submit an issue in the TinyUSB repository and let it be handled over there. We need to stay on top of TinyUSB in order to have support for the upcoming ESP32-P4. @TheCrypt0 please file an issue in https://github.com/hathach/tinyusb |
I found a workaround. The way that output reports were sent has changed. Fix is in the PR mentioned above |
Board
ESP32-S3
Device Description
Custom ESP32-S3 keyboard but it should work on any ESP32-S3 devkit with USB connection.
Hardware Configuration
No.
Version
v3.0.4
IDE Name
Arduino IDE
Operating System
macOS 14.6.1
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
921600
Description
I'm currently building a USB keyboard using the ESP32-S3 and when upgrading to the latest Arduino Core, the reporting of LEDs (Caps Lock, Num Lock, etc.) did not happen anymore, even though the typing works. Downgrading to 2.0.13 makes the code work again.
I attached a minimum reproducible example with the expected output when the devkit is connected to a PC.
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: