2020-08-21 08:25 PM
Hello,
I am using NUCLEO-F429ZI and set usb as com vcp. I am able to connect board to PC without any problem, but ST doesn't provide specified pc driver for stm32 VCP. In my pc, I can see general vcp com port in PC, is it possible to read parameter to detect the connected controller from nucleo board?
thank you.
2020-08-21 11:25 PM
> but ST doesn't provide specified pc driver for stm32 VCP
Oh, they do as part of the ST-LINK. It should be listed in the Windows device manager or in Linux usb-devices.
For Windows: TeraTerm is a terminal program which lists the COM port details. this helps identifying the right port.
In STM32CubeMX the VCP pins are named STLK_RX and STLK__TX and the USART3 are as expected: 115200 8N1.
2020-08-22 12:58 PM
What do you mean " to detect the connected controller" ? Do you want to detect from the PC side that a certain COM port is a STM32 or VCP of the debugger?
-- pa
2020-08-23 08:40 AM
There are 2 serial com ports on the Nucleo-STM32F429ZI. One is for stm-link for debug, another one is user serial port over usb connection. I am using this usb connection to link a HMI for my control. So I need install a usb driver on PC. Stm had vcp windows driver before, but since windows 10, they don't provide specific driver for vcp, instead, they use Microsoft general usb comm driver. So in device manager, you will see usb driver instead of stmicroelectronics vcp driver. So I want to use my pc hmi program to detect stm32 controller when it is plugged on PC.
2020-08-23 09:15 AM
I see. You want to find the correct COM port from your PC software. There are OS-specific solutions for that, like TeraTerm does it for Windows. Is open-source under a liberal BSD license http://ttssh2.osdn.jp/, maybe that helps.
The easiest and OS-agonstic way would be if your device sends out some magic string in an endless loop whiule waiting for connection. Then you can snoop for that string on all VCP ports without a need for installing a specific driver.
2020-08-23 09:56 AM
> So I want to use my pc hmi program to detect stm32 controller when it is plugged on PC.
Well, you can use the Windows specific API to enumerate all "serial ports" and look at their details.
The interesting details are: bus (you want only USB devices), vendor and device IDs (this you can specify in your USB device descriptor) and "Bus-reported device description" (this is the device name string in your USB device descriptor).
Also, the COM port of ST-LINK is a child of USB composite device, while your own COM port probably is not - this can be used to filter off wrong ports.
-- pa