2019-05-31 10:26 AM
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...
2019-06-06 01:39 PM
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.