USB virtual COM port does not work when debugging
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:


