Skip to content

USB driver: support chunked data#201

Merged
ikskuh merged 5 commits intoZigEmbeddedGroup:mainfrom
arkadiuszwojcik:usb_chunked_data
Jun 9, 2024
Merged

USB driver: support chunked data#201
ikskuh merged 5 commits intoZigEmbeddedGroup:mainfrom
arkadiuszwojcik:usb_chunked_data

Conversation

@arkadiuszwojcik
Copy link
Contributor

This PR adds support for chunked data in the USB driver. This is especially required for configuration sections larger than the endpoint's maximum packet size.

@r4gus
Copy link
Contributor

r4gus commented Jun 6, 2024

I'll look at this as soon as I got time (probably the weekend).

Did you test this somehow? If you have used any scripts etc. for testing, it would be nice if you attach them to this thread.

@arkadiuszwojcik
Copy link
Contributor Author

I will try to put something on weekend. I have draft code for RP2040 that uses USB (CEC ADC) config so windows detect it as serial port, it required quite long config descriptor so it have to be splited in 2 packets.

@r4gus
Copy link
Contributor

r4gus commented Jun 8, 2024

If you have a working implementation you could add a minimal working project to the examples.

@arkadiuszwojcik
Copy link
Contributor Author

arkadiuszwojcik commented Jun 8, 2024

Such example require some futher changes in current API but I created for you a branch with working CDC example above changes introduced by this PR for testing purpose. By working example I mean point where serial port is discovered by host. There is hovever one issue, this handshake process is very slow (up to 15s?) I don't think this is related to this PR but to CDC config from my example. I should take a look on that today or tomorrow.

EDIT:
When I inspected packets in USBPcap initial handshake is nominal (fast), probably later on Windows expect some kind of other handshake related to CDC and this is causing some deley before Windows displays serial port in devices list.

@arkadiuszwojcik
Copy link
Contributor Author

@r4gus I just found issue responsible for that bug with long delay. My code didn't send fianal empty packet after command response. PR and example were updated. Now Serial detection from CDC example branch work instantly. This PR introduce only chunked data, CDC support require some more discussions.

@r4gus
Copy link
Contributor

r4gus commented Jun 9, 2024

@ikskuh

@ikskuh ikskuh merged commit 301ac94 into ZigEmbeddedGroup:main Jun 9, 2024
@ikskuh
Copy link
Contributor

ikskuh commented Jun 9, 2024

Wonderful, nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants