#usb #embedded #no-std

no-std synopsys-usb-otg

'usb-device' implementation for Synopsys USB OTG IP cores

10 releases

0.4.0 Nov 19, 2023
0.3.2 Jan 14, 2023
0.3.1 Oct 6, 2022
0.3.0 Jan 4, 2022
0.1.0 Feb 12, 2020

#233 in Hardware support

Download history 574/week @ 2023-12-04 301/week @ 2023-12-11 277/week @ 2023-12-18 125/week @ 2023-12-25 126/week @ 2024-01-01 518/week @ 2024-01-08 416/week @ 2024-01-15 524/week @ 2024-01-22 369/week @ 2024-01-29 350/week @ 2024-02-05 298/week @ 2024-02-12 304/week @ 2024-02-19 537/week @ 2024-02-26 409/week @ 2024-03-04 365/week @ 2024-03-11 482/week @ 2024-03-18

1,823 downloads per month
Used in 11 crates (5 directly)

MIT license

425KB
8K SLoC

crates.io crates.io Build Status

synopsys-usb-otg

usb-device implementation for Synopsys USB OTG IP cores.

This project is a successor to the great work started by @mvirkkunen.

Supported microcontrollers

  • STM32F429xx (OTG_FS and OTG_HS in FS mode)
  • STM32F401xx
  • STM32F446xx (OTG_FS and OTG_HS in FS mode)
  • STM32F723xx (OTG_FS and OTG_HS with internal HS PHY)
  • STM32H7xxxx (OTG1_HS and OTG2_HS in FS mode, and OTG1_HS with external HS PHY)
  • And others...

Usage

This driver is intended for use through a device hal library. Such hal library should implement UsbPeripheral for the corresponding USB peripheral object. This trait declares all the peripheral properties that may vary from one device family to the other. Additionally, hal should pass fs of hs feature to the synopsys-usb-otg library to define a peripheral type:

  • fs - for FullSpeed peripherals
  • hs - for HighSpeed peripherals

Only one peripheral type can be selected at the moment.

ULPI Transciever Delay

Some ULPI PHYs like the Microchip USB334x series require a delay between the ULPI register write that initiates the HS Chirp and the subsequent transmit command, otherwise the HS Chirp does not get executed and the deivce enumerates in FS mode. Some USB Link IP like those in the STM32H7 series support adding this delay to work with the affected PHYs. Enable the xcvrdly feature to add this delay.

Examples

See the usb-otg-workspace repo for different device-specific examples.

Dependencies

~1.5MB
~31K SLoC