cancel
Showing results for 
Search instead for 
Did you mean: 

USB VCP problem

Posted on October 13, 2017 at 14:05

I'm using stm32 Workbench with CubeMX and STM32F4DISCOVERY with STM32F407VG microcontroller

I setup everything in CubeMX as default:

- RCC-> Crystal/Ceramic Resonator

- SYS->SerialWire with SysTic Timebase Source

- USB_OTG_FS-> Device_only

- In MiddleWares, USB_DEVICE-> Communication Device Class (VCP)

- I setup Clock Configuration with input frequency 8 MHz HSE and 168MHz HLCK

- In Configuration: USB_OTH_FS Configuration i disable Vbus sensering

- In USB_DEVICE Configuration is setup as default 

Problem:

Everything compile without any problems and errors.

When I connect my stm to PC, microcontroller log as COM port.

I send messages to PC with CDC_Transmit_FS function.

I receive messages on PC with HTerm program.

HTerm show this COM port normally.

When I try click connect button in HTerm, program don't connect with COM port and shows error:'Error in OpenPort: Internal error when initializing COM4'.

But in some situations (sometimes when I rebulid code, but 

not often),

 I can connect with this port and I can receive messages from stm- but not every time.

When connect with this com port and I click connect and disconect buttons several times COM port has an error describe above.

This problem shows up when I using Windows 10 Pro system, but when I use Windows 7 Proffesional system this problem problem never occurred

2 REPLIES 2
Vasiliy Alekseev
Associate
Posted on October 13, 2017 at 20:52

Can you try another terminal client? For example RealTerm.

Is the port always displayed in the Windows Device Manager?

Do you have a pause between data transfers?

Posted on October 17, 2017 at 08:52

1. In any another terminail it is the same problem.

2. Yes- when I connect stm

3. No 'HAL_Delay', but another instructions