Skip to content

peter-mitsis/rtos-benchmark

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

The benchmark project contains a set of tests aimed to measure the performance of certain OS operations. It currently supports both the qemu_x86 and frdm_k64f boards on Zephyr and only the frdm_k64f board on FreeRTOS. Additional boards and RTOSes are expected to be added in the future.

It is recognized that running a benchmark test suite on QEMU is not generally recommended, and any results from that should be taken with a grain of salt. That being said, the primary reason it has been added has been to act as a blueprint for integrating additional boards and architectures.

Setting Up

Common

Install the GNU ARM compiler for the frdm_k64f board, GNU ARM Embedded toolchain and set ARMGCC_DIR to the installation directory.

Zephyr Specifics

Refer to the Zephyr Getting Started Guide for installing and setting up the Zephyr environment. This must be done so that a freestanding application can be built. As indicated under "Common", be sure to set the ARMGCC_DIR environment variable appropriately.

To enable use of the 3rd Party GNU ARM Embedded toolchain, set the following environment variables.

export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
export GNUARMEMB_TOOLCHAIN_PATH=<path to installed toolchain>

FreeRTOS Specifics

Build and download the FRDM-K64F SDK from the NXP MCUXpresso SDK Builder. Select Linux as your host OS and GCC ARM Embedded as your toolchain. Be sure to also check the FreeRTOS checkbox to build FreeRTOS awareness and examples into the SDK.

mkdir freertos/SDK_<version>_FRDM-K64F
unzip ~/Downloads/SDK_<version>_FRDM-K64F.zip -d <SDK Install Dir>/SDK_<version>_FRDM-K64F

Install pyOCD - tool used to flash FRDM_K64F.

Building and Flashing

Zephyr on FRDM K64F

cmake -GNinja -DRTOS=zephyr -DBOARD=frdm_k64f -S . -B build
ninja -C build
ninja -C build flash

Zephyr on other boards

Similar steps apply to when building for a different board. In the cmake command, specify the name of the board after -DBOARD. For example ...

cmake -GNinja -DRTOS=zephyr -DBOARD=qemu_x86 -S . -B build

Remember that the ZEPHYR_BASE environment variable must be set so that the Zephyr west tool can be found.

FreeRTOS on FRDM K64F

cmake -GNinja -DRTOS=freertos -DBOARD=frdm_k64f -DMCUX_SDK_PATH=<SDK Install Dir>/SDK_<version>_FRDM-K64F -S . -B build
ninja -C build
ninja -C build flash

Connecting

Connect the frdm_k64f to your host via USB. In another terminal, open a serial terminal (such as screen, minicom, etc) to see the output:

minicom -D /dev/ttyACM0

Debugging

Debugging on both Zephyr and FreeRTOS are quite similar.

cmake <RTOS Debug Options>
ninja -C build debugserver

In another terminal, start GDB:

$ARMGCC_DIR/bin/arm-none-eabi-gdb build/freertos.elf
(gdb) target remote :3333

cmake Zephyr Debug Options

Nothing extra--just the standard cmake instruction.

cmake -GNinja -DRTOS=zephyr -DBOARD=frdm_k64f -S . -B build

cmake FreeRTOS Debug Options

Add -DCMAKE_BUILD_TYPE=debug to the build options:

cmake -GNinja -DCMAKE_BUILD_TYPE=debug -DRTOS=freertos -DBOARD=frdm_k64f -DMCUX_SDK_PATH=SDK_<version>_FRDM-K64F -S . -B build

Releases

No releases published

Packages

No packages published

Languages

  • C 93.0%
  • CMake 5.8%
  • Python 1.2%