FreeRTOS distro layer compatible with OpenEmbedded
Currently supported BSPs:
- QEMUARMv5
- STM32F446 (ST Nucleo board)
- Raspberry Pi Pico (via the meta-raspberrypi-baremetal layer)
For building instructions for the Raspberry Pi Pico, refer to the meta-raspberrypi-baremetal layer documentation.
master | |
---|---|
kirkstone | |
dunfell |
This layer depends on:
URI: git://git.yoctoproject.org/poky
branch: master
This layer has an MIT license (see LICENSE) and it fetches code from FreeRTOS that has its own License (MIT as of the day of writing this README), along with code taken from jkovacic which also has its own license.
1.- Clone the required repositories
$ git clone https://git.yoctoproject.org/git/poky
$ cd poky
$ git clone https://github.com/ahcbb6/meta-freertos.git
2.- Add meta-freertos to your bblayers.conf
$ source oe-init-build-env
$ bitbake-layers add-layer ../meta-freertos
3.- Add the required variables to your local.conf
$ echo "DISTRO = \"freertos\"" >> ./conf/local.conf
# If building for QEMU use:
$ echo "MACHINE = \"qemuarmv5\"" >> ./conf/local.conf
# If, instead, building for STM32 use:
$ echo "MACHINE = \"stm32f446\"" >> ./conf/local.conf
4.- Build a sample FreeRTOS standalone application:
# For QEMU:
$ bitbake freertos-demo
# For STM32:
$ bitbake freertos-demo-stm32
5.- Run the application on QEMU (or flash the .hex file on the deploy directory for STM32):
$ runqemu nographic
After running runqemu you should be able to see the output of the application on QEMU and interact with it.
Sample output:
###### - FreeRTOS sample application -######
A text may be entered using a keyboard.
It will be displayed when 'Enter' is pressed.
Periodic task 10 secs
Waiting For Notification - Blocked...
Task1
Task1
You entered: "HelloFreeRTOS"
Unblocked
Notification Received
Waiting For Notification - Blocked...
(First 3 steps still apply)
4.- Enable multiconfig builds on your local.conf
$ echo "BBMULTICONFIG = \"dummy-x86-64\"" >> ./conf/local.conf
5.- Create a multiconfig dependency so freertos gets built automatically when building Linux
$ echo "do_image[mcdepends] = \"multiconfig:dummy-x86-64::freertos-demo-local:do_image\"" >> ./conf/local.conf
6.- Build Linux image and get a FreeRTOS demo for free!
$ bitbake mc:dummy-x86-64:core-image-minimal
7.- Run the FreeRTOS application on QEMU:
$ runqemu nographic
8.- Run the Linux image on QEMU (Assuming you used the default settings):
$ runqemu nographic tmp-qemux86-64-glibc/deploy/images/qemux86-64/core-image-minimal-qemux86-64.qemuboot.conf