2024-04-23 08:17 AM
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:
I have used PA10 and PA9 for RX and TX.
The parameter settings are as followed:
When it comes to the GPIO settings I have set the maximum output speed to "Very High" (not sure if this is correct).
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":
At "Connection name" I had none and preesed "New..."
Now on the "Serial port", I dont know what to do. See image:
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
Solved! Go to Solution.
2024-04-23 09:32 AM
" 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:
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:
Hope I answered your question.
2024-04-23 09:32 AM
" 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:
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:
Hope I answered your question.
2024-04-23 09:59 AM
You've got a driver for this CH340C ? Installed and working?
You can see it in Device Manager? At what COM port.
2024-04-23 10:54 AM
Thank you for your reply @SofLit .
I will set the Maximum output speed to low then.
Yes, this answers my question.:beaming_face_with_smiling_eyes:
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.
Do you have any tips regarding this?
Thank you!
2024-04-23 11:26 AM
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.
2024-04-23 12:09 PM
>>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 ?
2024-04-23 02:59 PM
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 :folded_hands:
2024-04-23 03:06 PM
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.
2024-04-23 03:33 PM
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:
From the serial chip (CH340C) pin D+ and D- are connected to the USB-C port. See wiring diagram:
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.
2024-04-24 04:10 AM
I have now installed the driver for the the CH340C and should be working.
I however do not see the Com port in the Device Manager.
Do I need to enable UART somewhere in the STM32IDE program?
Thank you.