Building an example

The following section shows how to build a simple example application using VS Code.

This example prints messages in the TERMINAL window and flashes an LED on the XK-EVK-XU316 board. On other boards with the xcore.ai device it will print the messages but the LEDs may not flash.

When following through the steps below, some dialogs may pop up and these can be ignored usually.

If the Microsoft CMake Extension is installed, it should be disabled when using the XMOS XTC Tools extension because it conflicts with the XMOS Build System.

Start VS Code

  1. Go to the Start Menu

  2. Find Visual Studio Code and launch it

  1. Go to the Launch Pad

  2. Select Visual Studio Code

  1. Open a shell

  2. In the shell prompt type

    $ code
    

Select the XTC Tools

The XTC Tools version must be selected using the following steps.

  1. Open the XMOS XTC Tools extension view by pressing the XMOS XTC Tools icon in the Activity Bar

  2. Press Select XTC Tools button in the WELCOME view shown in the figure below

    ../../../_images/xmos_select.png
  3. A central quick pick menu is shown with the option XTC Tools 15.3.1

  4. Select XTC Tools 15.3.1

  1. Open the XMOS XTC Tools extension view by pressing the XMOS XTC Tools icon in the Activity Bar

  2. Press Select XTC Tools button in the WELCOME view shown in the figure below

    ../../../_images/xmos_select.png
  3. A central quick pick menu is shown with the option XTC Tools 15.3.1

  4. Select XTC Tools 15.3.1

  1. Open the XMOS XTC Tools extension view by pressing the XMOS XTC Tools icon in the Activity Bar

  2. Press Select XTC Tools button in the WELCOME view shown in the figure below

    ../../../_images/xmos_select.png
  3. A central quick pick menu is shown

  4. Select Browse for XTC Tools Path

  5. A file browser is shown

  6. Use this browser to select the root directory of XTC Tools 15.3.1 installation, which should be named 15.3.1

Download an application

  1. Open the XMOS XTC Tools extension views by pressing the XMOS XTC Tools icon in the Activity Bar as shown in the figure below

    ../../../_images/xmos_download.png
  2. Press the Download Example Application button in the GETTING STARTED view

  3. Select the item Making an LED glow with Pulse Density Modulation from the central quick pick menu

  4. A file browser is provided. Select a suitable location. On Windows select a directory with a short path, for example c:\xmos.

  5. A progress dialog will be shown in the bottom right corner

  6. VS Code may present a dialog box Do you trust the authors of the files in this folder. Check the box Trust the authors of all files in the parent folder … and press the button Yes, I trust the authors

    ../../../_images/trust.png

Build an application

  1. Open the XMOS XTC Tools extension by pressing the XMOS XTC Tools icon in the Activity Bar

  2. In the XTC TOOLS view, press the Build button as shown in the figure below

    ../../../_images/xmos_build_button.png
  3. The TERMINAL window shows build progress and the message The terminal process completed successfully. when the build has completed as shown in the figure below

    ../../../_images/xmos_build_terminal.png

Run an application on a target board

  1. Connect an XMOS XK-EVK-XU316 target board to the host computer as shown in Setup the target board and xTAG. (Other boards with the xcore.ai device may be used to show printed messages, but the LEDs may not change state)

  2. Press the Refresh Devices icon in top-right of the DEVICES view

  3. The xTAG identifier for this board will appear in the DEVICES list

  4. In the XTC TOOLS view, press the Run button

  5. An LED on the target board will alternate from bright to dim

  6. Messages from the target will be printed in the TERMINAL window

Write the application to the flash device on the target board

  1. In the XTC TOOLS view, press the Flash Device button

  2. A progress dialog will be shown in the bottom right corner of the main VS Code window

  3. The TERMINAL window shows the flash writing progress and the message The terminal process completed successfully. when the flash writing has completed

  4. The target will be reset and an LED on the target board will alternate from bright to dim

Using the TERMINAL

The XTC Tools may be used with a Command Line Interface.

  1. In the XTC TOOLS view, press the Open XTC Terminal button

  2. The environment is set up for the use of the XTC command line tools. See Using the command line tools and Command line tools for further details on the XTC command line tools which can be used in this TERMINAL.