Skip to content
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

Graceful failure when running out of HID interfaces #2996

Open
1 task done
tannewt opened this issue Feb 20, 2025 · 0 comments
Open
1 task done

Graceful failure when running out of HID interfaces #2996

tannewt opened this issue Feb 20, 2025 · 0 comments

Comments

@tannewt
Copy link
Collaborator

tannewt commented Feb 20, 2025

Operating System

Linux

Board

Fruit Jam

Firmware

CircuitPython using enhance-hub branch.

What happened ?

An assert is hit. Code would crash without it due to a null pointer.

How to reproduce ?

Plug in more HID devices than TinyUSB is configured for. It tries to open all of the HID interfaces found. If it tries to open more than it's been configured for, then it hits an assert. Instead, it should fail to open the device using the HID driver but still make it available for raw access.

Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)

I added Not enough interfaces, increase CFG_TUH_HID:

[11:37:27.481] Device configured
[11:37:27.481] Parsing Configuration descriptor (wTotalLength = 59)
[11:37:27.481] [2] HID opening Interface 0
[11:37:27.503]   Open EP 82 with Size = 8
[11:37:27.503]   HID opened
[11:37:27.503]   Bind EP 82 to driver id 0
[11:37:27.503] [2] HID opening Interface 1
[11:37:27.503] [2] Not enough interfaces, increase CFG_TUH_HID
[11:37:27.503] [1:2] Interface 1: class = 3 subclass = 1 protocol = 1 is not supported
[11:37:27.504] HID set config: itf = 0
[11:37:27.526] HID Set Idle 
[11:37:27.526] [1:2] Class Request: 21 0A 00 00 00 00 00 00 
[11:37:27.526] on EP 00 with 8 bytes: OK
[11:37:27.526] on EP 80 with 0 bytes: OK

[11:37:27.526] HID Set Protocol = 0
[11:37:27.526] [1:2] Class Request: 21 0B 00 00 00 00 00 00 
[11:37:27.526] on EP 00 with 8 bytes: OK
[11:37:27.526] on EP 80 with 0 bytes: OK

Screenshots

No response

I have checked existing issues, dicussion and documentation

  • I confirm I have checked existing issues, dicussion and documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant