Zynq Standalone USB device driver
This page gives an overview of the bare-metal driver support for theย Xilinxยฎ LogiCOREโข IP Zynq USB soft IP.ย
Table of Contents
Introduction
This page gives an overview of the Zynq usbps driver which available as part of the Xilinx Vivado and SDK distribution
For more information,
Please refer to Chapter 15: USB3.0 Controller inย Zynq7000 TRM
Driver Sources
The source code for the driver is included with the Vitis Unified Software Platform installation and being available in the Xilinx Github repository.ย
Driver Name | Path in Vitis | Path in Github |
---|---|---|
usbps | <Vitis Install Directory>/data/embedded/XilinxProcessorIPLib/drivers/usbps | https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/usbps |
Note: To view the sources for a particular release, use the rel-version tag in github.ย For example, for the 2020.1 release, the proper version of the code is:ย https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/usbps
The driver source code is organized into different folders.ย The table below shows the usbps driver source organization.ย
Directory | Description |
---|---|
doc | Provides the API and data structure details |
data | Driver .tcl, .mdd file and .yaml files |
examples | Example applications that show how to use the driver features |
src | Driver source files, make and cmakelists file |
Driver Implementation
For a full list of features supported by this IP,
Please refer to Chapter 15: USB3.0 Controller inย Zynq7000 TRM
Features Supported
Controller Features Supported
USB 2.0 High-Speed Host controller (480 Mb/s).
USB 2.0 HS and FS Device controller.
USB 1.1 legacy FS/LS.
On-the-Go, OTG 1.3 supplement.
Local DMA Engine.
Features Driver support
Support device mode only
Known Issues and Limitations:
Host mode is not supported by the standalone driver
OTG mode is not supported by the standalone driver
Example Applications
Refer to the driver examples directory for various example applications that exercise the different features of the driver. Each application is linked in the table below. The following sections describe the usage and expected output of the various applications.
These example applications can be imported into the Vitis IDE from the Board Support Package settings tab.ย
Links to Examples
Examples Path:
https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/usbps/examples
Test Name | Example Source | Description |
---|---|---|
USB Mass-Storage Gadget - Interrupt Mode | This example does a basic read and writes test from theย USB drive in interrupt mode. | |
USB Audio Gadget | This example supports two audio features in audio mode: 1.ย Audio UAC1.0 andย ย 2. Audio UAC2.0 |
ย
Example | Depandent source files (https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/usbps/examples) |
---|---|
xusbps_intr_example.c | xusbps_class_storage.c,xusbps_class_storage.h,xusbps_ch9_storage.c,xusbps_ch9_storage.h,xusbps_ch9.c,xusbps_ch9.h |
xusbps_audio_example.c | xusbps_ch9_audio.c,xusbps_ch9_audio.h,xusbps_ch9.c,xusbps_ch9.h,xusbps_class_audio.c,xusbps_class_audio.h,xusbps_audiodata.h |
Example Application Usage
USB 2.0 Peripheral Mode
The below gives the testing procedure of zynq USB standalone example which operates as a mass storage and audio gadget
Mass-Storage: USB Interrupt mode example
Mass storage profile can be tested by compilingย ย xusbps_class_storage.c,xusbps_class_storage.h,xusbps_ch9_storage.c,xusbps_ch9_storage.h,xusbps_ch9.c,xusbps_ch9.h andย xusbps_intr_example.c
files together
Testing procedure
Download and run the generated USB 2.0 example ELF
Connect board setup to standard host(Windows/Linux)machine USB 2.0 port.
Expected Output
You will get a pop-up window on the Window machine for formatting the size 256MB
After the format complete you can copy a file to the USB device
ย
Audio gadget
Audio profile can be tested by compiling xusbps_audio_example.c,xusbps_ch9_audio.c,xusbps_ch9_audio.h,xusbps_ch9.c,xusbps_ch9.h,
xusbps_class_audio.c,xusbps_class_audio.h and xusbps_audiodata.hย files.
Audio example supports either UAC1.0 or UAC2.0.By default audio example runs on UAC1.0.
Testing procedure
Download and run the generated USB 2.0 example ELF
Connect board setup to standard host(Windows/Linux)machine USB 2.0 port.
To enable UAC2.0ย support, undefine MACROย XUSBPS_UAC1 in xusbps_ch9_audio.h.ย ย
Expected Output
Device Log:
Audio UAC1.0 output at Host end
Detection of HighSpeed Microphone โ UAC1.0 onย standard host Linux machine USB 2.0 port.ย
2. Audio UAC2.0 Output:
UAC2.0 - Audio device detection and record/play an audio file from Host
Check device entry with help of โaplay -lโ or โarecord โlโย ย ย
First, play a file with help of โaplayโ command
host # aplay -v -D hw:1,0 -f S16_LE -r 48000 -c 2ย <uac2_0_play.wav>
Record a file with help of โarecordโ command
host # arecord -v -D hw:1,0 -f S16_LE -c 2 -r 44100 -d 10 <uac2_0_record.wav>
Example Design Architecture
Default Petalinux Design
Performance
The below performance results are observed using CrystalDiskMark tool on windows
USB 2.0:
Change Log
2024.2
embeddedsw/doc/ChangeLog at xlnx_rel_v2024.2 ยท Xilinx/embeddedsw ยท GitHub
2024.1
embeddedsw/doc/ChangeLog at xlnx_rel_v2024.1 ยท Xilinx/embeddedsw
2023.2
https://github.com/Xilinx/embeddedsw/blob/xlnx_rel_v2023.2/doc/ChangeLog#L318
2023.1
None
2022.2
None
2022.1
None
2021.2
None
2021.1
https://github.com/Xilinx/embeddedsw/blob/xilinx_v2021.1/doc/ChangeLog#L356
2020.2
https://github.com/Xilinx/embeddedsw/blob/xilinx-v2020.2/doc/ChangeLog#L718
2020.1
https://github.com/Xilinx/embeddedsw/blob/xilinx-v2020.1/doc/ChangeLog#L232
2019.1
https://github.com/Xilinx/embeddedsw/blob/xilinx-v2019.2/doc/ChangeLog#L548
2017.1
https://github.com/Xilinx/embeddedsw/blob/xilinx-v2017.1/doc/ChangeLog#L1647
2016.1
https://github.com/Xilinx/embeddedsw/blob/xilinx-v2016.1/doc/ChangeLog#L391
Related Links
Related content
ยฉ Copyright 2019 - 2022 Xilinx Inc. Privacy Policy