This is the documentation for the latest (main) development branch of the Infuse-IoT platform. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

Embedded Getting Started Guide

Follow this guide to:

  • Set up a command-line Infuse-IoT Embedded development environment.

  • Get the Infuse-IoT Embedded SDK source code.

  • Build, flash, and run a sample application.

  • Setup development tools in Visual Studio Code.

Setup and Install Zephyr RTOS

The first step is to setup and install Zephyr RTOS. This step can be skipped if Zephyr RTOS 4.0 or later is already installed and working on the machine.

Install and test Zephyr is working by building and flashing the Blinky sample application by following the instructions in the Zephyr Getting Started Guide for your respective OS.

Note

When flashing the Blinky sample, you may need appropriate programmer tools for your microcontroller. See the next step for more details.

Note

Developing on Windows has two options: Native development or WSL (Windows Subsystem for Linux). Both options are valid for installation, however not all tools have been tested to work on Native Windows.

For more details using WSL see the Getting Started Guide Windows (WSL).

Install Programmer and Microcontroller specific tools

Install host tools required for your microcontroller and programmer (if you haven’t already). Below is a list of the tools required for programmers for the microcontrollers supported by infuse:

Note

nRF Command line tools comes bundled with the Segger JLink Tools <https://www.segger.com/downloads/jlink/>_. Follow the appropriate prompts to install both.

Ensure the blinky example flashes to the board before continuing.

Install Infuse-IoT Embedded SDK

Now that you have Zephyr installed and working, you can setup Infuse-IoT’s Embedded SDK. This will be setup as a standalone west workspace in ~/infuse-iot. (A different destination folder can be used at your own risk)

Setup and Clone out the Infuse-IoT Embedded SDK using:

mkdir ~/infuse
cd ~/infuse
west init -m git@github.com:Embeint/infuse-sdk.git
west update

Note

Ensure you have access to infuse_sdk on GitHub and have added your SSH key to GitHub.

If the clone fails (e.g. due to permissions issues), the ~/infuse-iot/.west folder will likely need to be deleted before trying reattempting. This can be done by running:

rm -rf ~/infuse-iot/.west/

Finally install any Python requirements:

pip install -U -r ~/infuse-iot/infuse-sdk/scripts/requirements.txt

Infuse-IoT should now be installed, next steps include building and flashing an application to verify everything is working.

Build and Flash a Infuse App

It’s now time to build and flash an Infuse-IoT Application.

For a Nordic nRF52840 Dev kit, you can build and flash the gateway_usb application.

west build -b nrf52840dk/nrf52840 infuse-sdk/apps/gateway_usb

Note

Ensure you are in the ~/infuse-iot directory.

and flash it with

west flash -d build/nrf52840dk/nrf52840/gateway_usb

Note

It may be helpful to setup the Python Tools to interact with the gateway_usb.

If the build and flash succeeded, Infuse-IoT Embedded SDK has been successfully installed. Check out how to setup VScode or other useful tips further below. If not check out the troubleshooting section.

Troubleshooting

  • Ensure to build applications from inside ~/infuse-iot and not from ~/infuse-iot/infuse-sdk, or other folders.

  • If west init or git clone fails, subsequent attempts may fail. Remove the .west or .git directory respectively before retrying.

While building and flashing, you may need to authorise the toolchain to run. This can be done by going to System Settings -> Privacy & Security -> General and clicking “Allow” and try again. This needs to be done per executable that is used in the build/flash process (So several times). Updating the Zephyr SDK or just periodically will reset permissions so it all needs to be done all over again. Thanks Apple.

VSCode Setup

VS Code is the preferred development environment for Infuse-IoT. It has many integrations with Kconfig.

VSCode can be installed through Software Center, or follow instructions from here.

Once installed, open VSCode, select “Open Folder” and navigate to ~/infuse-iot.

Check out VSCode Integration for more details and tips.

Useful Tips

General Tips:

  • ~/infuse-iot is like a workspace for Zephyr/Infuse-IoT. ~/infuse-iot/infuse-sdk contains the Infuse-IoT Embedded SDK.

  • The Zephyr installation at ~/zephyrproject is no longer required for Infuse-IoT and can be removed if you don’t need a mainline zephyr workspace.

    Note

    Zephyr installs the Python virtual environment under ~/zephyrproject/zephyr/.venv. Deleting ~/zephyrproject, will require re-creating the venv first. Do not attempt to move the .venv since this can lead to issues. To recreate the venv to e.g. ~/infuse-iot/.venv (with the zephyrproject/.venv already activated):

    pip freeze > ~/infuse-iot/requirements.txt
    python3 -m venv ~/infuse-iot/.venv
    source ~/infuse-iot/.venv/bin/activate
    pip install -r ~/infuse-iot/requirements.txt
    rm ~/infuse-iot/requirements.txt