2016-01-11 02:54 PM
Hi.
I'm trying to make CDC console on STM32 device. But I've noticed some troubles: 1. When I re-connect USB cable to device, device just hangs. It seems like bug is in USB library - even blank project, that is generated by fresh CubeMX, hangs. This is most annoying trouble. 2. When I press reset, host PC (Linux) doesn't receive any re-initialization event, so connection becomes lost. Dev board have pull-up resistor directly to power line, so I can't emulate device reconnect. Can this be fixed in some way? 3. Startup (mostly - clocks initialization) takes enough long (~0.5-1 sec). For battery-backed device this isn't a trouble, but if I connect demo board directly to USB, it's often detected as unknown device. Can I do something with this? MCU - STM32F103C8T6 #usb #cdc #cdc #stm32cube #stm32f12016-01-15 12:52 AM
Slow startup was caused by LSE clock (it seems like something wrong with resonator/capacitors). Somewhy it also affects USB bus (???) - board periodically wasn't detected by PC (even when it works from st-link power - so initialization timeout doesn't hurt USB).
2016-01-15 08:06 AM
I'd check the fail through sequences on the clocks and PLL. The USB peripheral requires the PLL is running, and 48 MHz is output via the Q tap.
2016-01-15 09:16 AM
Clocks are initialized correctly (I didn't touched them as cubemx sets them). This issue related to LSE onboard generator. With same code board may work OK (just with startup delay), and after a while - may not be detected at all via USB. I can't understand how LSE can involve USB.
Altough, other issues (hangup on USB reconnect and re-initialization lacking on reset) aren't solved (I didn't look on it deeply).2016-01-15 09:47 AM
I didn't touched them as cubemx sets them
Ok, but doesn't it give up and abort when things don't work properly? The LSE should have no material impact on the chip and the functioning of the USB peripheral2016-02-10 09:42 AM
Hi denisenko,
Take a look to the following discussions , I thinkthat will give you a solution for each point ou have asked: 1. -> 2. -> [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F4%20USB%20CDC%20Transfer%20Problems&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=23]discussion2 3. -> [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/Bug%20report%20USB%20CDC%20Template%20and%20CubeMX%20code%20generation¤tviews=12]discussion3 -Hannibal-