Skip to content

POSIX based FreeRTOS emulator with SDL2 graphics interface and multiple async communications interfaces, aiming to make it possible to teach FreeRTOS without embedded hardware using similar processes

License

Notifications You must be signed in to change notification settings

PhilippvK/FreeRTOS-Emulator

 
 

Repository files navigation

FreeRTOS Emulator

Coverity Scan Build Status

An implementation of POSIX based FreeRTOS with the combination of SDL2 graphics. Aimed at providing an x86 emulation solution for teaching FreeRTOS to students without the need of embedded hardware.

Based on the FreeRTOS (V5.X) simulator developed by William Davy. Updated to use FreeRTOS V9.0.0.

Checkout the Wiki page for a detailed Documentation!

Dependencies

The simulator uses the SDL2 graphics libraries.

Debian/Ubuntu

sudo apt-get install libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev

Arch

sudo pacman -S sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_ttf

Windows/Mac

¯\(°_o)/¯

....install linux?

Building

cd build
cmake ..
make

For those requiring an IDE run

cmake -G "Eclipse CDT4 - Unix Makefiles" ./

to generate the appropriate project files to allow for the emulator to be imported into Eclipse.

Additional targets

In test.cmake a number of extra targets are provided to help with linting.

Git --check

make commit

Checks for whitespaces and empty lines.

Astyle Formatting

cmake -DENABLE_ASTYLE=ON ..
make format

Invokes the Astyle formatter.

Clang Tidy

cmake -DENABLE_CLANG_TIDY=ON ..
make tidy

Uses clang tidy to find style violations, interface misuse of bugs found via static analysis.

To generate a list of warnings/errors use the build target tidy_list and then view the file tidy.fixes.

CppCheck

cmake -DENABLE_CPPCHECK=ON ..
make check

Code analysis with CppCheck, focusing on undefined behaviour bugs.

Valgrind (memcheck)

cmake -DENABLE_MEMCHECK=ON ..
make memcheck

Memory checker.

Google Tests/Coverage

Coverage

cmake -DENABLE_COVERAGE=ON ..
make

Each sanitizer must be run stand alone, thus you cannot run them together.

Address sanitizer

cmake -DENABLE_ASAN=ON ..
make

Undefined behaviour sanitizer

cmake -DENABLE_USAN=ON ..
make

Thread sanitizer

cmake -DENABLE_TSAN=ON ..
make

All checks

The target make all_checks

cmake -DALL_CHECKS=ON ..
make

will perform all checks

Running

The binary will be created inside a bin folder. The emulator should be run from this folder becuase at the moment the Gfx libraries rely on hardcoded resource paths for things such as fonts. As such to run perform the following.

cd bin
./FreeRTOS_Emulator

Debugging

The emulator uses the signals SIGUSR1 and SIG34 and as such GDB needs to be told to ignore the signal. An appropriate .gdbinit is in the bin directory. Copy the .gdbinit into your home directory or make sure to debug from the bin directory. Such that GDB does not get interrupted by the POSIX signals used by the emulator for IPC.

If using an IDE, make sure to configure your debug to load the gdbinit file.


Buy Me A Coffee

About

POSIX based FreeRTOS emulator with SDL2 graphics interface and multiple async communications interfaces, aiming to make it possible to teach FreeRTOS without embedded hardware using similar processes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 81.4%
  • C++ 14.3%
  • CMake 3.3%
  • Other 1.0%