Programming Guide
Getting Started
The following instructions explain how to build the demo for the XR-AVB-LC-BRD endpoint.
To install the software, open the xTIMEcomposer Studio and follow these steps:
- Choose File > Import.
- Choose General > Existing Projects into Workspace and click Next.
- Click Browse next to Select archive file and select the file firmware ZIP file.
- Make sure that all projects are ticked in the Projects list.
- Click Finish.
To build, select the app_simple_avb_demo project in the Project Explorer and click the Build icon.
From the command line, you can follow these steps:
- To install, unzip the pacakge zipfile
- To build, change into the app_simple_avb_demo directory and
execute the command:
xmake all
Makefiles
The main Makefile for the project is in the app_simple_avb_demo directory. This file specifies build options and used modules.
Running the application
To upgrade the firmware you must, firstly connect the XTAG-2 to the relevant development board and plug the XTAG-2 into your PC or Mac.
Using the XMOS xTIMEcomposer Studio
Using the 12.0.0 tools or later and AVB version 5.2.0 or later, from within the xTIMEcomposer Studio:
- Right click on the binary within the bin folder of the project.
- Choose Run As > Run Configurations
- Double click xCORE Application in the left panel
- Choose hardware in Device options and select the relevant XTAG-2 adapter
- Select the Run XScope output server check box.
- Click on Apply if configuration has changed
- Click on Run
Using the Command Line Tools
- Open the XMOS command line tools (Command Prompt) and
execute the following command:
xrun --xscope <binary>.xe
- If multiple XTAG2s are connected, obtain the adapter ID integer by executing:
xrun -l
- Execute the xrun command with the adapter ID flag
xrun --id <id> --xscope <binary>.xe
Installing the application onto flash
- Connect the XTAG-2 debug adapter to the relevant development board, then plug the XTAG-2 into your PC or Mac.
Using the XMOS xTIMEcomposer Studio
To upgrade the flash from the xTIMEcomposer Studio, follow these steps:
- Start the xTIMEcomposer Studio and open the workspace created in Running the application.
- Right click on the binary within the bin folder of the project.
- Choose Flash As > Flash Configurations
- Double click xCORE Application in the left panel
- Choose hardware in Device options and select the relevant XTAG-2 adapter
- Click on Apply if configuration has changed
- Click on Flash
Using Command Line Tools
- Open the XMOS command line tools (Command Prompt) and
execute the following command:
xflash <binary>.xe
- If multiple XTAG2s are connected, obtain the adapter ID integer by executing:
xrun -l
- Execute the xflash command with the adapter ID flag
xflash --id <id> <binary>.xe
Source code structure
Directory Structure
The source code is split into several top-level directories which are presented as separate projects in xTIMEcomposer Studio. These are split into modules and applications.
Applications build into a single executable using the source code from the modules. The modules used by an application are specified using the USED_MODULES variable in the application Makefile. For more details on this module structure please see the XMOS build system documentation.
The source package contains a simple demonstration application app_simple_avb_demo that can be run on different hardware targets.
Some support modules originate in other repositories:
Directory |
Description |
Repository |
---|---|---|
module_ethernet |
Ethernet MAC |
sc_ethernet |
module_ethernet_board_support |
Hardware specific board configuration for Ethernet MAC |
sc_ethernet |
module_i2c_simple |
Two wire configuration protocol code. |
sc_i2c |
module_random |
Random number generator |
sc_util |
The following modules contain the core AVB code and are needed by every application:
Directory |
Description |
---|---|
module_avb |
Main AVB code for control and configuration. |
module_avb_1722 |
IEEE 1722 transport (listener and talker functionality). |
module_avb_1722_1 |
IEEE P1722.1 AVB control protocol. |
module_avb_1722_maap |
IEEE 1722 MAAP - Multicast address allocation code. |
module_avb_audio |
Code for media FIFOs and audio hardware interfaces (I2S/TDM etc). |
module_avb_media_clock |
Media clock server code for clock recovery. |
module_avb_srp |
802.1Qat stream reservation (SRP/MRP/MVRP) code. |
module_avb_util |
General utility functions used by all modules. |
module_gptp |
802.1AS Precision Time Protocol code. |
Key Files
File |
Description |
---|---|
avb_api.h |
Header file containing declarations for the core AVB control API. |
avb_1722_1_app_hooks.h |
Header file containing declarations for hooks into 1722.1 |
ethernet_rx_client.h |
Header file for clients that require direct access to the ethernet MAC (RX). |
ethernet_tx_client.h |
Header file for clients that require direct access to the ethernet MAC (TX). |
gptp.h |
Header file for access to the PTP server. |
audio_i2s.h |
Header file containing the I2S audio component. |