cancel
Showing results for 
Search instead for 
Did you mean: 

Communicating with CP2104 Serial to USB Bridge via UART

LKuma.11
Associate

We are using STM32F429 to connect to an off board MPU device. The device outputs real-time sensor data through a CP2104 Serial to USB bridge. Required baud rate is 1,000,000. We are able to communicate with this device fine on a windows machine using off-the-shelf serial-to-usb CP2104 driver. However, when we connect the usb pins to UART pins on the STM32F429, we get absolutely nothing. We have tried to use CDC and UART_DMA but nothing works. Can we have some direction on how to accomplish this communication link?

2 REPLIES 2
TDK
Guru

Which side of the CP2104 is connected to the STM32? If this is the USB side, you'll need to use the STM32's USB peripheral. If the UART, then a UART peripheral. Assuming you're communicating with the UART side:

> Can we have some direction on how to accomplish this communication link?

Configure the UART right, make sure the pins are initialized correctly, and use the HAL UART calls to read/write to the device. Write a single character out on UART and observe the signal on a scope.

None of this is CP2104 specific. The STM32 just sees a UART.

> usb pins to UART pins on the STM32F429, we get absolutely nothing

I hope this is a typo and you mean the UART pins of the CP2104 to the UART pins of the STM32. Connecting USB pins to UART pins is nonsense.

If you feel a post has answered your question, please click "Accept as Solution".
andrewg
Associate III

USB CDC is one way to do it, you can try with things like stm32duino

no need for UART, dongles etc

https://www.stm32duino.com/

https://github.com/stm32duino/Arduino_Core_STM32 < this is the official core

https://github.com/rogerclarkmelbourne/Arduino_STM32

those has USB CDC as the serial virtual comm port normally

if you bother to jump through the hoops to do a ulpi usb 2.0 high speed transciever, those can goto 480 Mbps. that needs lots of venture to the road less traveled and you may hit bummers all along the way.

optimizing USB CDC is an art, there are real usb limits which would make the transmissions lumpy

usb-uart dongles has its own share of problems on top of just usb.

sometimes it isn't the fault of the device as the host may impose limitations.