2020-07-01 10:10 AM
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?
2020-07-01 03:34 PM
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.
2020-07-02 01:21 PM
USB CDC is one way to do it, you can try with things like stm32duino
no need for UART, dongles etc
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.