cancel
Showing results for 
Search instead for 
Did you mean: 

How to establish a Virtual Port Com connection with STM32F103RBT6?

JWojt.1
Associate II

Hello, I realised that there is less than none articles about this topic so I'm looking for advice here. Long story short, I'm trying to communicate with my Olimexino STM32 board with Virtual Com Port. I am using CubeMX to create the source code, and I'm uploding it via ST-LINK Utility with STLinkV2. I try to cummunicate with the board via RealTerm. But, everytime I load any code (even if it's just a simple blinking led) on the board it just stops showing it in the Device Manager. I tried many different ways, and I have read somwhere that it might be a wrong resistor connection problem. I am a newbie if it comes to STM32 so please be gentle. I will be very grateufl for any insight on this topic.

Cheers,

Jan

18 REPLIES 18
Ons KOOLI
Senior III

Hi JWojt.1,

I don't figure out what is exactly your problem.

If the problem is that you cannot succeed on creating a Virtual Com connection, so you can refer to this link it might be helpful for you.

Else, if your problem is that you cannot see the Virtual COM port in device manager after uploading other project, I think this is because you just erased the board and uploaded another project into it.

tell me if this was helpful, please.

Best Regards,

Ons.

JWojt.1
Associate II

Hi Ons,

I have tried the tutorial in the link that you gave me, but unfortunately it didn't work for me as it did for the gentelman in the video.

I will try to desribe my problem better: after writing some code, in which I'm trying to establish a connection via VCP (i want to be able to send, and recieve data through the RealTerm) my board dissapears from the Device Manager. I use ST_LINK utility to put the code on the board, maybe that's what I'm doing wrong? I've been doing it this way because my debuger always crashes when it reaches 91%. In the error window it says: "Error in final launch sequence bFailed to execute MI command: -target-select remote localhost:3333".

Sincerly,

Jan

PS Thank you very much for your help

Ons KOOLI
Senior III

Hello JWojt.1,

So,

  • "I have tried the tutorial in the link that you gave me, but unfortunately it didn't work for me as it did for the gentelman in the video."
    • Can you please describe the problem you've got when following the tutorial.
  • "after writing some code, in which I'm trying to establish a connection via VCP (i want to be able to send, and recieve data through the RealTerm) my board dissapears from the Device Manager. I use ST_LINK utility to put the code on the board, maybe that's what I'm doing wrong?"
    • This point is not clear. Can you explain more. Anyways, there is no problem with using ST_LINK for debugging.
  • my debuger always crashes when it reaches 91%. In the error window it says: "Error in final launch sequence bFailed to execute MI command: -target-select remote localhost:3333"
    • It seems that this is another problem, you can open another question for it. Do not forget to mention what tools you are working with.

PS: The CDC class is part of USB stack. So, to work with it you should be familiar with USB. You can find here more details about USB Labs for STM32 devices.

Best Regards,

Ons.

JWojt.1
Associate II

Hello Ons

The person in the tutorial connects his board with RealTerm flawlessly, while in my case it just doesn't show anything (the board dissapears from Device Manager, so I can't connect to it via RealTerm). This is the biggest problem and I can't solve it in any way. Whenever I program my board I hear the "disconnecting-a-device" sound on my PC and the board is no longer on the list. You mentioned something earlier about erasing the board, maybe you know a way to load a program on the board without causing it to becoming invisible for the PC?

Best regards,

Jan

PS: I will chcek the USB stack, thank you for the link

Ons KOOLI
Senior III

Hi JWojt.1,

Are you working with only one cable, please?

If yes, so you have to have some documentation on USB.

PS: For STM32 development, USB projects are supposed to work with two cables: One cable is the STLINK cable and used for flashing and debug, and the other cable is used for USB purpose (HID, CDC, ... or other).

Regards,

Ons.

JWojt.1
Associate II

Hi Ons,

I don't know if desribing it would do any good so here is a picture showing my cable connection:0693W000000VK2xQAG.jpg

As you can see I am using one cable to connect the board to the PC with the micro USB port and one cable to use the StLinkv2 with the JTAG cable.

I was hoping that after loading the code on the board I would be able to loose the StLinkv2 and communicate via RealTerm with only cable remaining.

Again, thank you for your feedback.

Sincerly,

Jan

Ons KOOLI
Senior III

Hi JWojt.1,

It seems that your setup is good.

Please refer to CDC_Standalone projects in STM32Cube firmware.

  • "I was hoping that after loading the code on the board I would be able to loose the StLinkv2 and communicate via RealTerm with only cable remaining."
    • I think this is your problem. Can you explain more in details? It is not clear to me.
    • With this configuration you are presented in the picture, and after loading your CubeMX generated project into your board, is your device enumerated by Host ?

Best Regards,

Ons.

JWojt.1
Associate II

Hi again Ons,

After loading my CubeMX generated project on the board I can't communicate with the board at all. Nothing shows in the device manager, and even though I know the code has been properly uploaded (simple things like blinking a diode works) the comunication via terminal is still not working. I actually have a STM32F429-DISC1 board (the one with the lcd touch-scrren) and I have tried using the CDC_Standalone projects on it too (even with Keil uVision5 IDE) but there is no difference - I can't communicate with that board VCP at all.

What I want to do is to generate the code that would allow me to send a message to the board via terminal (for example RealTerm) and recieve something (a different message) to confirm that the board has recieved it.

I don't know what you mean by "a device being enumerated by the host"? Maybe I am unaware of something important?

I have been using a lot of examples lately (mostly from st.com page) to try to locate the errors and I'm begining to think that the problem may be caused by some uninstalled drivers or the fact that I'm working on a macbookPro with Windows10 installed with BootCamp. Do you think that it might be the reason?

Thank you for your time.

Best regards,

Jan

Ons KOOLI
Senior III

Hi JWojt.1,

Please read carefully the readme file located under project directory. You should install the USB virtual COM port driver available on the ST official website.

Best Regards,

Ons.