i2c-star icon indicating copy to clipboard operation
i2c-star copied to clipboard

Proposal: Increase USB control buffer size

Open broth-itk opened this issue 4 years ago • 1 comments

Background:

With the original i2c-tiny-usb there was a problem with the maximum I2C transfer size. In the past I had a TPM module connected to the adapter and the linux kernel was unable to talk to it.

Anyhow, I fixed the issue with a patch in the usbtiny code (see changelog in https://dicks.home.xs4all.nl/avr/usbtiny/usbtiny-1.7.tar.gz) for details.

In i2c-star that can be accomplished much easier. My test environment uses 1024 bytes for the control buffer:

uint8_t usbd_control_buffer[1024];

This works fine. Tested with libusb-1.0 and a custom control message.

The static reply_buf will need to get adjusted as well:

static uint8_t reply_buf[1024];

Proposal: Increase control buffer size or use #define USB_CONTROL_BUFSIZE 1024

If you think it's worth the effort to provide the change via fork + pull request, please let me know.

Thanks for your great project :)

broth-itk avatar Dec 18 '20 16:12 broth-itk

Yes, this sounds useful.

daniel-thompson avatar Dec 21 '20 09:12 daniel-thompson