This repository can be used as a starting template for mbed projects with sane defaults:
- use mbed-cli
- write code with VSCode
- simple directory structure
- format with
.clang-format
and.editorconfig
It's the little cousin of Bare Arduino Project
Before starting, make sure you've read mbed documentation.
I recommend the manual install. Make sure to follow the instructions from mbed:
https://os.mbed.com/docs/mbed-os/v5.13/tools/manual-installation.html
If you want to use (at your own risks) Python 3, do the following:
# for the latest stable version
$ pip3 install -U --user mbed-cli
# for HEAD
$ pip3 install -U --user https://github.com/ARMmbed/mbed-cli/archive/master.zip
For macOS:
$ brew tap ArmMbed/homebrew-formulae
$ brew install arm-none-eabi-gcc
For Windows & Linux:
You can download the toolchain here:
Use mbed import
to import the project:
$ cd to/where/the/project/should/be
$ mbed import https://github.com/ladislas/Bare-mbed-Project my-project-name
Alternatively, you can use git to do the same with the advantage of making a shallow clone to save space and time:
$ git clone https://github.com/ladislas/Bare-mbed-Project my-project-name
$ cd my-project-name
$ git clone --depth=1 https://github.com/ARMmbed/mbed-os ./lib/mbed-os
Create a Github repository and push to it:
$ git remote set-url origin https://github.com/{{ GITHUB USERNAME }}/my-project-name
$ git push --set-upstream origin master
Don't forget to set your target and favorite toolchain, for example:
MBED_OS_DIR=./lib/mbed-os
TARGET=NUCLEO_WB55RG
TOOLCHAIN=GCC_ARM
ROOT=.
Before running mbed compile
.
To speed up compilation time, we've setup a .mbedignore
file that removes some files from the compilation process.
If you get error about missing headers when compiling, make sure the header's directory is not set in the .mbedignore
file.
Note that it has no impact on binary size after linking (or should not have anyway...).
coming soon...
The templates comes with a simple HelloWorld
library that you can use as an example and/or use to make sure your program works.
Please open an issue or create a PR.
Made with ❤️ by:
- Ladislas de Toldi - ladislas
Apache 2.0 @ Ladislas de Toldi (Ladislas [at] detoldi dot me)