cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 /F7 USB HS PHY max speed

mailmail9114
Associate II
Posted on February 10, 2016 at 11:29

Hi,

at the moment im using a STM32F3 as custom FS HID device to send 1000 64byte packets each second (64kb/s) to host pc.

i would like to increase the speed so im wondering which speed i can get with the external ulpi HS PHY on F4 and F7 eval boards with hid and perhaps cdc?

is it possible to get the maximum of three 1024 byte packets in each 125ms microframe?

thanks!
2 REPLIES 2
tsuneo
Senior
Posted on February 10, 2016 at 18:11

1) HID interrupt and default endpoints

The max tranfer speed of interrupt endpoints (IN/OUT) on high-speed HID is 512,000 bytes/sec.

64 (bytes / transaction) * 1 (transaction/micro-frame) * 8000 (micro-frame/sec) = 512,000

The packet (transaction) size greater than 64 bytes of interrupt endpoint is allowed just on alternate interface. However, built-in HID driver of major OS (Windows, Linux and MacOSX) doesn't have capability to switch to alternate interface. On default interface, 64 bytes packet is the maximum.

Over the HID default endpoint (ie. using Set_/Get_Report requests), you may get the speed near to bulk endpoint, when large-size reports are exchanged. It's because the Data stage of control transfer is scheduled almost same as bulk transfer by PC host controller.

2) CDC bulk endpoints

Theoretical max of high-speed bulk transfer is 13 full-size (512bytes) packets / micro-frame. Actual speed is limited by PC hardware performance, 8 - 11 packets / micro-frame (around 30-50M bytes/sec). OTG-HS + ULPI transceiver can trace this speed well, while

- multi-packets transfer is assigned to the endpoint register, and

- endpoint FIFO is not starved.

For example, when your frimware sets 8K bytes buffer with USBD_CDC_SetTxBuffer() and it calls USBD_CDC_TransmitPacket() in STM32Cube stack, above transfer speed is achived while this data is sent to host. If your firmware would split this data into 64 bytes chunks and it would repeatedly send each 64 bytes using USBD_CDC_SetTxBuffer()/USBD_CDC_TransmitPacket(), the transfer speed could drop down to 64 bytes/ micro-frame (= 512,000 bytes/sec). Transfer speed is proportional to the transfer size (length of USBD_CDC_SetTxBuffer()), until bus is saturated.

Tsuneo

mailmail9114
Associate II
Posted on February 11, 2016 at 08:52

great!

thanks - ill try the cdc with medium buffer size. my application will need about 5-10 Mbyte/s.

you know any windows terminal application which can handle such speed ?