STM32 USB_CDC Configuration
Preface:
We have to have some preparation to do before:
1, PC upload virtual serial port driver more than a good VCP1.31
2, prepare a USB-STM32 (connected to the USB interface, not serial USB)
3, installed STM32CUBEMX, and Download the latest package of good STM32F1
4, installed keil / iar compiler, etc.
Configuration Roadmap
1, first configure the STM32 clock
2, Enabling USB devices
Note: If F4 and the like, not only has this option, but the name has not changed.
3, USB device is configured as a virtual port mode
4, to generate engineering and open, I use a 5.25 Keil
5, compile it lacks the problem, call the send function
Note: Do not forget to add in the main function in the header file
#include "usbd_cdc_if.h"
The final result: