cancel
Showing results for 
Search instead for 
Did you mean: 

How can I run a USART project using Virtual Com Port in STM32F4 Discovery ?

tuandanh
Associate
Posted on March 24, 2014 at 17:48

Hi everyone, 

 I am a newbie with the KIT STM32F4 Discovery. So, now I want to use USART to send and receive data through Virtual Com Port (using Micro USB) but I have some problems with this. I can't find any COM in Device Manager in the PC. I 've read many threads about this problem but now, It's only a mess in my mind. So, someone please tells me Steps to run the USART project. one more question,  are there any libraries for this ? My English is bad , so please forgive me if I say anything wrong. Thank you very much. 0690X00000605XxQAI.png0690X00000605Y2QAI.png

#usart #rs232
5 REPLIES 5
chen
Associate II
Posted on March 27, 2014 at 18:35

Hi

'' I am a newbie with the KIT STM32F4 Discovery. So, now I want to use USART to send and receive data through Virtual Com Port''

You cannot!

The USART is a physical RS232 port. It must connect to another UART of some kind.

(The USART only works to Vdd 3.3V - you MUST use a RS232 level converter such as a MAX232 to connect with another RS232 port)

You can get USB to RS232 cables which will plug into your PC.

Then, you can connect the STM32 USART to PC via this converter.

OR

VCP - is RS232 emulated through USB. This requires the STM32 to implement a USB device - the CDC device from the USB OTG library.

You can then connect the USB of the STM32 directly to the USB on your PC and it will appear as a VCP device.

Posted on March 28, 2014 at 04:36

The v19 firmware for the ST-LINK used in the Nucleo F401RE does provide for a USB USART connection. This firmware might provide a means to do this on Discovery boards, I might experiment with this during the week.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
bnp979
Associate III
Posted on October 09, 2014 at 00:24

Clive,

I have a related question. I have a STM32L0 Discovery board and I am trying to communicate using the USART on the L0 uC to my laptop using the virtual COM port.

The Discovery board documentation says:

---------------------------------------------

The USART1 interface available on PA9 and PA10 of the STM32L053C8T6 can be

connected to ST-LINK MCU to use the Virtual Com Port function.

By default the USART1 communication between the target STM32L053C8T6 and ST-LINK

MCU is not enabled.

To use the Virtual Com Port function with:

• The onboard STM32L053C8T6, then set SB2 and SB3 ON.

-----------------------------------------

I have closed the SB2 and SB3 solder bridges on the board. Is there anything I need to do in my L0 uC software in order to enable my USART communication to show up on the virtual COM port on my PC? Or is all the necessary firmware to do the RS232 to USB mapping included in the ST-LINK hardware on the board, implying that I don't have to do anything in the software that goes into my L0 chip?

Thanks,

Ben

Posted on October 09, 2014 at 00:36

I don't have an STM32L0-DISCO board, on the Nucleo boards a serial port shows up in Device Manage via the ST-LINK attachment. You then code your STM32 code to configure the USART and pins, and then data sent to the USART, which can then be seen via the COMx assigned on the PC

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist
Posted on October 09, 2014 at 01:00

''The USART is a physical RS232 port''

Err ... no, it is

not

!

You need to add an RS232 Transceiver  (sometimes known as a ''level translator'') to make it into an RS232 port!