You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom firmware with Arduino Core 3.x.x. See the issue: espressif/arduino-esp32#10296 for more details and a demo sketch.
Sketch
#include<USB.h>#include<USBCDC.h>#include<USBHIDKeyboard.h>USBHIDKeyboardm_keyboard;
USBCDCm_serial;
ESPUSB*m_usb;
staticvoidusbEventCallback(void*arg,
esp_event_base_tevent_base,
int32_tevent_id,
void*event_data)
{
if (event_base==ARDUINO_USB_EVENTS) {
arduino_usb_event_data_t*data= (arduino_usb_event_data_t*)event_data;
switch (event_id) {
caseARDUINO_USB_STARTED_EVENT:
m_serial.println("USB PLUGGED");
break;
caseARDUINO_USB_STOPPED_EVENT:
m_serial.println("USB UNPLUGGED");
break;
caseARDUINO_USB_SUSPEND_EVENT:
m_serial.printf("USB SUSPENDED: remote_wakeup_en: %u\n",
data->suspend.remote_wakeup_en);
break;
caseARDUINO_USB_RESUME_EVENT:
m_serial.println("USB RESUMED");
break;
default:
break;
}
} elseif (event_base==ARDUINO_USB_HID_EVENTS) {
arduino_usb_hid_event_data_t*data=
(arduino_usb_hid_event_data_t*)event_data;
switch (event_id) {
caseARDUINO_USB_HID_SET_PROTOCOL_EVENT:
m_serial.printf("HID SET PROTOCOL: %s\n",
data->set_protocol.protocol ? "REPORT" : "BOOT");
break;
caseARDUINO_USB_HID_SET_IDLE_EVENT:
m_serial.printf("HID SET IDLE: %u\n", data->set_idle.idle_rate);
break;
default:
break;
}
} elseif (event_base==ARDUINO_USB_HID_KEYBOARD_EVENTS) {
arduino_usb_hid_keyboard_event_data_t*data=
(arduino_usb_hid_keyboard_event_data_t*)event_data;
switch (event_id) {
caseARDUINO_USB_HID_KEYBOARD_LED_EVENT:
m_serial.printf(
"HID KEYBOARD LED: NumLock:%u, CapsLock:%u, ScrollLock:%u\n",
data->numlock,
data->capslock,
data->scrolllock);
break;
default:
break;
}
}
}
voidsetup()
{
// put your setup code here, to run once:// m_serial.begin(115200);USB.onEvent(usbEventCallback);
m_keyboard.onEvent(usbEventCallback);
m_serial.onEvent(usbEventCallback);
m_keyboard.begin();
m_serial.begin(115200);
// m_serial.enableReboot(false);m_usb=&USB; // get the USB objectm_usb->manufacturerName("TEST MAN");
m_usb->productName("TEST DEV");
m_usb->begin();
}
voidloop()
{
// put your main code here, to run repeatedly:m_serial.println("Hello World!");
delay(1000);
m_keyboard.press(KEY_CAPS_LOCK);
delay(1000);
m_keyboard.release(KEY_CAPS_LOCK);
delay(1000);
}
What happened ?
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.
We have found that the way that OUPUT reports are received has slightly changed. Actions are taken out of our end to workaround this issue. This can be closed
Operating System
MacOS
Board
ESP32-S3
Firmware
Custom firmware with Arduino Core 3.x.x. See the issue: espressif/arduino-esp32#10296 for more details and a demo sketch.
Sketch
What happened ?
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.
We tried to troubleshoot the issue with arduino-esp32's devs but it seems like it is something tinyUSB related and they suggested me to open an issue here.
How to reproduce ?
Nothing specific. Just plug in the ESP32-S3 devkit and observe the serial log.
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
Hello World!
[ 31718][E][USBHID.cpp:347] SendReport(): not ready
[ 32723][E][USBHID.cpp:347] SendReport(): not ready
Hello World!
USB UNPLUGGED
[ 34728][E][USBHID.cpp:347] SendReport(): not ready
[ 35733][E][USBHID.cpp:347] SendReport(): not ready
Hello World!
USB PLUGGED
[ 37516][V][USBHID.cpp:240] tud_hid_set_idle_cb(): instance: 0, idle_rate:0
[ 37524][V][USBHID.cpp:219] tud_hid_descriptor_report_cb(): instance: 0
[ 37531][D][USBHID.cpp:176] tinyusb_load_enabled_hid_devices(): Loaded HID Descriptor with the following reports:
[ 37541][D][USBHID.cpp:179] tinyusb_load_enabled_hid_devices(): ID: 1, Type: INPUT, Size: 8, Usage: KEYBOARD
[ 37551][D][USBHID.cpp:179] tinyusb_load_enabled_hid_devices(): ID: 1, Type: OUTPUT, Size: 1, Usage: KEYBOARD
[ 37577][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 37740][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38227][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38259][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38291][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38339][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38371][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38405][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38438][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38466][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38498][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38530][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38562][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38595][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38626][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38678][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38692][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
[ 38722][D][USBHID.cpp:270] tud_hid_set_report_cb(): instance: 0, report_id: 0, report_type: OUTPUT, bufsize: 2
Hello World!
Screenshots
No response
I have checked existing issues, dicussion and documentation
The text was updated successfully, but these errors were encountered: