Deploying the Firmware with Linux or macOS#

This document explains how to deploy the software using CMake and Make.

Building the Host Server#

This application requires a host application to serve files to the device. The served file must be named test.wav. This filename is defined in src/app_conf.h.

Run the following commands in the root folder to build the host application using your native Toolchain:

Note

Permissions may be required to install the host applications.

cmake -B build_host
cd build_host
make xscope_host_endpoint
make install

The host application, xscope_host_endpoint, will be installed at /opt/xmos/bin, and may be moved if desired. You may wish to add this directory to your PATH variable.

Before running the host application, you may need to add the location of xscope_endpoint.so to your LD_LIBRARY_PATH environment variable. This environment variable will be set if you run the host application in the XTC Tools command-line environment. For more information see Configuring the command-line environment.

Building the Firmware#

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

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

Flashing the Model#

Run the following commands in the build folder to flash the model:

xflash --force --quad-spi-clock 50MHz --factory example_asr.xe --boot-partition-size 0x100000 --target-file ../examples/speech_recognition/XCORE-AI-EXPLORER.xn --data ../examples/speech_recognition/asr/port/example/asr_example_model.dat

Running the Firmware#

From the build folder run:

make run_example_asr

In a second console, run the following command in the examples/speech_recognition folder to run the host server:

xscope_host_endpoint 12345