cancel
Showing results for 
Search instead for 
Did you mean: 

Ghosting Problem on STM32C0 CDC (classic coremw)

zerozaber
Associate

I have solved the problem, but I want to know the root cause so I can solve this perfectly.
I use STM32C071FBP6. Because STM32CubeIDE won't generate classic CDC VCP anymore, I use STMicroelectronics/stm32c0-classic-coremw-apps: Provides a set of applications for STM32C0xx series based on the STM32 Classic Core Middleware libraries.
The problem occurs on both Arduino Serial Monitor and python, but I will mainly use Arduino Serial Monitor here.

 

The problem occurs if SYSCLK is 12Mhz while USB use HSIUSB48. Changing SYSCLK to HSIUSB48 solved the problem.


The STM32C071, when configured as a USB CDC Virtual COM Port, exhibits a "ghosting" issue characterized by the device repeatedly transmitting old or zero-length data packets. This problem manifests randomly each time the USB device is enumerated (i.e., when connected to a host or after a software reset).

If the STM32 is first boot (no last packet) TxPctSize is 608 until a packet is sent, after that, TxPctSize is equal to last packet even xfer_len = 0

Example, if I command STM32 to send "hello world!" once. If that USB enumeration got ghosting, my serial monitor will continuously print out "hello world!". Every time it is printed, TransmitCplt also triggered.

 

1 REPLY 1
FBL
ST Employee

Hi @zerozaber 

The AHB frequency has to be higher than 14.2 MHz to guarantee a correct operation for the USB OTG_FS peripheral, and higher than 30 MHz for the USB OTG_HS peripheral as detailed in section 2.4 Clock in AN4879

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.