Easy "clone and go" repository for a libopencm3 + FreeRTOS based project.
sudo apt install make
Download the toolchans from https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads
Choose AArch32 bare-metal target (arm-none-eabi) under your host system.
Extract the compressed file, move it to /opt and set the proper permissions.
tar xvf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
cd /opt/gcc-arm/
sudo mv ~/Backup/linux/gcc-arm-none-eabi-10.3-2021.10/ .
sudo chown -R root:root gcc-arm-none-eabi-10.3-2021.10/
Check the version
/opt/gcc-arm/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc --version
Checkout, if you have an older git, or got ahead of yourself and skipped the --recurse-submodules
you can fix things by running git submodule update --init
(This is only needed once)
git clone --recurse-submodules https://github.com/IOsetting/libopencm3-freertos-template.git your-project
In case anything goes wrong when cloning the submodules
cd your-project
git submodule update --init --recursive
Build libopencm3, replace PREFIX=..
with your toolchains path
cd your-project
PREFIX=/opt/gcc-arm/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi- make -C libopencm3
Build user project, replace PREFIX=..
with your toolchains path
PREFIX=/opt/gcc-arm/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi- make -C user
There are some example codes under examples folder, categoried by none-os and rtos. To try the code, just copy
them to user and compile. Compile argument FREERTOS=1
is required when compiling rtos examples, e.g.
PREFIX=/opt/gcc-arm/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi- FREERTOS=1 make -C user
- user/
contains your application - freertos/
contains FreeRTOS kernel source code - libopencm3/
contains libopencm3 source code - examples/
non-os and rtos demo codes
This template should be considered released into the public domain. This only applies to the template code. libopencm3 and FreeRTOS themselves has their own licenses. You should replace this license with the license of your own project if you are using this as a template.