cancel
Showing results for 
Search instead for 
Did you mean: 

USB CDC Virtual COM port timeout/Hang

bluevault
Associate II
Posted on February 11, 2016 at 00:23

Hello,

I have been tackling a USB issue on the STM32F373VC.

My setup consists of a STM32F373 mcu setup  as USB Virtual COM port. On the host side, commands are sent from a PC(windows7, 64 bit) via a teraterm script.

Once in a while, I get a timeout on a CDC-IN token. I've attached a screenshot of the logic analyzer showing this. Is this an issue on the firmware side or host side?

I've tried changing buffer sizes and it has no effect. Also I can see all the data make it to the host, but the terminal software is not able to see it. Does it point to an issue in the host driver from ST?

My buffers are as follows:

&sharpdefine VIRTUAL_COM_PORT_DATA_SIZE              64

&sharpdefine VIRTUAL_COM_PORT_INT_SIZE               8

&sharpdefine USART_RX_DATA_SIZE   512

#usb
2 REPLIES 2
tsuneo
Senior
Posted on February 11, 2016 at 19:13

> Is this an issue on the firmware side or host side?

Most likely, hardware problem of your MCU board.

Caused by hardware timing delay on the bus.

A) MCU clock - frequency deviation or instability

If the internal OSC (HSI) would be applied, switch to HSE with a crystal.

Place the crystal as close to the MCU OSC_IN/OUT pins as possible.

B) VDD power source - low voltage at USB transceiver supply

To drive the USB line properly, VDD should be maintained at 3.0V or more (< 3.6V).

Is there any ''power eater'' on your board, which occasionally causes VDD drop?

Tsuneo

bluevault
Associate II
Posted on February 12, 2016 at 14:30

Hi Tsuneo,

Thanks for your input. The issue was that a ZLP was not being sent with packets having 64 bytes. After I added a ZLP at 

EP1_IN_Callback(), it was good.

Thanks!