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:

  1. Choose File > Import.
  2. Choose General > Existing Projects into Workspace and click Next.
  3. Click Browse next to Select archive file and select the file firmware ZIP file.
  4. Make sure that all projects are ticked in the Projects list.
  5. 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:

  1. To install, unzip the pacakge zipfile
  2. 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:

  1. Right click on the binary within the bin folder of the project.
  2. Choose Run As > Run Configurations
  3. Double click xCORE Application in the left panel
  4. Choose hardware in Device options and select the relevant XTAG-2 adapter
  5. Select the Run XScope output server check box.
  6. Click on Apply if configuration has changed
  7. Click on Run

Using the Command Line Tools

  1. Open the XMOS command line tools (Command Prompt) and execute the following command:
    xrun --xscope <binary>.xe
    
  2. If multiple XTAG2s are connected, obtain the adapter ID integer by executing:
    xrun -l
    
  3. Execute the xrun command with the adapter ID flag
    xrun --id <id> --xscope <binary>.xe
    

Installing the application onto flash

  1. 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:

  1. Start the xTIMEcomposer Studio and open the workspace created in Running the application.
  2. Right click on the binary within the bin folder of the project.
  3. Choose Flash As > Flash Configurations
  4. Double click xCORE Application in the left panel
  5. Choose hardware in Device options and select the relevant XTAG-2 adapter
  6. Click on Apply if configuration has changed
  7. Click on Flash

Using Command Line Tools

  1. Open the XMOS command line tools (Command Prompt) and execute the following command:
    xflash <binary>.xe
    
  2. If multiple XTAG2s are connected, obtain the adapter ID integer by executing:
    xrun -l
    
  3. 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.

See Also