Skip to main content
TDJ
Senior III
September 7, 2021
Solved

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

  • September 7, 2021
  • 1 reply
  • 1344 views

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​ 

This topic has been closed for replies.
Best answer by TDJ

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

1 reply

TDJ
TDJAuthorBest answer
Senior III
September 14, 2021

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

Walid ZRELLI
Visitor II
September 16, 2021

Good news! thanks for your feedback.