cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone Ever Get The STM32F4 Virtual COM Port Working w/Windows 10?

Terence D
Senior
Posted on October 27, 2017 at 06:07

I see multiple people having this problem but not seen an answer why or a solution: The Virtual COM Port driver (1.4) is not working for Windows 10 users. I have the same problem. I download the Driver from:

http://www.st.com/en/development-tools/stm32-utilities.html?querycriteria=productId=LN1729

I run the installation process and also note in the contained readme.txt it says:

How to use

***************

1- Uninstall previous versions (Start-> Settings-> Control Panel-> Add or remove programs)

2- Run your ''VCP_V1.4.0_Setup.exe''

3- Go to Your installation directory - Example, C:\Program Files (x86)\STMicroelectronics\Software\Virtual comport driver

4- Go to Your OS version directory ([Win7] or [Win8])

+ Then :

- Double click on dpinst_xexe if you are running a 32-bits OS version

- Double click on dpinst_amdexe if you are running a 64-bits OS version

+ Follow the instructions.

Since I have 64 bit Windows 10 I rundpinst_amdexe. The installation appears to work, but no ''ST Microelectronics'' COM port shows up in my device manager, only COM1:

0690X00000608ldQAA.png

I am quite certain COM1 is in no way related to my STM32F411 board. Anyone know how to get this to work?

Note: this post was migrated and contained many threaded conversations, some content may be missing.
15 REPLIES 15
Ant M
Associate II
Posted on October 27, 2017 at 15:46

I have had it working on windows 10. It is more likely to be the firmware.

As a basic working example for the F429 Discovery board have a look at the link below, I assume you have tried the ST examples?

https://github.com/Ant1882/STM32F429-Tracealyzer-Demo

 

Even if you don't have this board, you may spot something in the code. I also found this document to be quite useful:

https://blog.brichacek.net/wp-content/uploads/2015/10/STM32F4-and-USB.pdf

 

The version of USB driver I have on my system is v1.3.1, I can't vouch for v1.4.0.

Ant

Posted on October 27, 2017 at 21:57

Ant - Thanks for the reply!  I actually have an STM32F429 board in addition to my STM32F411.  I built the Tracealyzer demo, flashed it to the board and the 'STMicroelectronics STLink Virtual COM Port' magically appeared under 'Ports' in 'Device Manager'.  Yay!!

However, what I don't understand is what exactly happened with the board/software/driver that caused the COM port to work.  I've studied the 'USB F4 VCP Device' section of the PDF you've linked to but nothing there is making it entirely clear why this suddenly works.

At first I figured the COM port appeared because the Tracealyzer software running on the board activated certain peripherals to cause the 'connection' to happen.  However, since then I've flashed different software (like just a simple light blink example), I unplug the board, plug it back in and it's surprising to me that the COM port for the 

'STMicroelectronics STLink Virtual COM Port' still appears.

Can you provide any insight into why this happens?  Just trying to understand this better.  Thanks in advance.

Terence

Posted on October 28, 2017 at 17:00

Glad it worked!

It sounds like the device may not be enumerating, which is why you have nothing in device manager.

Even if you don't 'connect' to the device, it should show up in device manager on your PC as plugging it in starts the enumeration process and establishes the connection. It could be clock related, or maybe you are missing the USB interrupts being enabled (check in CubeMX).

Maybe see if you can output the 48 MHz USB clock on the MCO pin to verify... can't remember off the top of my head if you can actually do that.

Best Regards,

Ant

Posted on October 29, 2017 at 05:16

Ant - Thanks for the reply. A few comments with regards to your previous advice:

Even if you don't ''connect'' to the device, it should show up in device manager on your PC as plugging it in starts the enumeration process and establishes the connection.

No dice. I plug my STM32F429 in and ''STMicroelectronics STLink Virtual COM Port (COM5)'' shows up under ''Ports''. in Device Manager. I unplug it, and plug in my STM32F411 using the same USB cable and port and nothing

