This repository contains the definition for a blinky
program that uses the Embedded VM infrastructure.
- About the Project
- Project Status
- Getting Started
- Configuration Options
- Documentation
- Need Help?
- Contributing
- Further Reading
- Authors
- License
The blinky
project defines a basic application that blinks an LED. We demonstrate how an application can run on any platform which satisfies its requirements by providing examples that run on:
- An nRF52840 Development Kit
- An nRF52 USB Dongle
- A simulator platform running on your personal computer and using an Aardvark I2C/SPI adapter.
To demonstrate the separateness of the application and platform layers, this project only contains application source code. The platforms that it runs on are made available through an external dependency: embvm/embvm-demo-platforms
.
This project has reached v1.0.
Additional support is planned for demonstrating threading vs non-threading support in the while(1)
loop.
If you are unfamiliar with the Embedded VM project, please see the embvm-core
repository for more information and a Getting Started guide.
This project uses Embedded Artistry's standard Meson build system, and dependencies are described in detail on our website.
At a minimum you will need:
git-lfs
, which is used to store binary files in this repository- Meson is the build system
- Some kind of compiler for your target system.
- This repository has been tested with:
- gcc-7, gcc-8, gcc-9
- arm-none-eabi-gcc
- Apple clang
- Mainline clang
- This repository has been tested with:
This project stores some files using git-lfs
.
To install git-lfs
on Linux:
sudo apt install git-lfs
To install git-lfs
on OS X:
brew install git-lfs
Additional installation instructions can be found on the git-lfs
website.
The Meson build system depends on python3
and ninja-build
.
To install on Linux:
sudo apt-get install python3 python3-pip ninja-build
To install on OSX:
brew install python3 ninja
Meson can be installed through pip3
:
pip3 install meson
If you want to install Meson globally on Linux, use:
sudo -H pip3 install meson
This project uses git-lfs
, so please install it before cloning. If you cloned prior to installing git-lfs
, simply run git lfs pull
after installation.
This project is hosted on GitHub. You can clone the project directly using this command:
git clone --recursive https://github.com/embvm/embvm-core
If you don't clone recursively, be sure to run the following command in the repository or your build will fail:
git submodule update --init --recursive
If Make is installed, the project can be built by issuing the following command:
make
This will build all targets for your current architecture.
You can clean builds using:
make clean
You can eliminate the generated buildresults
folder using:
make distclean
You can also use meson
directly for compiling.
Create a build output folder:
meson buildresults
And build all targets by running
ninja -C buildresults
Cross-compilation is handled using meson
cross files. Example files are included in the build/cross
folder. You can write your own cross files for your specific processor by defining the toolchain, compilation flags, and linker flags. These settings will be used to compile the project.
Cross-compilation must be configured using the meson command when creating the build output folder. For files stored within build/cross
, we provide a Makefile CROSS
to simplify the process. This variable will automatically supply the proper Meson argument, build/cross/
prefix, and .txt
filename extension.
You can use a single file, or you can layer multiple files by separating the names with a colon.
make CROSS=arm:cortex-m4_hardfloat
You can also do this manually with the Meson interface. Note, however, that you will need to include a special --cross-file=build/cross/embvm.txt
cross file to ensure that the required Embedded VM settings are applied.
meson buildresults --cross-file build/cross/arm.txt --cross-file build/cross/cortex-m4_hardfloat.txt --cross-file=build/cross/embvm.txt
Following that, you can run make
(at the project root) or ninja -C buildresults
to build the project.
Note: Tests will not be cross-compiled. They will only be built for the native platform.
Full instructions for working with the build system, including topics like using alternate toolchains and running supporting tooling, are documented in Embedded Artistry's Standardized Meson Build System on our website.
Build configuration is covered in depth in the Configuration and Tuning guide in the embvm-core
project.
The bulk of the Embedded VM documentation is contained in the embvm-core
repository. This repository only contains documentation relevant to this specific module.
Full documentation can be built locally by running the following command:
make docs
Documentation can be found in buildresults/docs
, and the root page is index.html
.
If you need further assistance or have any questions, please file a GitHub issue or send us an email using the Embedded Artistry Contact Form.
You can also reach out on Twitter: mbeddedartistry.
If you are interested in contributing to this project, please read our contributing guidelines.
Copyright © 2020 Embedded Artistry LLC
This project is released under GPLv3 according to the requirements of the embvm-core
project. See the LICENSE.md file for further licensing details.