1/19/2024 0 Comments Stm32 cdc driver windows 10The example was compiled for STM32F103C8 (blue pill). You can find an example on how to use the library in the "Example" folder. Variable set to 1 when a packet is received from the virtual serial port. The packet will be copied in the "Received_Data" array, and the leght of the packet will be written in the variable pointed by "len". Read a packet received from the virtual serial port and enable the port to receive a new packet. Read_VCP(uint8_t* Received_data, uint32_t* len) It's not always necessary to call this function after sending some data, but you have to wait until the variable "VCP_Transmitted" goes to 1 before sending new data, otherwise you will overwrite the old data. Wait until a packet has been completely transmitted on the virtual serial port. Variable set to 1 when a packet has been completely transmitted on the virtual serial port. Send a packet of size "len", that contains the data stored in the "data" array, on the virtual serial port. USB clock, GPIO, PMA, transceiver and interrupts initialization. Use the USER Functions to receive and transmit data on the Virtual Serial Port. #include "USB-VCP.h" in your "main.c" file.Ĭall the "USBInit() " function at the begginning of your main.Ĭall the "USB_MANAGEMENT() " function inside your while(1) loop in main. (Alternatively use my function "ClockInit()" in the example code, you will find it's definition in "RCC_CLOCK.h", in folder Core/Inc). HOW TO USE THE LIBRARY WITH STM32CubeIdeĬreate a new project for your STM32 MCU (you don't need to enable anything about the USB peripheral, the library will do everything). The library was compiled and tested for STM32F103RB and STM32F103C8 (Blue Pill). I compiled the library with STM32CubeIde 1.3.0 on Windows 10, but it could be compiled with Arduino or gcc-arm-none-eabi stand alone because it doesn't have any I designed the library to be light, independet and easy to use as much as possible. This library initialize and manage completely the USB peripheral, USB control transfers and packets exchange. The communication with the serial port can be handled with YAT, PuTTY, Arduino Serial Monitor and other serial terminals. This library allows to connect an STM32F103XX to a PC, through USB, be recognised as an USB Virtual Serial Port andĬommunicate as if it were a standard serial COM port. Welcome to my STM32F103XX USB Device and Virtual Serial Port (VCP) library. STM32F103XX USB Device and Virtual Serial Port (VCP) library.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |