USB Host: errors "Bad transfer status 1: CHECK_ADDR" and "[0:0] CHECK_ADDR FAILED"

sraposo
Posts: 31
Joined: Mon Dec 14, 2020 4:42 pm

USB Host: errors "Bad transfer status 1: CHECK_ADDR" and "[0:0] CHECK_ADDR FAILED"

Postby sraposo » Wed Feb 12, 2025 2:41 pm

SoC: ESP32-S3

IDE: ESP-IDF 5.40

Program based on Espressiff's hid host library to accept entries from a USB keyboard. A Tanaka Masayuki's code to deal with HID HOST is also included.

Problem: two different wired USB keyboard with no brand are NOT detect after a hot reset, while an wireless USB keyboard is ALWAYS detected (and enumerated). Both types of keyboards are fully operational when connected to a PC running Windows 10. If any of these two types of keyboard is plugged, they are detected and enumerated.

Using DEBUG log level, the messages are (Error messages were intentionally indented):
(...)
D (2540) HUB: Root port reset
D (2540) HUB: Device tree node (uid=1): new
D (2540) ENUM: [0:0] Start processing, device address 0
D (2540) HUB: Root port reset
D (2540) HUB: Root port reset
D (2540) HUB: Device tree node (uid=1): new
D (2540) ENUM: [0:0] Start processing, device address 0
D (2540) ENUM: [0:0] GET_SHORT_DEV_DESC OK
D (2540) USBH: Processing actions 0x4
D (2540) USBH: Default pipe device 0
D (2550) ENUM: [0:0] CHECK_SHORT_DEV_DESC OK
D (2570) ENUM: [0:0] SECOND_RESET OK
D (2570) ENUM: [0:0] SECOND_RESET_COMPLETE OK
D (2570) ENUM: [0:0] SET_ADDR OK
E (2570) USBH: Dev 0 EP 0 Error
D (2680) USBH: Processing actions 0xe
D (2680) USBH: Default pipe device 0
E (2680) ENUM: Bad transfer status 1: CHECK_ADDR
E (2680) ENUM: [0:0] CHECK_ADDR FAILED
D (2680) ENUM: [0:0] CANCEL OK
D (2680) HUB: Disabling root port

The first error originates at USBH.C file, at \esp\v5.4\esp-idf\components\usb folder, due a "HCD_PIPE_EVENT_ERROR_XFER" error.

Additional info: problem stops if Verbose mode is active. If log mode is less wordy, problem arises. A modified USBH.C file to prompt several points in the code also makes the problem to stop. So, it suggests some timing issue, but I could not identify the reason yet.

Menuconfig/Hub Driver Configuration/Root Port configuration parameters, either greater or lower the default ones have not get rid of the problem. The only effect noticed when using greater values was a greater time to show the error.

Maybe the two wires keyboards require some particular delay and/or retry during the detection stage and the Espressif's HOST HID library and/or the libraries it depends on do not treat this properly. @ESP_Sprite

This issue has been taking me several weeks and several approaches and experiments were done.

I'd appreciate any help.










This topic is a kind of specific derivative of the one at viewtopic.php?f=13&t=44172

Who is online

Users browsing this forum: Google [Bot] and 134 guests