|
reactor-uc 0.1
|

This is a template for Lingua Franca applications targeting RIOT OS on embedded boards. It is currently configured to support ARM-based boards.
If you have trouble, please refer to the platform-specific hints towards the end of these instructions.
You must use one of the following operating systems:
Linux Officially supported are Debian & UbuntumacOSYour system must have the following software packages (you likely have at least some of these already):
git — a distributed version control systemmake — Need at least version 4.0 for RIOT (see macOS Hints)java — Java 17nix — a purely functional package managerNote that make will be installed as gmake (see macOS Hints), so all commands below should use gmake instead of make.
This template uses reactor-uc, the "micro C" target for Lingua Franca. Clone this repo with one of the following commands:
And make sure that the REACTOR_UC_PATH environment variable is pointing to it.
This README only covers arm-based boards. For boards having a CPU with different architecture, please check which cross-compilers are available for your operating system.
A quick way to check if you already have an arm cross-compiler installed:
The template repo includes support for using the nix package manager to perform the installation. It is currently set to support ARM-based boards that use the arm-none-eabi-gcc cross-compiler.
The following command creates a shell environment in which all necessary dependencies are installed.
This creates a new shell in which the cross-compiler is available. IMPORTANT: Don't forget to run nix develop again when you return to your project in a new shell.
On GitHub, create a repository using this template. Then clone this repo onto your development machine. This will be your workspace for developing Lingua Franca programs.
The RIOT OS sources are provided as a submodule of the new repository, to fetch them do:
Your new repository has a Makefile in the home directory that governs the build. It is set by default to compile a very simple LF program that you can find in src/HelloWorld.lf. To compile a different LF program, edit the Makefile to point the LF_MAIN to your LF program and set the BOARD variable to specify your board. By default, these are defined in the Makefile as follows:
Setting BOARD to native should result in an executable that runs in your development machine, but only if it is a Linux machine (on other platforms, the generated code will fail to compile). To specify, for example, the ST nucleo-f446re, you would write:
Alternatively, you can override the board on the command line. For example:
or with parameters to override the `Makefile configuration
or with parameters to override the `Makefile configuration
You can open a terminal that interacts with stdin and stdout of your program as follows:
This will display any output your program generates using, for example, printf.
You can also get debug output from the reactor-uc runtime by changing the following line in the Makefile:
to
To edit Lingua Franca programs, it is convenient to use the Lingua Franca extension for Visual Studio Code. If you do not have the Visual Studio Code IDE, you can install it using one of (for Linux and macOS, respectively):
You may also benefit from the following extensions:
ms-vscode.cmake-tools — Extended CMake support in Visual Studio Codems-vscode.cpptools — C/C++ IntelliSense, debugging, and code browsingmarus25.cortex-debug — ARM Cortex-M GDB Debugger support for VSCodeTo install them from the command line, run:
The tools require make to be at least version 4.0, and, as of this writing, standard macOS distributions have an older version. Check:
You can install a more recent version:
Note that make will be installed as gmake, so all commands above should use gmake instead of make.
To use nix on Linux (or WSL), make sure that your user is a member of the nix-users group. To check this, run:
If nix-users is not listed, run:
Please note that you might need to reboot your system after running usermod in order for the new group membership to be reflected.