cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get STM32F0 to show up under "Ports " in device manager?

CR72
Associate II

My STM32F0 won't show up under "Ports " in my device manager. It does, however, show up under "Universal Serial Bus Devices". I'm trying to print to a serial monitor. I've spent over 12 hours (low guess) trying to troubleshoot this issue. Here is what it looks like in my device manager.0693W00000KbNFGQA3.pngHere are some of the settings I've tried

0693W00000KbNGBQA3.pngI did also try using RCC as Crystal/Ceramic Resonator

0693W00000KbNGaQAN.png 

0693W00000KbNGGQA3.png0693W00000KbNGVQA3.png0693W00000KbNDLQA3.pngWhat do I need to do so I can get my device to show up as COM 4 or COM 6 or some other COM channel?

Thank you for taking time to look at my question! :)

17 REPLIES 17
CR72
Associate II

Hi @Community member, so I have the ST-LINK drivers installed which enables me to flash my code to the board (so I'm assuming you have that). And I'm using the STM32CubeIDE. My settings are as follows:

1) Connectivity -> USB -> Device (FS) box checked

0693W00000Np8m2QAB.png2) Middleware -> USB_DEVICE -> Class For FS IP -> Communication Device Class (Virtual Port Com) option selected

0693W00000Np8lnQAB.png3) Here's my clock configuration

0693W00000Np8mCQAR.png3) Save and then the code generates

4) And then here's the code example I sent to the serial monitor via usb

//The message to be sent

uint8_t buffer[] = "Hello, World!\r\n";

//Transmitting the message with a delay

CDC_Transmit_FS(buffer, sizeof(buffer));

HAL_Delay (100);

5) I use the ST-LINK port on my board (circled in blue) to flash the code, and once the code has been flashed I unplug the cable from the ST-LINK port and insert it into the USB USER port (circled in red). It is at this moment, when the cable is connected to the USB USER port that I can see my little controller under PORTS in the device manager, and I can then connect to the serial monitor and I will see the message displayed.

0693W00000Np8nUQAR.pngLet me know if that was clear, and if it helped, and if you have any questions still. I'm still pretty new to this, but these are the steps I took to get it working.

Hey @CR72​, Thank you for the detailed response! I�? am basically doing everything that you are doing with the exceptions that our board only has one MINI USB port, and we were trying to use USART to transmit the data to VCOM not CDC, I�? am not sure what the difference is but maybe I�? can give that a shot. The fact that we only have one MINI USB port available makes me think that @Pavel A.​'s response might be a viable solution. Thank you again!

Okay @Pavel A.​ thank you, we already have a few FTDI's on hand so we will probably try those. But you are saying that if we plugged in the ST-LINK and FTDI into a hub, we would be able to flash the board and receive UART with one cable?

Pavel A.
Evangelist III

> if we plugged in the ST-LINK and FTDI into a hub, we would be able to flash the board and receive UART with one cable?

Yes. One cable from the hub to the PC.

CR72
Associate II

@Community member​ You're welcome! Sorry it isn't of much use to you. I think that you're board would have to have the other mini USB port in order for CDC to work. But I am interested to know how your solution goes and would love to see a diagram or something in case I am ever in a similar situation to yours.

Hi @Pavel A.​ , Do you know if there are any resources for writing code to transmit UART over the FTDI w/ STM32F0?

Pavel A.
Evangelist III

@Community member​ What does this mean? You simply connect TX and RX pins of the FTDI (they have several chips and assembled cables) to STM32F0 UART pins.

If you have a FTDI cable with RS-232 level serial end, you need a similar RS232 level adapter on the STM32 side.

However if isolation is needed, it gets more complicated.

To write UART code.... there's a lot of free examples.

DrWidget
Associate II

I know this is an old thread, but just in case this is of some help to someone, I used the STM32CubeIDE to autogen a USB CDC device. Compiling with no changes to the generated code gives warnings in the "Get_SerialNum" function about initialized deviceserial0, deviceserial1, and deviceserial2.  If I download the code into my device and connect it to windows, there's some indication that a device has been attached, but it doesn't show up anywhere.  If I correctly initialize the variables either assigning values, or getting the device ID, then it compiles without warning and correctly shows up as a virtual comm port.