Device Control

This example application demonstrates how to use device control over USB and I2C.

Building the firmware

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

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

Running the firmware

From the xcore_sdk build folder run:

make run_example_freertos_device_control
nmake run_example_freertos_device_control

Debugging the firmware with xgdb

From the xcore_sdk build folder run:

make debug_example_freertos_device_control
nmake debug_example_freertos_device_control

Building the host app

With the firmware running in its own terminal, in a new window, run the following commands in the xcore_sdk root folder to build the host app:

cmake -B build_host
cd build_host
make example_freertos_device_control_host
cmake -G "NMake Makefiles" -B build_host
cd build_host
nmake example_freertos_device_control_host

Running the host test app

From the xcore_sdk/build_host/examples/freertos/device_control/host folder run:

./example_freertos_device_control_host -g test_cmd
example_freertos_device_control_host.exe -g test_cmd

You should see the following output in your console:

Command test_cmd sent with resid 3 Bytes received are: 50462976