cancel
Showing results for 
Search instead for 
Did you mean: 

How to use UART to connect STM32F407VG Discovery board with Windows PC

KChan.17
Associate II

Hi,

I'm trying to use STM32F407 to develop​ bluetooth audio device. I use the cc2564c bluetooth board and CC256XEM-STADAPT board made by Texas Instruments. Now I need to use UART2 to connect the STM32 board with PC, but the PA2 and PA3 pins are used by the CC256XEM-STADAPT board. I'm trying to find an alternative.

Accroding to ​this artical, I think I should refer to the TWO PIECES OF WIRE part.

Refer to user manual, the PA2/PA3 should be soldered with U2 pin12/pin13.0693W00000JPFVtQAP.png​Is that recommended?

If I do so, that means I can use micro usb to connect the PC with virtual com port and send data through UART2?

To my knowledge, the STM32F407VG Discovery board is not recommended for audio applications and STM3240G-EVAL is recommended. Should I change to use STM3240G-EVAL?

My English is not good. Please forgive me if I said anything wrong.

​Sincerely.

10 REPLIES 10
KnarfB
Principal III

If you stick to the "two wires", there are alternative pins available. If you develop your software with STM32CubeIDE/CubeMX, you can find it out in the graphical pinout view. You might also use any avail. UART, not only UART2. Check the board schematics to find out how the pins are connected.

> board is not recommended for audio applications

Well, the F407 disco is not a new board, that why you have to patch the two wires. Modern boards have the UART connection built-in (ST-LINK v2.1). It all depends on what your software needs to do in the STM32 MCU and what peripherals you need. The EVAL boards carry much peripherals but also a heavier price tag. Think the STM3240G-EVAL is the same generation of boards and has also only ST-LINK v2, not 2.1, so you also have to hand-wire the UART.

hth

KnarfB

As KnarfB said, yes, this board is older and was not updated to connect the serial lines.

But, first, are you sure you have the newer variant, with STLinkV2-1, i.e. do you "see" the virtual COM port in PC?

> To my knowledge, the STM32F407VG Discovery board is not recommended for audio applications

Why not? And what exactly do you mean by "audio applications"?

JW

ssipa.1
Associate II

the STM32F4 discovery board comes with an STM32F407VG6T microcontroller. Like other STM32 family microcontrollers, this SoC also supports UART communication ports. STM32F407VG6T has on-chip 4 USARTs/2 UARTs communication channels. Each UART channel shares general-purpose input-output pins to transmit and receive data to/from external UART based devices. That means Rx and Tx pins of each UART port have shared alternate functions with GPIO pins. In short, an STM32F4 discovery board supports 8 UART/USART communication channels. 

Thanks for your reply.

I'm trying the source code provided by​ Texas Instruments and it use UART2. I just want to know wether it works or not. So I can patch the two wires and connect with PC via UART with a micro usb wire right?

If F407 disco is not new, could you give me some advice of a new board? I want to develop a bluetooth audio player, which can connect with phone and play music through speakers.

Sincerely.

Thanks for your reply.

I follow a youtube tutorial that using USB_OTG_FS. I can see the virtual COM port in COM&LPT. But if I programe other code, it will disappear.

When I checking the user guide of cc2564c, I found a NOTE as follow,0693W00000JPLy8QAH.pngI need to try some of the Demo, so I want to know if I should buy a new board or not.

Sincerely.

Thanks for your reply.

I'm trying a source code and it uses UART2. I want to know wether the TWO PIECES OF WIRE method could work or not. Is it means I could connect the PC via UART with a micro usb if the method works?

Sincerely.

The "two wires" connent RX and TX lines from a MCU UART to the ST-LINK debug chip (top). USB_OTG_FS is not involved here, any UART can be used if its RX and TX can be accessed without conflicts. The ST-LINK debug chip then will tunnel the serial data from/to a PC serial (COM) port. This feature was added later and may be not present on your board, see Overview of ST-LINK derivatives - Technical note.

hth

KnarfB

Is that means I could directly connect UART and PC with a new version ST-LINK?

So, if I buy a new board with ST-LINK/V2-1 or newer version of ST-LINK, my problem might be solved?

Sincerely.

Right, using ST-LINK virtual com port facility. But, this is a USB serial port, not an audio class USB device.

hth

KnarfB