Skip to main content
TJohn.14
Associate
May 31, 2019
Question

USB Serial firmware example for STM32F303CBT6?

  • May 31, 2019
  • 1 reply
  • 808 views

Is there example code for using the Virtual Port Com from CubeMX?

(Determine baud, rxchar, txchar [preferably with DMA], CD, etc)

I found this: https://damogranlabs.com/2018/02/stm32-usb-cdc/

and it looks like a good starting point, but even though I can /see/ the com port in device manager (Com8, and I can change the baud rate and it remembers), I can't open it in TeraTerm or my modbus utility.

It /is/ showing up in the WMI, but it doesn't show up in TeraTerm...

This topic has been closed for replies.

1 reply

TJohn.14
TJohn.14Author
Associate
June 6, 2019

A-ha!

There was too much of a delay between "plugging in" (where the resistor would pull the DP high) and the MX_USB_DEVICE_Init() call, so the PC was getting confused.

I added some code to hold the DM and DP lines low for 1 second (forcing an "unplug "), just before the MX_USB_DEVICE_Init, and now it's working well.