cancel
Showing results for 
Search instead for 
Did you mean: 

USB Serial firmware example for STM32F303CBT6?

TJohn.14
Associate II

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...

1 REPLY 1
TJohn.14
Associate II

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.