2024-05-26 08:48 AM
Hello,
I am trying to debug my vcp application (uses STM32F103CBT6), but when I start a debug session the COM port does not work. When not debugging, just uploading a new code, the cdc communication only works after a power reset. I modified my custom board: added transistors to the DP pull up resistor to be able to disconnect it from 3v3 with code, but it does work, it won't reenumerate the device.
When debugging, CDC_Control_FS() never get called.
the function looks like this:
I tried everything i can foud on the internet, but nothing worked.
I have also read this: https://community.st.com/t5/stm32-mcus-products/usb-cdc-dont-work-in-debug/m-p/464797
The USB variables when the communication is not working:
and the registers:
Solved! Go to Solution.
2024-05-26 09:20 AM
I have used USB with the following method before.
By directly connecting the dp pull up resistor to an IO,
When the device is reset, set the dp pull up resistor to 0.
I set the output to 1 just before the USB setup function.
here is part of my schematic
2024-05-26 09:20 AM
I have used USB with the following method before.
By directly connecting the dp pull up resistor to an IO,
When the device is reset, set the dp pull up resistor to 0.
I set the output to 1 just before the USB setup function.
here is part of my schematic
2024-05-26 09:50 AM
Debugging and real-time operation are generally not compatible. Watch out also peripheral views, and invasive effects on related registers and FIFOs
Perhaps find other ways to diagnose what's happening with your code. Instrumentation to understand dynamic flow and interactions can be helpful to pin-point what behaviour and sequences are problematic.
2024-05-26 10:25 AM
Thank you! This worked. I did not think of this.
BTW first I tried what ST uses in their schematic:
but this did not work at all.
Then I built what I thought will work:
and this is working in normal case, but not in debug case.
2024-05-27 02:42 AM
Hi @PSzab.1
Would you please tell me where you found the implementation?
I'm suspecting a mismatch with the current implementation on F103 eval board.
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.
2024-05-30 01:16 AM
Oookay. I won't trust this much the internet next time. I just searched for stm32 f103 schematic.