I'm trying to implement some kind of a USB bridge using LPC55S16-EVK.
The general idea is something like:
MCU's USB HS is connected to PC1 and USB FS is connected to PC2.
I need to transfer a big file from PC1 to PC2 (up to a few hundred MB).
What is the fastest way to handle the PC1 - MCU transfer?
I tried to use the generic_hid example from the sdk, but the HID packets are too small (64B max.), and it will create a bottleneck with big files.
How can I achieve the biggest packets? I was thinking maybe 4KB.
You must use Bulk. The issue is not only the packet size but also polling interval. Interrupt xfer is bounded to 125us max for HS (1ms for FS) vs Bulk which will get to you much lower. You can easily achieve 1MB/sec on a FS connection. With HS your bandwidth will be much higher. Set your bulk EP packet size to the max (512 bytes).
Thanks for the response.
The CDC bulk transfer rate for HS I achieved is ~2.5MB/s.
Do you have a code example with a better rate?
I used the lpcxpresso55s16_dev_composite_cdc_msc_bm example, and modified the virtual com function, so it won't echo back the input data, so the echo will not create a bottleneck.
Your example is fine. The transfer rate depends on your turnaround time on buk-out data request (i.e. how fast you can service a bulk-out data request and re-prime the EP) but also how fast the host can service you.
Bulk polling is entirely host dependent .the host USB controller budgets bulk transactions based on leftover after al other transactions have been allocated. i.e. : Bulk has the last priority in bandwidth allocation. If you have other devices on the bus with interrupt / control / iso xfers then you will get slower access time.