Installation

Development for the QUTy is supported via PlatformIO. You will need to install the PlatformIO IDE for VSCode, which is available for Windows, macOS, and Linux.

Table of Contents

  1. Prerequisites
  2. Installing the QUTy Platform
  3. Serial Communication Drivers
  4. Verifying Installation
  5. Verifying Driver Installation
  6. Opening a Project
    1. Opening an Example Project
    2. Opening an Existing Project
  7. PlatformIO Toolbar
  8. CLI Installation
    1. Installing PlatformIO Core
    2. Installing the QUTy Platform (CLI)
    3. Building and Uploading

Prerequisites

  1. Install the Git client on your system. For Windows users using an installer, the default installation options may be used.
  2. Install Visual Studio Code.
  3. Install the PlatformIO IDE extension for VSCode.

Installing the QUTy Platform

  1. Open the PlatformIO Home tab in VSCode.
  2. Navigate to Platforms, then click Advanced Installation. QUTy platform installation navigation
  3. Enter the following URL and click Install:

    https://github.com/egb202/quty
    

    QUTy platform installation dialog box

    If VSCode was running during the installation of Git, you may need to restart VSCode first.

Serial Communication Drivers

Communicating with the QUTy may require Silicon Labs CP210x Virtual COM Port (VCP) drivers to be installed on your system.

Verifying Installation

To verify that the QUTy platform has been installed correctly, navigate to Platforms and ensure that the QUTy platform is listed.

PlatformIO Platforms

Verifying Driver Installation

To verify that the QUTy board is able to interface with a host machine, navigate to the PlatformIO Devices tab, and connect the device using a USB cable. A new device should be listed.

The specific PORT name and description may vary depending on the host machine and the number of devices connected.

PlatformIO Devices

Opening a Project

Opening an Example Project

The QUTy platform offers some examples to test compilation and driver compatibility. To access these examples, click on the QUTy platform and open the Examples tab. Select the desired example and click on the Import button to clone the project to your local machine.

PlatformIO Examples

Opening an Existing Project

To open an existing project in VSCode, ensure that the following directory structure is maintained:

project root/
|-- .pio # generated by PlatformIO/
|   `-- build/
|       `-- QUTy/
|-- include # header files/
|   `-- other.h
|-- lib # pre-compiled programs/
|   `-- shared.o
|-- src # source code files/
|   |-- main.S
|   `-- other.c
`-- platformio.ini

To open this project correctly in VSCode, select Open Folder and navigate to the root directory of the project.

Open Folder

The Explorer view in VSCode should now display the project structure as shown below:

Explorer View

PlatformIO Toolbar

After opening a project, PlatformIO will automatically configure the build flags required for compilation when it detects the platformio.ini file in the workspace root. This will reveal the following toolbar on the top-right corner of the VSCode window:

PlatformIO Toolbar

These options perform the following actions:

  1. Build - Assembles/Compiles the project.
  2. Upload - Assembles/Compiles the project and uploads the firmware to the microcontroller.
  3. Test - Runs the test suite for the project (not available for the QUTy platform).
  4. Clean - Removes the compiled binaries from the .pio directory. This can be useful when debugging build issues.

CLI Installation

Click to expand

For users who prefer working from the command line without the VSCode IDE, PlatformIO Core can be installed directly.

Installing PlatformIO Core

  1. Download the get-platformio.py script from the PlatformIO repository.

     # Using curl
     curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py
    
     # Using wget
     wget https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -O get-platformio.py
    
  2. Install PlatformIO using Python.

     python get-platformio.py
    

    Once PlatformIO is installed to your home directory, fetch the executable location via:

     python get-platformio.py check core
     # (Linux/macOS) ~/.platformio/penv/bin/platformio
     # (Windows) C:\Users\username\.platformio\penv\Scripts\platformio.exe
    

    You may wish to add this directory to the system PATH variable or create an alias to this executable.

Installing the QUTy Platform (CLI)

Run the following command to register the QUTy platform within PlatformIO:

pio pkg install --platform https://github.com/egb202/quty --global

To confirm that the installation was successful:

pio pkg list --global

Building and Uploading

  1. Create a platformio.ini file in the root directory of your project:

     [env:QUTy]
     platform = quty
     board = QUTy
    
  2. Build your program:

     pio run
    
  3. Build and upload to the QUTy:

     pio run -t upload
    

    If PlatformIO cannot automatically determine the port, use the --upload-port option. Find available ports with:

     pio device list