Skip to content

Template for Lingua Franca projects using Zephyr as a target platform

Notifications You must be signed in to change notification settings

siljesu/lf-west-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lingua Franca West Template

This repository contains a template for Lingua Franca applications using the Zephyr target platform. It contains a west extension which takes care of invoking lfc.

Requirements

  • Linux system (or WSL). Should be fine on MacOS also, but not tested yet.
  • An installation of lfc which is more recent than commit 788ba74 where zephyr support was added. The nightly release can be downloaded here. This version of lfc must the first lfc on the system path. Alternatively you can edit this line to give the path to the new lfc.

NB: This is a temporary workaround until v0.4 is released

Zephyr

  • In order to use this template the following Zephyr dependencies are needed:
  1. West meta build tool (see West information)
  2. Zephyr SDK and toolchains

Please refer to Zephyr Getting Started Guide. NB. You can skip steps 5,6,7 which clones the entire Zephyr project. Instead we will clone Zephyr into this workspace using west.

If west is installed in a virtual environment, this environment is assumed activated for the rest of this guide.

Initialization

  1. Clone this template and remove old git history:
git clone https://github.com/lf-lang/lf-zephyr-template/ lf-zephyr-app
cd lf-zephyr-app
  1. Clone the Zephyr project into deps/zephyr:
west update
  1. Install Zephyr python dependencies:
pip3 install -r deps/zephyr/scripts/requirements.txt

Build & Run

QEMU emulation

cd application
west lf-build src/HelloWorld.lf -w "-t run"

Nrf52 blinky

This requires that the nrfjprog utility is installed. See installation guide here

cd application
west lf-build src/NrfBlinky.lf -w "-b nrf52dk_nrf52832 -p always"
west flash

The custom lf-build west command can be inspected in scripts/lf_build.py. It invokes lfc on the provided LF source file. It then invokes west build on the generated sources. See west lf-build -h for more information.

About

Template for Lingua Franca projects using Zephyr as a target platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%