The code in this repository allows building applications that run on battery-free Riotee devices. For a detailed description refer to the documentation.
For a quickstart with Riotee you can use our Arduino package which internally makes use of the SDK. For more involved projects, continue reading here.
Download the latest zip release and unpack it to a path on your machine.
Alternatively, clone this repository to get the latest development version of the SDK:
git clone --recursive [email protected]:NessieCircuits/Riotee_SDK.git
- Install
make
from your distribution's repository (apt install build-essential
on Ubuntu). - Install the GNU Arm Embedded Toolchain from your distribution's repository (
apt install gcc-arm-none-eabi
on Ubuntu) or from the official website. - For uploading firmware to your Riotee device install the riotee-probe Python package with
pipx install riotee-probe
- Download the Riotee udev rules and copy them to the
/etc/udev/rules.d/
directory on your machine. - Make sure your user belongs to the plugdev group and reload the udev rules with:
sudo udevadm control --reload-rules
sudo udevadm trigger
- Install
make
via Cygwin or Chocolatey following the instructions here. - Add the path to
make
(e.g.C:/cygwin64/bin
for Cygwin) to yourPath
variable (Instructions). - Install the
GNU Arm Embedded Toolchain
from the official website. - For uploading firmware to your Riotee device install the riotee-probe Python package globally with
pipx install riotee-probe
Take a look at the examples for how you can use this SDK. We also provide a template project to get you started with your first Riotee project using the SDK.
In a nutshell: Your application must provide a Makefile that includes the SDK's Makefile and defines the following variables:
RIOTEE_SDK_ROOT
: Path to the Riotee SDKSRC_FILES
: Your C/C++ source filesINC_DIRS
: Paths to your header filesOUTPUT_DIR
: Path where project is builtGNU_INSTALL_ROOT
: Optional. Path to your gcc toolchain if not on your Path.LIB_DIRS
: Optional. Paths to static libraries.LIB_FILES
: Optional. Static libraries to link against.
Your code defines a main()
function. This function is executed while the device has energy and suspended when energy becomes critically low. If the power supply is interrupted, the stack and all static and global variables are stored in non-volatile memory and restored as soon as the supply comes back.
There are a number of callbacks that your application can implement:
startup_callback()
: Called right after every reset. Perform early stage initizialization required for low-power operation herereset_callback()
: Called later after every reset. Initialize peripherals here.suspend_callback()
: Called right before the application gets suspended. Abort any energy-intensive operation immediately.resume_callback()
: Called right after the application gets resumed.
Your application may change the default size of the memory that is retained across power failures as well as the stack size by defining RIOTEE_RAM_RETAINED_SIZE
and RIOTEE_STACK_SIZE
in the Makefile.
For an example, take a look at the dsp example's Makefile.
- Capacitor voltage monitoring
- Driver for non-volatile RAM
- Automatic checkpointing of user application
- C++ support
- Basic timing support
- printf support
- BLE advertising
- Stella wireless protocol for bidirectional communication with a basestation
- Drivers:
- ADC
- UART
- I2C
- SPI controller
- MAX20361 boost convert
- AM1805 RTC
- VM1010 microphone
- SHTC3 T&H sensor
/core
: Riotee runtime and peripheral drivers/drivers
: Drivers for external devices/examples
: Examples using the SDK/external
: External dependencies/arduino
: Arduino core
Most of the code in this repository is published under an MIT License. The Arduino core in /arduino
is licensed under the LGPL 2.1.