cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE Serial Port Connection

mathieusteketee
Associate III

I  have a STM32F405 and am trying to setup UART to connect to my pc. As of now I have connected it with an ST-Link/V2 and later on want to program it over USB-C using UART. See the wiring diagram:

mathieusteketee_3-1713883700752.png

I have used PA10 and PA9 for RX and TX.

mathieusteketee_4-1713883730791.png

The parameter settings are as followed: 

mathieusteketee_5-1713883780385.png

When it comes to the GPIO settings I have set the maximum output speed to "Very High" (not sure if this is correct).

mathieusteketee_6-1713884880999.png

 

I have watched a guide on YouTube (https://youtu.be/dnfuNT1dPiM?t=4896) about how to getstarted in the STM32CubeIDE and stopped on the part about the "Command Shell Console":

mathieusteketee_7-1713885024370.png

At "Connection name" I had none and preesed "New..."

mathieusteketee_8-1713885150628.png

Now on the "Serial port", I dont know what to do. See image:

mathieusteketee_9-1713885195053.png

I am using a Windows 11 computer and heard something about using Tera Term or Putty, but I dont know how.

Can someone explain some more about the Serial port setting?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

" I have set the maximum output speed to "Very High""

Not optimum but it works. I suggest Low to set them to low instead of very high.

Now regarding the config of the Hyperterminal:

You need to check what is the Comport number assigned by windows on your computer. You need to go to Device manager on your computer and go to Ports (COM & LPT) list:

SofLit_1-1713889827627.png

This is what I found as comport number : COM26. You can find another number. This is what you need to put in Serial port in the CubeIDE console:

SofLit_2-1713889949612.png

Hope I answered your question.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

9 REPLIES 9
SofLit
ST Employee

" I have set the maximum output speed to "Very High""

Not optimum but it works. I suggest Low to set them to low instead of very high.

Now regarding the config of the Hyperterminal:

You need to check what is the Comport number assigned by windows on your computer. You need to go to Device manager on your computer and go to Ports (COM & LPT) list:

SofLit_1-1713889827627.png

This is what I found as comport number : COM26. You can find another number. This is what you need to put in Serial port in the CubeIDE console:

SofLit_2-1713889949612.png

Hope I answered your question.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

You've got a driver for this CH340C ? Installed and working?

You can see it in Device Manager? At what COM port.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you for your reply @SofLit .

 

I will set the Maximum output speed to low then.

Yes, this answers my question.😁

I however don`t seem to get any Comport when I plug my USB-C cable to the STM32F4. 

Could this have something to do with the settings in the bootloader perhaps?

 

I have tried using the .bin file which is located in the "Debug" folder when I generated my code. 

mathieusteketee_0-1713894820068.png

Do you have any tips regarding this?

 

Thank you!

No relation to bootloader or anything else.

The Comport is part of ST-Link module and not to the target MCU.

You need to find and get a new Comport number in the "Ports" list as shown above, otherwise you have an issue on ST-Link module side.

Are you using a rechargeable cable or data cable? you need to use a data cable otherwise it won't work.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

>>I however don`t seem to get any Comport when I plug my USB-C cable to the STM32F4.

Sorry, not familiar with your board.

You have the USB to the STM32F4? And you have a USB CDC Device firmware loaded on it? BOOT0=HIGH ROM System Loader, would be "STM32 BOOT LOADER" not a CDC/ACM/VCP

Or USB-C connected to WDH CH340C ?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hey @Tesla DeLorean ,

I have forgotten totally about the driver for the CH340C. Very good shout thank you!

I will download the driver and give it a shoot 🙏

Okay, that is good to know. 

I am using an USB-C to USB-C cable between my computer and the STM32. But since I havent installed the driver yet for the CH340C, it would properly not work anyway. 

Do you know if USB-C to USB-C is a data cable I can use @SofLit ?

 

Thank you.

I have a custom PCB. I use a USB-C to USB-C cable to the STM32F4. I cant seem to recall I have a USB CDC Device firmware on it. Can I do this in STM32CubeIDE?

 

I can try to explain my setup somewhat better. The STM32F4 is power not powered by the USB-C, it uses another source on the PCB. The pins PA9(TX) and PA10(RX) go to the serial chip (CH340C). See wiring diagram:

mathieusteketee_2-1713911366498.png

From the serial chip (CH340C) pin D+ and D- are connected to the USB-C port. See wiring diagram:

 

mathieusteketee_1-1713911069252.jpeg

 

RX/TX are correct from the STM32, such that RX goes to TX on the serial chip and TX goes to RX.

 

Hope this helps understand the problem. 

 

 

 

I have now installed the driver for the the CH340C and should be working.

mathieusteketee_0-1713956903613.png

I however do not see the Com port in the Device Manager.

mathieusteketee_1-1713956949746.png

Do I need to enable UART somewhere in the STM32IDE program?

Thank you.