Contents Menu Expand Light mode Dark mode Auto light/dark mode
XCORE Software Development Kit 1.0.0
Logo
XCORE Software Development Kit 1.0.0
  • XCORE-IOT Programming Guide
    • Installation
    • Getting Started Tutorials
    • Advanced Tutorials
      • Platform
      • Bare-Metal
        • Bare-metal Code Examples
          • Explorer Board
      • FreeRTOS
        • FreeRTOS Code Examples
          • Audio Mux
          • Device Control
          • DFU
          • Explorer Board
          • IoT
          • Building the firmware
          • Setting up the hardware
          • Running the firmware
          • Building the firmware
          • Setting up the hardware
          • Running the firmware
          • L2 Cache Example
          • Tracealyzer Example
          • XLINK
          • XSCOPE File I/O
        • FreeRTOS FAQs
        • FreeRTOS Common Issues
    • Frequently Asked Questions
    • Copyright & Disclaimer
    • Licenses
  • RTOS Programming Guide
    • XCORE Platform
    • Tutorials
      • FreeRTOS Application Programming
      • Board Support Configurations
      • RTOS Application DFU
    • API Reference
      • RTOS Drivers
        • GPIO RTOS Driver
        • I2C RTOS Driver
          • I2C Master RTOS Driver
          • I2C Slave RTOS Driver
        • I2S RTOS Driver
          • I2S Master Initialization API
          • I2S Slave Initialization API
        • Microphone Array RTOS Driver
        • QSPI Flash RTOS Driver
        • SPI RTOS Driver
          • SPI Master RTOS Driver
          • SPI Slave RTOS Driver
        • UART RTOS Driver
          • UART Tx RTOS Driver
          • UART Rx RTOS Driver
        • USB RTOS Driver
        • Trace Driver
        • Clock Control RTOS Driver
        • Device Firmware Update RTOS Driver
        • Intertile RTOS Driver
        • L2 Cache RTOS Driver
        • Software Memory RTOS Driver
      • RTOS Services
        • Device Control
          • Device Control Shared API
          • Device Control XCORE API
          • Device Control Host API
          • Command Transport Protocol
        • Concurrency Support
          • Concurrency Support API
        • Generic Pipeline
          • Generic Pipeline Example
          • Generic Pipeline API
    • FAQs
    • Common Issues
  • Build System User Guide
    • Build System
    • Example CMakeLists.txt
    • Targets
    • Macros
  • Peripheral IO Programming Guide
    • Overview
    • API Reference
      • UART Library
        • UART Tx
        • UART Rx
      • I2C Library
        • I2C Master
        • I2C Slave
        • I2C Registers
      • I2S Library
        • I2S Common API
        • I2S Master
        • I2S Slave
      • SPI Library
        • SPI Master
        • SPI Slave
  • Mic Array Library
    • Introduction
    • Overview
    • Getting Started
    • Decimator Stages
    • Sample Filters
    • Software Structure
    • Mic Array Resource Usage
    • Vanilla API
    • API Reference
      • C++ API Reference
      • C API Reference
        • filters_default.h
        • pdm_resources.h
        • setup.h
        • frame_transfer.h
        • dc_elimination.h
        • util.h
        • mic_array_vanilla.h
  • lib_qspi_fast_read Programming Guide
    • Introduction
    • Overview
    • QSPI Fast Read Resource Usage
    • Getting Started
    • Hardware Selection
    • Calibration
    • API Reference
  • lib_xcore_math Programming Guide
    • Introduction
    • Getting Started
    • Block Floating-Point Background
    • API Reference
      • XMath Types
      • Block Floating-Point API
        • BFP API Quick Reference
        • 16-Bit Block Floating-Point API
        • 32-Bit Block Floating-Point API
        • Complex 16-Bit Block Floating-Point API
        • Complex 32-Bit Block Floating-Point API
      • Discrete Cosine Transform API
      • Fast Fourier Transform API
      • Filtering API
      • Scalar API
        • Scalar API Quick Reference
        • 16-bit Scalar API
        • 32-bit Scalar API
        • Scalar IEEE 754 Float API
        • 32-bit Scalar Float API
        • 16-bit Complex Scalar Floating-Point API
        • 32-bit Complex Scalar Floating-Point API
        • Miscellaneous Scalar API
      • Vector API
        • Vector API Quick Reference
        • 8-Bit Vector API
        • 16-Bit Vector API
        • 32-Bit Vector API
        • 32-Bit IEEE 754 Float API
        • Complex 16-Bit Vector API
        • Complex 32-Bit Vector API
        • Mixed-Precision Vector API
        • 16-Bit Vector Prepare Functions
        • 32-Bit Vector Prepare Functions
        • 16-Bit Complex Vector Prepare Functions
        • 32-Bit Complex Vector Prepare Functions
        • 32-Bit Vector Chunk (8-Element) API
      • Q-Format Macros
      • XMath Util Functions and Macros
      • Library Configuration
      • Library Notes
    • Example Applications
