cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F3DISCOVERY UART communication with a PC

pav_ivanovs
Associate II

Hi,

I'm trying to create my custom UART firmware on STM32F3DISCOVERY board. Since I wrote the Transmit part of the driver and I verified that it continuously writes words to the USART_TDR register, I was going to check whether the UART messages are actually outputted from the MCU pins.

So far the plan is just to continuously spam some messages via PC4 pin to the on-board ST-link debugger. Since I know that I have a PCB version C, the on-board debugger should be of version ST-LINK/V2-B, meaning that it has virtual COM port interface on USB.

My main question is, do I understand it correctly, that just by sending  some UART messages from the MCU pin PC4 to debugger, the virtual COM port of the debugger shall automatically re-send these messages to a PC, where I should be able to read them with some UART compatible terminal (e.g. PuTTy, Serial Debug Assistant, etc.)?

Or am I missing some more steps? Like, are there some other steps involved to make the on-board debugger to re-send UART messages via USB COM port?

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

@pav_ivanovsAnd be sure to set the correct baudrate, parity etc. on both STM32 and PC sides. This is critical.

the on-board debugger should be of version ST-LINK/V2-B, meaning that it has virtual COM port interface on USB.

This is very easy to see. Open the device manager and plug the board into USB port. Two devices should appear: the ST-LINK and VCP UART. A disk device can come too. If you don't see the UART, the ST-LINK does not support it.

View solution in original post

5 REPLIES 5
Andrew Neil
Evangelist III

@pav_ivanovs wrote:

do I understand it correctly, that just by sending  some UART messages from the MCU pin PC4 to debugger, the virtual COM port of the debugger shall automatically re-send these messages to a PC, where I should be able to read them with some UART compatible terminal (e.g. PuTTy, Serial Debug Assistant, etc.)?


Yes.

Pavel A.
Evangelist III

@pav_ivanovsAnd be sure to set the correct baudrate, parity etc. on both STM32 and PC sides. This is critical.

the on-board debugger should be of version ST-LINK/V2-B, meaning that it has virtual COM port interface on USB.

This is very easy to see. Open the device manager and plug the board into USB port. Two devices should appear: the ST-LINK and VCP UART. A disk device can come too. If you don't see the UART, the ST-LINK does not support it.

pav_ivanovs_0-1712902998459.png

When I plug my STM32F3DISCOVERY board, I get 3 new devices: ST-Link Debug, USB Composite Device and STLink Virtual COM port (COM3). Shouldn't the general Virtual COM Port be capable of transmitting UART messages, or do I need exactly VCP UART?

COM3 is your VCP.

 

Putty, Docklight or even the built in serial terminal that STM32CubeIDE has will work to receive from the MCU. 

 

I Can't Believe It's Not Butter. If you find my answers useful, click the accept button so that way others can see the solution.
pav_ivanovs
Associate II

Alright, thanks everyone for the answers, after some debugging, I made it to work just as you said.