cancel
Showing results for 
Search instead for 
Did you mean: 

SMT32F4 USB DCD VCP - how to increase transfer speed

lauris
Associate II
Posted on June 26, 2013 at 12:42

Hello,

After some searching I was unable to find any information regarding how to increase STM USB device transfer speed running in FS CDC VCP, bulk transfer mode. In lot of posts I found about possibility to use either dual buffering or send multiple packets per frame. Question is howto do this or it should be done without any changes just using standard STM USB library?

At the current situation only changes made in my code is that VCP_DataTX() function is filling buffer with array of char until null character or buffer is filled, then returning amounts left in array which were not printed to buffer(0=all array was copied to buffer). VCP_DataTX() is used by printing function which only gives array to VCP_DataTX() and if not all data was copied to buffer, then waits for 3ms and tries to fill rest data to buffer, and keeps doing that until all array is copied.

So using this method I print to buffer multiple arrays which would overflow buffer (total size ~5.5KB of data, VCP_DataTX() handles 2KB buffer), so buffer given to DCD_EP_Tx()is almost always full. But in the end I get only about 1.3KBps speed, according to USB specifications it should be theoretically up to like 1.4MBps, and in practice it might be able to reach 1-1.2MBps.

So any ideas hints or directions where and what to do to increase that transfer speed?

than you in advance for any helpful answers.

Laurynas.

#stm32-usb-dcd-vcp-speed
1 REPLY 1
tsuneo
Senior
Posted on June 28, 2013 at 21:24

Your process description seems fine. But your result, ''I get only about 1.3KBps speed,'' suggests that your firmware sends just short transfers infrequently. To get better transfer speed, the firmware should send greater transfer size, frequently.

To confirm short transfers, monitor the traffic using a software sniffer on the host PC.

On the sniffer log, catch these clues.

a) Transfer size of each transfer

b) Transfer intervals

Which one is the cause of slow speed, a) or b) or both?

Tsuneo