SDK for ZTEX USB-FPGA-Modules
ZTEX provides a Open Source SDK which is especially designed for the ZTEX modules, but also works with other EZ-USB based hardware.
The package is Open Source and distributed under the GPLv3.
The package is known to work under Linux and Windows, but should work on every operating system which supports libusb and Java. The Java API allows the development of platform-independent host software.
Features
The main features are:
- Firmware Kit (for EZ-USB Microcontrollers) is written in C (requires SDCC compiler).
- Firmware is assembled using a powerful macro processor which allows to specify
all required settings by a few macros. The necessary USB descriptors and
the descriptor handling routines are generated automatically.
- Host software API is written in Java and allows platform independent host software. It is possible to pack all necessary files (libusb libraries, firmware, bitstream) into
one single jar archive which runs on both, Linux and Windows (and other OS's that support libusb and Java)
- Licensed as Open Source under GPLv3
- Main functions of the Firmware Kit / Java API are:
- Firmware upload directly into the EZ-USB Microcontroller
- Access to EEPROM memory
- Firmware upload to EEPROM
- Access to microSD/*SD/MMC Flash cards in SPI mode
- Bitstream upload directly to the FPGA
- Bitstream upload to Flash memory and autonomous FPGA configuration using Bitstream from Flash memory
SDK overview
The following diagram gives an overview about the usage of the different parts of the ZTEX EZ-USB SDK.
The firmware of the EZ-USB device is developed using the Firmware Development Kit. It can be uploaded either
by a utility which is a part of the SDK or by the host software itself using the Java API.
The host software usually consists of a single jar archive which contains
- all necessary Java bytecode;
- the libusb Java wrapper libraries for Linux (libusbJava.so) and Windows (libusbJava.dll), which are statically linked against libusb (no libusb installation required);
- the firmware for the EZ-USB device (unless not installed in EEPROM);
- Bitstream for the FPGA (if required).
This single jar archive runs on both, Linux and Windows (or other OS's that support libusb and Java).
On Linux this jar archive has no additional software requirements. The libusb(Java) library communicates directly with the EZ-USB device using kernel routines.
On Windows a libusb driver is required. (This driver is a part of the ZTEX SDK package). The libusb(Java) library communicates with the EZ-USB device using that driver.
Other programming languages
Devices with ZTEX firmware can be accessed easily with all programming languages for which a libusb port exists.
But unlike Java, then there are no routines for uploading the firmware and the bitstream available so that
the
FWLoader included in the SDK has to be used.
Examples
The SDK contains the following examples for ZTEX USB-FPGA-Modules 1.2:
Location |
Description |
examples/usb-fpga-1.2/flashbench |
Flash memory benchmark for ZTEX USB-FPGA-Modules 1.2 |
examples/usb-fpga-1.2/flashdemo |
Demo for Flash memory access from firmware and host software for ZTEX USB-FPGA-Modules 1.2 |
examples/usb-fpga-1.2/intraffic |
Example showing how the EZ-USB FIFO interface is used on ZTEX USB-FPGA-Modules 1.2 |
examples/usb-fpga-1.2/standalone |
Standalone example firmware that supports FPGA configuration from FLASH and firmware loading from EEPROM for ZTEX USB-FPGA-Modules 1.2 |
examples/usb-fpga-1.2/ucecho |
ucecho – uppercase conversion example for ZTEX USB-FPGA-Modules 1.2 |
Additional resources