Comments (4)
No. #112 is a related issue with receiving ZLPs in non-control transactions, very likely fixed by the combination of arduino/Arduino#6886 and keyboardio/Kaleidoscope-Bundle-Keyboardio#51. Note that arduino/Arduino#6886 seems to have been stalled for years due to lack of a signed CLA.
from arduinocore-avr.
Hi @tlyu. Thanks for your report! Is this the same bug that was previously reported here: #112 ?
from arduinocore-avr.
Minimal test case: With an Arduino Micro, edit the USB product string in boards.txt
to be
Arduino Micro f0123456789abcdef
which is 31 ASCII characters long, and produces a string descriptor exactly 64 bytes long. Compile and upload any sketch that enables the CDC interface (it's enabled by default, I think). That will demonstrate the bug.
I've tested the above case via manual control read on macOS of more bytes than are in the descriptor. On Windows, there is a 5-second timeout on an initial attempt to fetch the string descriptor by requesting 255 bytes. Subsequent requests for the string descriptor do provide correct lengths, and succeed.
(For a HID report descriptor, a timeout will cause Windows to ignore that HID interface, but that's harder to produce a minimal test case for.)
from arduinocore-avr.
Demo script, using the Python usb1 module (requires libusb):
import usb1
with usb1.USBContext() as uc:
# uc.setDebug(usb1.LOG_LEVEL_DEBUG)
dh = uc.openByVendorIDAndProductID(0x2341, 0x8037)
b1 = dh.controlRead(0x80, 6, 0x0302, 0, 64, 100)
print(f"requested 64 bytes, got {len(b1)}")
b2 = dh.controlRead(0x80, 6, 0x0302, 0, 255, 100)
print(f"requested 255 bytes, got {len(b2)}")
Failure output:
requested 64 bytes, got 64
Traceback (most recent call last):
File "/Users/tlyu/src/py-hid-utils/avrdesc-demo.py", line 8, in <module>
b2 = dh.controlRead(0x80, 6, 0x0302, 0, 255, 100)
File "/Users/tlyu/src/keyboardio/.venv/lib/python3.10/site-packages/usb1/__init__.py", line 1350, in controlRead
transferred = self._controlTransfer(
File "/Users/tlyu/src/keyboardio/.venv/lib/python3.10/site-packages/usb1/__init__.py", line 1307, in _controlTransfer
mayRaiseUSBError(result)
File "/Users/tlyu/src/keyboardio/.venv/lib/python3.10/site-packages/usb1/__init__.py", line 127, in mayRaiseUSBError
__raiseUSBError(value)
File "/Users/tlyu/src/keyboardio/.venv/lib/python3.10/site-packages/usb1/__init__.py", line 119, in raiseUSBError
raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorTimeout: LIBUSB_ERROR_TIMEOUT [-7]
Verbose fail log (debug logging): avrdesc-fail-long.txt
from arduinocore-avr.
Related Issues (20)
- Version 1.8.6 missing on downloads.arduino.cc, no signature for version 1.8.5 HOT 2
- GPG signatures missing for versions 1.8.5 and 1.8.6
- elf files for bootloaders HOT 1
- Add printing to NULL in the Print class? HOT 3
- UDEV rules for: Bricked Counterfeit Serial (UART) IC HOT 2
- Make your Uno Kit USB serial firmware missing ?
- How can i install it? HOT 1
- -DCDC_DISABLED not working HOT 6
- Update bootloaders HOT 4
- Wstring: getBytes() method is not clear to use with passing number of bytes to fill in buffer
- Create baseclass for HardwareSerial and SoftwareSerial HOT 1
- Stream#find does incorrect comparison HOT 1
- USB suspend not implemented
- Arduino UNO R4 and Wire library HOT 1
- Wire library read() returns 0xFF on reading only one byte HOT 2
- Arduino.h Defines Macros that Should be Functions HOT 1
- Debug optimization incorrectly set to -Os should be -O0 HOT 4
- STK600 support
- Add a function returning currently used analogRead resolution HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduinocore-avr.