I have been using FreeRTOS in some of my projects that involve quite a bit of tasks, especially when wireless communication is integrated. I want to acquire a more in-depth understanding of real-time systems so I am using a FreeRTOS simulator called FreeRTOS-Sim on an Ubuntu 18.04 installed laptop. This post is just about setting up the reposiory, building and running the demo tasks.
Get the Source
cd ~/src git clone https://github.com/Muriukidavid/FreeRTOS-Sim.git cd FreeRTOS-Sim
Build from source
Then I tried to build it by just running make, as there was already a makefile at the root of the repository. I got this error:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h:9:0, from /home/muriuki/src/FreeRTOS-Sim/Source/include/FreeRTOS.h:91, from /home/muriuki/src/FreeRTOS-Sim/Source/croutine.c:70: /usr/include/stdint.h:26:10: fatal error: bits/libc-header-start.h: No such file or directory #include <bits/libc-header-start.h>
On googling a bit, I found a clue at the very end of bug 17 on launchpad, install gcc-multilib and g++-multilib:
sudo apt install gcc-multilib g++-multilib
Running the test
After that make goes through without any errors. I can even run the binary and use Posix threads to run a realtime system simulation, #winning!
>> Compiling TimerDemo.c >> Compiling main.c >> Linking FreeRTOS-Sim... ------------------------- BUILD COMPLETE: FreeRTOS-Sim ------------------------- :~/src/FreeRTOS-Sim$ ls Demo FreeRTOS-Sim LICENSE Makefile obj Project README.md Source :~/src/FreeRTOS-Sim$ ./FreeRTOS-Sim Running as PID: 28317 Timer Resolution for Run TimeStats is 100 ticks per second. OK - 2500 OK - 5000 OK - 7500 OK - 10000 ^C
That was so, so easy.
Next I will now use this repository to do the labs for a Development of Realtime Systems Course that I am taking on Coursera. I might post my progress here, just don‘t expect the solutions to the labs in the course as that would be against the spirit of the course. Just technical stuff that have everything to do with Linux environment and the simulator, nothing to do with the challenges in the course. Godspeed!