Initial setup

The library is based on the library developed by Kris Winer, who is the creator of Tlera Boards. This library is originally thought for the Arduino IDE, so the library created in this documentation is meant to use with this framework as well.

So, to use it it is required to install first the Arduino framework, and an appropriate editor to develop your application.

1. Required software

1.1 Arduino IDE

First of all the required application to compile is the Arduino framework which is installed with the Arduino IDE.

For this you could perfom the next steps:

For Windows

  1. Visit the Arduino software download page and select the appropriate version according to your system properties.

  2. Once downloaded install the software in your system, taking into account the path where you intall it and the preferences file.

For GNU/Linux

Depending on your GNU/Linux distribution there will be a package appropriate for your system.

In this case, we provide the installation steps for ArchLinux, which was the system used for the test:

  1. Install the arduino-avr-core and the arduino package:

    sudo pacman -S arduino arduino-avr-core
    
  2. Add the user to the uucp and lock user groups, according to the Arduino Documentation:

    sudo usermod -a -G uucp username
    sudo usermod -a -G lock username
    

After these steps are accomplished, you should relogin your session to these changes takes effect.

1.2 Visual Studio Code

Although the Arduino IDE is enough to create an application and use the board, we recommend using a more featured IDE which also have linters and allows to backtrace the libraries.

We recommend for this purpose, Visual Studio Code, with a convenient Arduino extension.

Visual Studio Code installation

To perfom this goal, follow the next steps:

For Windows

  1. Download the software from the Visual Studio Code page according with your system properties.

  2. Install the software following the common flow for Windows software installation.

For Linux

Depending of the linux dristribution the commands may vary. Fortunately, there are .deb and .rpm versions for the most common GNU/Linux distributions such as Debian derived ones (Ubuntu, and their flavours) and Red Hat derived ones (Fedora, CentOS, and others).

In case of ArchLinux, the command to install it is:

sudo pacman -S code

For more detils, could visit the Archlinux package documentation for Visual Studio Code.

Arduino extension installation

The recommended extension to work with Arduino in Visual Studio Code is Arduino. This extension could be installed from the extensions menu in the Code IDE.

To accomplish this goal you could perform the following steps:

  1. Open the extensions menu in the side bar and search for vscode-arduino.

  2. Select the extension provided by Microsoft.

  3. Once openned install the extension by clicking on the Install green button.

It is probably that the extension when is installed suggest the C/C++ extension as the code for Arduino is primarily in this language. If the pop-up message doesn’t appear we suggest installing it manually, by:

  1. In the extensions menu, search for c++.

  2. Select the extension provided by Microsoft.

  3. Once openned install the extension by clicking on the Install green button.

For more information, could visit the extension repository.

2. Install base libraries

Normally, the Arduino extension grabs its configuration from the Arduino IDE preferences, so if you had installed some libraries, they will be available in the Arduino extension for Visual Code.

In this case, we want to install the library employing the preferences file from the Arduino extension.

The base library, according to the Tlera Board creator is the Arduino Core for STM32L0 based boards which must be installed to be able to compile the code in the application.

So, to install it, follow the next steps:

  1. Open the user preferences for Arduino extension via Ctrl + ,.

  2. Locate the ArduinoConfiguration.

  3. Click on Edit in settings.json.

  4. Add the following url https://grumpyoldpizza.github.io/ArduinoCore-stm32l0/package_stm32l0_boards_index.json to the arduino.additionalUrls option, resulting as follows:

    "arduino.additionalUrls": [
       "https://grumpyoldpizza.github.io/ArduinoCore-stm32l0/package_stm32l0_boards_index.json",
    ]
    
  5. Save the file with Ctrl + S.

Now you can install the library core for this board via:

  1. Open the Arduino command pressing F1.

  2. Select Arduino:Board Manager.

  3. Search for “Tlera Corp STM32L0 Boards”

  4. Click on Install button.

Once the boards are installed you could close the Board Manager.