:(

Itcouldbe clock related, or maybe you are missing the USB interrupts being enabled (check in CubeMX).

I take it you mean this?

0690X00000608mRQAQ.png

Maybe see if you can output the 48 MHz USB clock on the MCO pin to verify... can't remember off the top of my head if you can actually do that.

It doesn't look like I can do that. It looks like the closest I can get is 36 MHz:

0690X00000608jtQAA.png

I've attached my CubeMX IOC in case you'd be so kind to take a look ...Really lost on this one and really need to get this to work. I'd be very appreciative of any other thoughts.

________________

Attachments :

411VCPTry1.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyLT&d=%2Fa%2F0X0000000b6J%2FvABl7_SJ.5kQgEFg19Lg4xMex7ihHg16M7o2KnEFp4U&asPdf=false
Posted on October 29, 2017 at 11:20

I think I see your problem, you have USB_OTG_FS set to act as a host rather than device.

In CubeMX on pinout tab, locate USB_OTG_FS and set mode to device only, also untick Activate_VBUS... don't think this is required, check the 429 project. Then if you look at the top under middlewares USB_DEVICE should be in bold, click the drop down box (Class for FS IP) and select communication device class. Save and generate code.

You should get some functions, in defaultTask (or main.c, can't remember), that initialise the USB.

That should be enough to get the board recognised by the PC, assuming you have no other issues in your application code.

Ant.

Posted on October 30, 2017 at 18:58

Hi Ant - Thanks for the tips. I followed your instructions, but unfortunately still no 'STMicroelectronics STLink Virtual COM Port' listed under Ports of Device Manager when making these modifications, generating code and running it on the STM32F411 board

:(

I've attached my latest IOC file with the modifications you've suggested. I also did various comparisons between it and the IOC from your F429 TraceAlyzer project and I'm not seeing any outlying, obvious differences that could be causing the problem.

If you look at the attached IOC in Cube MX you'll notice I've activated GPIO pins D12, D13, D14 and D I do this because in the main loop I toggle the LEDs on the board just to make sure something works. So, the only code I add to the generated project are the following two lines in main's while loop:

HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_12 | GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15);

HAL_Delay(1000);

At this point I'm wondering if something is physically wrong with my STM32F411 board. It costs around $20 USD to order a new one. I prefer to not spend $20 on something I already have, but I can afford it. Think I should try getting a new STM32F411 board?

Really appreciate your willingness to help me with this, Ant. Any other suggestions or thoughts?

________________

Attachments :

411VCPTry1.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyL9&d=%2Fa%2F0X0000000b6E%2FPNsBVm1W_jsjVE8ViW6bh_dlqrZdQErkXdLs723neYs&asPdf=false
Posted on October 30, 2017 at 23:11

Looks OK, I can't see anything obvious.

Maybe check if there are any solder bridges that need connecting on the board, swap the USB cable, try a different port... although I'm sure you have already tried these. Check the schematic vs the board, soldering on the dev board USB socket.

Try putting breakpoints in parts of the USB code, in the interrupt handler to make sure that is being called. Unfortunately it's not that easy to follow and can be time consuming. 

Could still be the board. Which board is it that you are using? 

Posted on October 31, 2017 at 17:38

So, I'm an idiot. I step thru the code as you suggest, and definitely see it going through the USB init steps. I then examine the board and don't notice any anomalies, then suddenly think 'hey, why not try and plug a USB cable into CN5 and connect it to the Win 10 machine', I do so, and bingo, 'STMicroelectronics Virtual COM Port (COM4)' shows up under 'Ports' in Device Manager.

Just to be clear about the USB connections on the board, CN1 is the USB connection that provides power to the board, and CN5 is the USB connection on the opposite end of the board.

Why didn't I think of doing this earlier? Well, I did, and did do it, but two things:

  1. This was before the latest code was running on the board that does the USB initialization and I'm fairly certain the connection didn't work.
  2. With my STM32F429 board, the virtual com port shows up on connection to just CN1.

So, I'm happy it's now connecting but I'm surprised why the STM32F429 connects when just using CN1 (and not it's additional USB connection) but the STM32F411 board will not connect until using CN5 USB connector (the additional USB connection). Anyone know why?

I've read through

http://www.st.com/content/ccc/resource/technical/document/user_manual/e9/d2/00/5e/15/46/44/0e/DM001489pdf/files/DM001489pdf/jcr:content/translations/en.DM001489pdf

and I'm not seeing any explanation.

Also, just to be clear, the boards I have are:

  • STM32F411E-DISC0
  • STM32F429I-DISC1

Ant - Big thanks to you for your help with this!

Max Vilimpoc
Associate II

I had a similar issue with the STM32L476 Virtual ComPort (VCP) not working properly, even though it seemed like all the drivers on Windows should have been in place after installing both ST-LINK004 and Atollic TrueSTUDIO 9.2.0.

Instead, I chose to wipe out all of those installed drivers and install the 64-bit Windows 8 VCP driver from the STSW-STM32102 package (even though the README says not to), and everything worked fine after that. I've written this up here, with before/after screenshots -- https://vilimpoc.org/blog/2019/01/13/stm32-virtual-com-port-issues/

The software running on the STM32 chip was straight from ST's own SensorTile samples, precompiled and unmodified.