Back to top

XLINK#

This example application demonstrates the AN01024 application note in FreeRTOS on xcore.ai.

Note

This example application required XTC Tools version 15.2.1 or newer.

Preparing the hardware#

This example requires 2 XCORE-AI-EXPLORER boards, and a user provided device to act as an I2C slave.

To setup the board for testing, the following connections must be made:

Table 1 XCORE-AI-EXPLORER to XCORE-AI-EXPLORER Connections 2 Wire#

BOARD 0

BOARD 1

GND

GND

X1D65

X1D66

X1D66

X1D65

X1D64

X1D67

X1D67

X1D64

X1D63

X1D68

X1D68

X1D63

X1D62

X1D69

X1D69

X1D62

X1D61

X1D70

X1D70

X1D61

Table 2 XCORE-AI-EXPLORER to XCORE-AI-EXPLORER Connections 5 Wire Additions#

BOARD 0

BOARD 1

X1D63

X1D68

X1D68

X1D63

X1D62

X1D69

X1D69

X1D62

X1D61

X1D70

X1D70

X1D61

Table 3 XCORE-AI-EXPLORER Board 0 to Host Connections#

BOARD 0

Host

GND

Host GND

SCL

Host SCL

SDA

Host SDA

Building the firmware#

Run the following commands in the xcore_sdk root folder to build the firmware:

On Linux and Mac:

cmake -B build -DCMAKE_TOOLCHAIN_FILE=xmos_cmake_toolchain/xs3a.cmake
cd build
make example_freertos_xlink_both

On Windows:

cmake -G "NMake Makefiles" -B build -DCMAKE_TOOLCHAIN_FILE=xmos_cmake_toolchain/xs3a.cmake
cd build
nmake example_freertos_xlink_both

Running the firmware#

This application requires example_freertos_xlink_0.xe to be run on BOARD 0, IE, the board with a host I2C connection.

Use the following command to determine available device:

xrun --list-devices

From the build folder run:

xrun --id 0 example_freertos_xlink_0.xe

In another console, from the build folder run:

xrun --id 1 example_freertos_xlink_1.xe

BOARD 0 will send out status messages and communication details to slave address 0xC.

The data will contain an ID, followed by a 4 byte payload. The payload is an int32, sent least significant byte first.

Payloads match to ID per the table below:

Table 4 XCORE-AI-EXPLORER to XCORE-AI-EXPLORER Connections 2 Wire#

ID

Payload

0x01

RX state

0x82

received data bytes in the last second

0x83

received control tokens in the last second

0x84

timeouts in the last second

Note

Data rates are highly dependant on the electrical characteristics of the physical connection. Refer to xCONNECT Architecture for more information.

Next
XSCOPE File I/O
Previous
Tracealyzer Example
Copyright © 2023, XMOS Ltd
Made with Sphinx and @pradyunsg's Furo
Last updated on May 02, 2023
On this page
  • XLINK
    • Preparing the hardware
      • Building the firmware
      • Running the firmware