![]() ![]() Endpoints could be seen as buffers inside devices, that have a specific purpose. c file, generated CDC contains 2 data endpoints (IN and OUT) and 1 control endpoint. You don’t really need to change anything for now, but there are many descriptor fields that can be modified.Īs it is stated at the top of the. This is set with CubeMX so don’t change this defines. USB configuration defines in usbd_conf.h.More about file hierarchy can be found in STM32Cube USB device library user manual.įiles to modify CDC to our custom needs are: usbd_cdc_if.c (provides application read/write functions).usbd_desc.c (provides USB device descriptors).usbd_device.c (provides initializing function called from main()).usbd_conf.c (provides low layer / HAL functions).usbd_cdc.c (provides everything to interact with USB host, descriptors, data IO …).usbd_ioreq.c, usbd_ctlreq.c (provides everything for endpoint controls and USB request).usbd_core.c (provides all USB device core functions).More about endpoints later.Īgain, USB files contains “settings for CDC” in this files: ![]() To generate basic USB CDC device with CubeMX, follow this previous post, but change Middleware USB profile to CDC. So, here it is, STM32 USB CDC – communication with PC over USB, generated with STM32CubeMX on STM32L100 discovery board. Although this devices were mostly prototypes and/or single products, such approach added unwanted costs and since almost all uC that I used already have USB peripheral embedded, there is no excuse not to use it. By now almost all of my projects included some sort of communication with PC, mostly with external USB-UART bridge chip like MCP2200 or CP210x.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |