Skip to content

Basic setup for all firmware examples

All firmware examples in this documentation are based on Mbed OS.

Tools

These steps assume that mbed-cli and GNU Arm Embedded Toolchain are already installed. For instructions on tooling setup visit Tooling setup.

Using template repository

The easiest way to start is to clone SensorIO template repository:

1
git clone https://github.com/slashdevteam/sensorio-template.git sensorio-example

and initialize submodules:

1
2
cd sensorio-example
git submodule update --init --recursive

add any necessary drivers, for example for light sensor:

1
git clone https://github.com/slashdevteam/ltr303-mbed.git

edit main.cpp, compile and flash.

Manually

Steps needed to compile Mbed OS based firmware for SensorIO:

  1. Create a new directory for your project, for example:

    1
    mkdir sensorio-example
    
  2. Enter this new directory, for example:

    1
    cd sensorio-example
    
  3. Get Mbed OS source:

    1
    2
    git clone https://github.com/slashdevteam/mbed-os.git`
    git checkout -t origin/sensorio-dev-target
    

    Mbed OS repository

    SensorIO is currently in the process of Mbed Enabled certification, hence the need to clone a fork of Mbed OS.

  4. Get appropriate drivers, for example:

    1
    git clone https://github.com/slashdevteam/ltr303-mbed.git
    
  5. Download or copy-paste example main.cpp into sensorio-example directory.

  6. Download compilation profile: release or debug.

  7. Initialize Mbed OS project:

    1
    mbed config root .
    
  8. Select SensorIO as build target:

    1
    mbed target SENSORIO
    
  9. Select GNU GCC Toolchain as default:

    1
    mbed toolchain GCC_ARM
    
  10. Compile firmware example:

    1
    mbed compile --profile debug.json
    
  11. Flash binary and enjoy!