You need to implement the device stack as an ACC CDC device (also known as a virtual COM port or VCP). Most USB microcontroller manufacturers have sample code or application notes.
Given this, your device will look like a COM port, as far as Windows is concerned. At the end of the device, you will receive raw blocks of transmitted data. An appropriate level of abstraction can be implemented for both UART and USB interfaces to provide the same interface if necessary.
One of them: USB devices require a vendor identifier, allocated by the USB Developer Forum, at $ 5,000 for a fee (fix 23 JUly 2016). If you are going to release your device in the wild, you really need to if your device needs to be recognized and behave correctly with other devices. Some microcontroller manufacturers will allow you to use your vendor identifier for a subset of product identifiers for free or at a lower cost, but they can only do this if you buy a significant number of devices from them.
Another problem is that, although on OSX or Linux, CDC / ACM is recognized without any additional drivers, Windows is more fussy and requires an INF file to associate a specific USB provider and product identifier with the usbser.sys driver. Then you get into the world of driver signing, which is necessary when using Windows Vista 64 or any version of Windows 7. Signing a code signature will also cost you money. If your vendor has provided sample VCP code, it is also likely to provide a signed driver. STMicroelectronios STM32 The VCP example is even WHQL certified, so it can be obtained automatically through Windows Update.
So, the result is that for experimentation you can do this if your vendor already provides code and a signed driver (or you are not using Windows), but to deploy the product you need a vendor identifier and a code signing certificate, Honestly, this is a mine field.
A simpler approach is to use the FTDI USB ↔ Serial chip. This is especially useful for a microcontroller without its own USB controller, but the data transfer speed will be limited by the micro and / or FTDI UART interface, and not by the USB speed. You can use the FTDI chip somehow using the FTDI VID / PID, or you can configure it using your VID / PID. Customizing returns your VID and signature certificate, but allows you to identify your device uniquely, rather than as a shared serial port.
Clifford
source share