2018-03-01 10:03 AM
Hello,
recently I am trying to make some device communicating via USB virtual com port. Firstly, device has sometimes problem to enumerate itself:
[1922765.320415] usb 1-1.2: new full-speed USB device number 34 using ehci-pci
[1922765.414063] usb 1-1.2: device descriptor read/all, error -32[1922765.484587] usb 1-1.2: new full-speed USB device number 35 using ehci-pci[1922765.556713] usb 1-1.2: device descriptor read/64, error -32[1922765.732912] usb 1-1.2: device descriptor read/64, error -32[1922765.909118] usb 1-1.2: new full-speed USB device number 36 using ehci-pci[1922765.934083] usb 1-1.2: New USB device found, idVendor=0483, idProduct=5740[1922765.934089] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3[1922765.934092] usb 1-1.2: Product: STM32 Virtual ComPort in FS Mode[1922765.934095] usb 1-1.2: Manufacturer: STMicroelectronics[1922765.934097] usb 1-1.2: SerialNumber: 12345678[1922765.934655] cdc_acm 1-1.2:1.0: This device cannot do calls on its own. It is not a modem.[1922765.934689] cdc_acm 1-1.2:1.0: ttyACM5: USB ACM deviceBut there is problem with sending string buffer. When I want to send some packet via usb sometimes I get duplicated first four bytes. Example (first line send to device from terminal, second got back):
ping
HellHello worldpingHello worldpingHello worldpingHellHello worldpingHello worldI use 8MHz crystal on HSE as clock source multiplied by PLL (@96MHz) to get 24MHz AHB and SYSCLK and 48MHz USB clock
2018-03-01 10:13 AM
Maybe you lost chars 'o world
ping'2018-03-01 11:14 AM
Add counter to the string to prove it...
2018-03-01 01:00 PM
I am affraid it is not that problem:
ping
hellhello (1)pinghellhello (2)pinghello (3)pinghello (4)pinghellhello (5)pinghello (6)2018-03-01 01:17 PM
Yes, data duplication is unlikely here. More likely it's a problem with a driver as you mentioned at the beginning.
2018-03-06 02:41 AM
Problem solved. I simply rise the hclk to 48MHz