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
TU_ASSERT(total_len <= CFG_TUH_ENUMERATION_BUFSIZE, );
during enumeration, tinyusb will check if a config descriptor fits into the available buffer space
a usb webcam has a config descriptor over 1024 bytes, but the buffer is only 512 bytes
due to this assert, tinyusb just grinds to a halt, and stops enumerating, when it could have just left the device unconfigured and move to the next usb port
How to reproduce ?
connect something with a large config descriptor(a webcam for example) to a tinyusb host (any board/firmware should work)
@hathach but is that really effective, when you dont want to support such a device, and you can never know how big the buffer will need to be?
you always run the risk of your host-mode device breaking, because the user plugged in something with a bigger descriptor then you planned for
for context:
i want to use tinyusb on an rpi, to access MSD and keyboard
and i dont want a surprise webcam to break things, due to a fat descriptor
but if i just make it 2kb, it can still break when a bigger descriptor comes along
how big does it need to be? or should tinyusb just skip the device and avoid the problem
Operating System
Linux
Board
rpi2
Firmware
custom https://github.com/librerpi/lk-overlay/tree/master/platform/bcm28xx/dwc2 + https://github.com/librerpi/lk-overlay/tree/master/lib/tinyusb
What happened ?
TU_ASSERT(total_len <= CFG_TUH_ENUMERATION_BUFSIZE, );
during enumeration, tinyusb will check if a config descriptor fits into the available buffer space
a usb webcam has a config descriptor over 1024 bytes, but the buffer is only 512 bytes
due to this assert, tinyusb just grinds to a halt, and stops enumerating, when it could have just left the device unconfigured and move to the next usb port
How to reproduce ?
connect something with a large config descriptor(a webcam for example) to a tinyusb host (any board/firmware should work)
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
it successfully fetched the first 9 bytes of the config descriptor, noticed the size wont fit, and then gave up
Screenshots
No response
I have checked existing issues, dicussion and documentation
The text was updated successfully, but these errors were encountered: