cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 USB as VCP - The semaphore timeout period has expired (error code 121)

TDJ
Senior III

I try to configure USB_OTG_HS port on Nucleo-H7A3ZI-Q as a Virtual Com Port (VCP). All CubeMX settings left default, no RTOS.

Windows 10 recognizes the device as COM9 but when I try to open it using putty the infamous "The semaphore timeout period has expired" error 121 occurs after about 4 seconds, OTG_HS_IRQHandler does not fire.

I have modified CDC_Control_HS() function to implement correct port settings as described in How to Set USB CDC Line Coding? (st.com). I have tried increasing stack and heap size, removing the Windows COM device several times, tried various terminal apps, made sure com params match, tried disabling "use FIFO buffers" - all for nothing, error still occurs. The same USB port with the same (high grade) cable works just fine with STLINK-V3, including STLINK VCP.

I have no clue what to check next. Please advise.

CubeMX 6.3, STM32Cube FW_H7 V1.9.0

#USB​ 

1 ACCEPTED SOLUTION

Accepted Solutions
TDJ
Senior III

It turns out the problem is specific to the PC I initially used for test. Example works well with another PC.

View solution in original post

2 REPLIES 2
TDJ
Senior III

It turns out the problem is specific to the PC I initially used for test. Example works well with another PC.

Good news! thanks for your feedback.