There are various Arduino compatible boards. It can be difficult to choose the right board for the project. For real-time applications, CPU performance is important. ArduinoCoreMark is a CPU performance benchmark for Arduino platform based on EEMBC CoreMark. It can be used to measure the CPU performance by performing various tasks such as linked list processing, matrix manipulation, state machines execution. Source code of ArduinoCoreMark is available on GitHub repository which maintained by Lindevs.
Requirements
CoreMark allocates 2000 bytes data buffer. So, the program in total requires approximately 2.5 KiB (2560 bytes) SRAM. Note that, boards such as Arduino UNO is not supported because there is not enough SRAM.
Project setup
For demonstration purpose, we will use Arduino Mega 2560 board.
ArduinoCoreMark is published on PlatformIO Registry. So, make sure you have installed PlatformIO Core CLI tool in your system.
- Create a new directory for project and navigate to it:
mkdir benchmark && cd benchmark
- Run the following command to initialize a new project:
pio project init --board megaatmega2560
- Install ArduinoCoreMark:
pio pkg install --library "lindevs/arduino-coremark"
Code
In the src
directory, create main.cpp
file and add the following code:
#include <Arduino.h>
#include <core_arduino.h>
void setup()
{
Serial.begin(115200);
}
void loop()
{
startCoremark();
delay(5000);
}
Build project
Run the following command to build the project and upload the program to the development board:
pio run --target upload
Testing
Open the Serial Monitor and wait for few seconds to see CPU performance results:
2K performance run parameters for coremark.
CoreMark Size : 666
Total ticks : 14659
Total time (secs): 14.66
Iterations/Sec : 7.50
Iterations : 110
Compiler version : GCC7.3.0
Compiler flags : (flags unknown)
Memory location : STACK
seedcrc : 0xE9F5
[0]crclist : 0xE714
[0]crcmatrix : 0x1FD7
[0]crcstate : 0x8E3A
[0]crcfinal : 0x134
Correct operation validated. See README.md for run and reporting rules.
CoreMark 1.0 : 7.50 / GCC7.3.0 (flags unknown) / STACK
Leave a Comment
Cancel reply