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:
-
Create a new directory for your project, for example:
1
mkdir sensorio-example
-
Enter this new directory, for example:
1
cd sensorio-example
-
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.
-
Get appropriate drivers, for example:
1
git clone https://github.com/slashdevteam/ltr303-mbed.git
-
Download or copy-paste example
main.cpp
intosensorio-example
directory. -
Initialize Mbed OS project:
1
mbed config root .
-
Select SensorIO as build target:
1
mbed target SENSORIO
-
Select GNU GCC Toolchain as default:
1
mbed toolchain GCC_ARM
-
Compile firmware example:
1
mbed compile --profile debug.json
-
Flash binary and enjoy!