USB big transfers using composite device

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

USB big transfers using composite device

1,419件の閲覧回数
embedded_eng_
Contributor III

Hi,

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.

Thanks

ラベル(2)
タグ(4)
0 件の賞賛
返信
3 返答(返信)

1,410件の閲覧回数
belmontbob59
Contributor IV

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).

0 件の賞賛
返信

1,403件の閲覧回数
embedded_eng_
Contributor III

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.

0 件の賞賛
返信

1,381件の閲覧回数
belmontbob59
Contributor IV

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. 

0 件の賞賛
返信