2022-03-03 07:48 PM
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.Here are some of the settings I've tried
I did also try using RCC as Crystal/Ceramic Resonator
What 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! :)
2022-05-03 03:47 PM
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
2) Middleware -> USB_DEVICE -> Class For FS IP -> Communication Device Class (Virtual Port Com) option selected
3) Here's my clock configuration
3) 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.
Let 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.
2022-05-05 08:44 AM
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!
2022-05-05 08:46 AM
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?
2022-05-05 12:45 PM
> 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.
2022-05-05 06:50 PM
@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.
2022-05-10 08:38 AM
Hi @Pavel A. , Do you know if there are any resources for writing code to transmit UART over the FTDI w/ STM32F0?
2022-05-10 10:53 AM
@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.
2024-03-20 06:41 PM
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.