Skip to content

ESP32S3 - HID USBHID SendReport error and USB Replug #6922

Closed
@RichardsATcn

Description

@RichardsATcn

Board

ESP32-S3-WROOM-1 Moudle

Device Description

ESP32-S3-WROOM-1

Hardware Configuration

image
only use USB ;

Version

v2.0.3

IDE Name

Arduino 1.8.19

Operating System

Windows 10

Flash frequency

QIO 80

PSRAM enabled

no

Upload speed

115200

Description

ESP32-S3-USB.zip

src.zip

USB device will appear error after using for a while.

If the CDC serial port is enabled, it will be easier to send at fixed time.

Devices will be re enumerated repeatedly

The error code segment is as follows

` bool res = ready();
if (!res)
{
log_e("not ready");
}
else
{
res = tud_hid_n_report(0, id, data, len);
if (!res)
{
log_e("report %u failed", id);
}
else
{
xSemaphoreTake(tinyusb_hid_device_input_sem, 0);
if (xSemaphoreTake(tinyusb_hid_device_input_sem, timeout_ms / portTICK_PERIOD_MS) != pdTRUE)
{
log_e("report %u wait failed", id);
res = false;
}
}
}
xSemaphoreGive(tinyusb_hid_device_input_mutex);

//Added code snippet
if (tinyusb_hid_device_input_sem)
{
xSemaphoreGive(tinyusb_hid_device_input_sem);
}
log_d("report %u wait over %s", id, res == true ? "true" : "false");
//Added code snippet

return res;`

usb设备使用一会儿会出现错误。
如果cdc串口开启定时发送时候会更容易出现。
设备会反复的 重新枚举

Sketch

//Added code snippet
    if (tinyusb_hid_device_input_sem)
    {
        xSemaphoreGive(tinyusb_hid_device_input_sem);
    }
    log_d("report %u wait over %s", id, res == true ? "true" : "false");
//Added code snippet

Debug Message

17:27:54.138 -> [ 34283][E][USBHID.cpp:410] SendReport(): report 3 wait failed
17:27:54.138 -> [ 34284][D][USBHID.cpp:420] SendReport(): report 3 wait over false
17:27:54.234 -> USB PLUGGED
17:27:54.330 -> [ 34475][E][USBHID.cpp:410] SendReport(): report 3 wait failed

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Labels

Chip: ESP32-S3Issue is related to support of ESP32-S3 ChipResolution: Awaiting responseWaiting for response of authorStatus: Needs investigationWe need to do some research before taking next steps on this issue

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions