Brak opisu

Dmitry Filimonchuk 624dbab1c5 Merge pull request #112 from vvg77ripe/master 4 lat temu
.github 57dc429786 moved to github-ci (#85) 5 lat temu
demo 9a82199f2c Add F411E demo, macro fixes 4 lat temu
inc 3a17fd9e7e HID consumer page 4 lat temu
src ad265895ea Fix PMA offset in F103 ASM driver 4 lat temu
.gitattributes e2ee6942b3 Added .gitattributes 9 lat temu
.gitignore 494e496a07 fix multithread build 6 lat temu
Doxyfile 68dfeea293 Renamed request completed callback function, revised doxygen docs 9 lat temu
LICENSE 0940e38eb5 Initial commit 9 lat temu
Makefile 9a82199f2c Add F411E demo, macro fixes 4 lat temu
hardware.md 92179904a6 STM32F401xE Demo (#89) 5 lat temu
readme.md fe3890e10e Add support for STM32WB55 4 lat temu

readme.md

LNX build WIN build OSX build

Lightweight USB Device Stack

  • Lightweight and fast
  • Event-driven process workflow
  • Completely separated USB hardware driver and usb core
  • Easy to use.

Requirements

All requirements can be downloaded into a directory specified in environment variable CMSIS using make cmsis command.

Supported hardware

MCU SeriesFeaturesDriverFile
STM32L0x2 STM32L0x3 STM32F070 STM32F0x2 STM32F0x8 Doublebuffered[2]
8[1] endpoints
BC1.2
usbd_devfs usbd_stm32l052_devfs.c
usbd_devfs_asm usbd_stm32l052_devfs_asm.S
STM32L4x2 STM32L4x3 STM32G4 series Doublebuffered[2]
8[1] endpoints
BC1.2
usbd_devfs usbd_stm32l433_devfs.c
usbd_devfs_asm usbd_stm32l052_devfs_asm.S
STM32L1xx Doublebuffered[2]
8[1] endpoints
usbd_devfs usbd_stm32l100_devfs.c
usbd_devfs_asm usbd_stm32l100_devfs_asm.S
STM32F102 STM32F103 STM32F302 STM32F303 STM32F373 Doublebuffered[2]
External DP pullup
8[1] endpoints
usbd_devfs usbd_stm32f103_devfs.c
usbd_devfs_asm usbd_stm32f103_devfs_asm.S
STM32WB55 Doublebuffered[2]
External DP pullup
8[1] endpoints
usbd_devfs usbd_stm32wb55_devfs.c
STM32L4x5 STM32L4x6 Doublebuffered
6 endpoints
BC1.2
VBUS detection
usbd_otgfs usbd_stm32l476_otgfs.c
STM32F401 STM32F411 Doublebuffered
4 endpoints
VBUS detection
SOF output
usbd_otgfs usbd_stm32f429_otgfs.c
STM32F4x5 STM32F4x7 STM32F4x9 Doublebuffered
4 endpoints
VBUS detection
SOF output
usbd_otgfs usbd_stm32f429_otgfs.c
Doublebuffered
6 endpoints
VBUS detection
SOF output
usbd_otghs usbd_stm32f429_otghs.c
STM32F105 STM32F107 Doublebuffered
4 endpoints
VBUS detection
SOF output
usbd_otgfs usbd_stm32f105_otgfs.c
STM32F4x6 STM32F7 Doublebuffered
6 endpoints
VBUS detection
SOF output
usbd_otgfs usbd_stm32f446_otgfs.c
Doublebuffered
9 endpoints
VBUS detection
SOF output
usbd_otghs usbd_stm32f446_otghs.c
  1. Single physical endpoint can be used to implement

    • one bi-directional/single-buffer logical endpoint (CONTROL)
    • one uni-directional/double-buffer logical endpoint (BULK OR ISOCHRONOUS)
    • two uni-directional/single-buffer logical endpoints (BULK OR INTERRUPT)
  2. At this moment BULK IN endpoint can use both buffers, but it is not real doublebuffered.

  3. Tested with STM32L052K8, STM32L100RC, STM32L476RG, STM32F072C8, STM32F103C8, STM32F103CB, STM32F303CC, STM32F303RE, STM32F429ZI, STM32F105RBT6, STM32F107VCT6, STM32L433CCT6, STM32F070CBT6, STM32G431RB, STM32F411CEUx, STM32F405RG, STM32F446RE, STM32F373CC, STM32L053R8, GD32F103C8T6, STM32F745VE, STM32F401CE. See hardware.md for details.

Implemented definitions for classes

  1. USB HID based on Device Class Definition for Human Interface Devices (HID) Version 1.11
  2. USB DFU based on USB Device Firmware Upgrade Specification, Revision 1.1
  3. USB CDC based on Class definitions for Communication Devices 1.2
  4. USB TMC based on USB Device Test and Measurement Class Specification, Revision 1.0

Using makefile

  • to build library module

    make module MODULE=path/module.a DEFINES="mcu specified defines" CFLAGS="cpu specified compiler flags"
    
  • to build demo

    make bluepill program
    make stm32l052x8
    
  • to get a help

    make help
    

Default values:

Variable Default Value Means
CMSIS ./CMSIS path to CMSIS root folder
CMSISDEV $(CMSIS)/Device path to CMSIS device folder
CMSISCORE $(CMSIS)/CMSIS/Include $(CMSIS)/CMSIS/Core/Include path to CMSIS core headers
MCU stm32l100xc MCU selection for demo project
CFLAGS -mcpu=cortex-m3 -mfloat-abi=soft MCU specified compiler flags
DEFINES STM32L1 STM32L100xC MCU specified defines
STPROG_CLI ~/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI Path to the ST Cube Programmer CLI
OPTFLAGS -Os Code optimization flags

Useful Resources

  1. USB Implementers Forum official site
  2. USB Made Simple
  3. LUFA - the Lightweight USB Framework for AVRs.
  4. Open Source ARM cortex m microcontroller library