GEX core repository.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
gex-core/USB
Ondřej Hruška 2812f962d9
added watchdog
7 years ago
..
STM32_USB_Device_Library massive utils refactoring, renames, avr libc utils cleaning 7 years ago
README.TXT everything is now documented 7 years ago
usb_device.c added watchdog 7 years ago
usb_device.h add usb re-plug functionality to F072 7 years ago
usbd_cdc_if.c removed some escessive checks 7 years ago
usbd_cdc_if.h Code import 7 years ago
usbd_conf.c implemented timebase using TIM14 instead of TIM1 7 years ago
usbd_conf.h implemented timebase using TIM14 instead of TIM1 7 years ago
usbd_desc.c take some steps towards reducing memory footprint in stack buffers 7 years ago
usbd_desc.h Code import 7 years ago
usbd_storage_if.c reworked the indicator engine to better support patterns 7 years ago
usbd_storage_if.h Code import 7 years ago

README.TXT

USB support is implemented using the STM32 USB Device library.

The library is copied into the core project to make customizations easier to maintain
across different ports. The USBD library supports all versions of the HAL and LL.

GEX uses USB classes CDC/ACM and MSC/SCSI.
The two classes are combined into a composite class with association descriptors.

USB interrupts are processed by the USBD library and endpoint callbacks in the composite
class are fired. To avoid race conditions (and because DAPlink did it the same way), the
events are notified to the USB thread (TaskMain) which calls endpoint handlers in the
corresponding class drivers.

VFS is handled synchronously on the main thread. CDC messages (TinyFrame data) are queued
and processed by the message queue thread. This makes it possible to query hardware
(e.g. slow USART or NeoPixel) without stalling the USB communication. This arrangement
also makes it possible to wait on a binary semaphore when sending data back to host. The
semaphore is set from the CDC TxComplete callback and taken by the TinyFrame write
function, serving as a form of flow control.