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.
VxWorks supports to run rtos-benchmark for either POSIX interfaces,
or non-POSIX interfaces at user space on difference boards.
For example with the BSP nxp_s32g274:
The followings are the steps for POSIX interfaces. To test non-POSIX interfaces,
just replace INCLUDE_RTOS_BENCHMARK_POSIX with INCLUDE_RTOS_BENCHMARK_NONPOSIX,
and replace rtos_benchmark_posix.vxe with rtos_benchmark_non_posix.vxe.
vxprj create -vsb </path/to/vsb_nxp_s32g274> vip_nxp_s32g274
cd vip_nxp_s32g274
vxprj component add INCLUDE_RTOS_BENCHMARK_POSIX
mkdir romfs
cp </path/to/vsb_nxp_s32g274/usr/root/llvm/bin/rtos_benchmark_posix.vxe> romfs/
vxprj parameter set RTOS_BENCHMARK_OPTIONS 1
vxprj parameter set HIGH_RES_POSIX_CLOCK TRUE (Needed when POSIX clock is used for timestamping)
vxprj component remove INCLUDE_NETWORK
vxprj build
Load the image on the target, rtos-benchmark will automatically run on bootup.
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.
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_k64fboard, GNU ARM Embedded toolchain and setARMGCC_DIRto 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_DIRenvironment variable appropriately.To enable use of the 3rd Party GNU ARM Embedded toolchain, set the following environment variables.
FreeRTOS Specifics
Build and download the FRDM-K64F SDK from the NXP MCUXpresso SDK Builder. Select
Linuxas your host OS andGCC ARM Embeddedas your toolchain. Be sure to also check theFreeRTOScheckbox to build FreeRTOS awareness and examples into the SDK.Install pyOCD - tool used to flash FRDM_K64F.
VxWorks Specifics
Install VxWorks version later than 24.03 (including).
Building and Flashing
Zephyr on FRDM K64F
Zephyr on QEMU
This will immediately run QEMU (if installed) at the end of the build.
Zephyr on other boards
Similar steps apply to when building for a different board. In the
cmakecommand, specify the name of the board after-DBOARD. For example …Remember that the
ZEPHYR_BASEenvironment variable must be set so that the Zephyrwesttool can be found.FreeRTOS on FRDM K64F
VxWorks
VxWorks supports to run rtos-benchmark for either POSIX interfaces, or non-POSIX interfaces at user space on difference boards. For example with the BSP
nxp_s32g274:Create and build VSB
Create and build VIP
The followings are the steps for POSIX interfaces. To test non-POSIX interfaces, just replace
INCLUDE_RTOS_BENCHMARK_POSIXwithINCLUDE_RTOS_BENCHMARK_NONPOSIX, and replacertos_benchmark_posix.vxewithrtos_benchmark_non_posix.vxe.Load the image on the target, rtos-benchmark will automatically run on bootup.
Connecting
Connect the
frdm_k64fto your host via USB. In another terminal, open a serial terminal (such as screen, minicom, etc) to see the output:Debugging
Debugging on both Zephyr and FreeRTOS are quite similar.
In another terminal, start GDB:
cmake Zephyr Debug Options
Nothing extra–just the standard
cmakeinstruction.cmake FreeRTOS Debug Options
Add
-DCMAKE_BUILD_TYPE=debugto the build options: