CLI Usage
Installation
-
Download the
get-platformio.py
script from the PlatformIO (PIO) repository.# curl curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py # wget wget https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -O get-platformio.py
-
Install PIO using Python.
python get-platformio.py
Once PIO is installed to your home directory, fetch the executable location via:
python get-platformio.py check core # (Linux) home/username/.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.
-
Add the QUTy platform by following the steps in QUTy Platform Installation.
QUTy Platform Installation
Run the following command to register the QUTy platform within PlatformIO.
pio pkg install --platform https://github.com/cab202/quty --global
To confirm that the installation was successful, use
pio pkg list --global
Getting Started
-
Create the following configuration file (
platformio.ini
) in the root directory of your project.# platformio.ini [env:QUTy] platform = quty board = QUTy
-
Follow the given directory structure as per PlatformIO specifications.
root ├───.pio │ └───build │ └───QUTy ├───include │ └───<header files> ├───lib │ └───<pre-compiled programs> └───src └───<source files>
Here the
.pio
directory is automatically created by PIO when the user tries to build or upload the program.Note that if you wish to use the
lib
directory, the following compiler flags need to be added insideplatformio.ini
.# platformio.ini # ... platform configuration build_flags = # Add directory -L lib # Add linker option -Wl,lib/<file name>
-
Build your program with the
run
command.pio run
-
Build and upload your program to the QUTy microcontroller with the
-t
flag.pio run -t upload
If PIO cannot determine the port automatically determined, use the
--upload-port
option to specify the port. The port can be found using the following command:pio device list
If no devices are listed, you may be missing some drivers. See Installation for more information.