cancel
Showing results for 
Search instead for 
Did you mean: 

Ghosting Problem on STM32C0 CDC (classic coremw)

zerozaber
Visitor

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.

 

0 REPLIES 0