Skip to content

jonathanmichel/FreeRTOS-CMake

Repository files navigation

FreeRTOS-CMake

This repository covers the replacement of Make used with FreeRTOS by CMake.

The goal is to use the Posix/Linux Simulator Demo for FreeRTOS in order to run FreeRTOS on Linux. This work is based on the Posix GCC Demo of FreeRTOS.

Prerequisites

  • GNU Make 4.1
  • CMake version 3.10.2
  • GCC 7.5.0

Tested on Ubuntu 18.04 Lts distribution with Windows WSL.

Project structure

Project is a simple demo responsible to create two tasks communicating with queue and triggered by timers. It will print received messages in the console.

Running example with Make

After cloning repository, ensure submodule (and sub-submodules) are correctly initialized and updated.

Project Makefile is based on the FreeRTOS demo one but has been simplified to remove FreeRTOS+ dependencies.

You can try make it with

❯ make

And run it

❯ ./build/posix_demo
Starting echo blinky demo
Message received from task
Message received from software timer
Message received from task
Message received from task
Message received from software timer
Message received from task

CMake usage

In order to replace Make by CMake a CMakeLists.txt file has been writen. Its goal is to include FreeRTOS and compile the demo code. You can try it with:

cmake .

At this step, a new Makefile has been generated (a copy of the initial one is in Makefile.back). Once again, you can make the program with:

❯ make

And run it with:

❯ ./build/posix_demo
Starting echo blinky demo
Message received from task
Message received from software timer
Message received from task
Message received from task
Message received from software timer
Message received from task

About

FreeRTOS Linux simulator with CMake

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published