CoreMark
EEMBC CoreMark with ITCM execution; score is emitted over SEGGER RTT.
| Declared by the example author | Value |
|---|---|
| Tier | Capabilities |
| Status | builds |
| Capabilities | benchmark, rtt, itcm |
| Boards tested | none declared |
Build it from a source checkout by name, because the positional app argument resolves
under ./examples:
nsx build coremark --board apollo510_evbThe rest of this page is the example’s own README, from
examples/coremark/.
EEMBC CoreMark benchmark for Ambiq Apollo parts, packaged as a portable nsx application.
The example runs the standard PERFORMANCE_RUN with ITERATIONS=0
(auto-calibrate to ≥10 s), prints the score, and then spins. It uses the
board-default linker script and the SoC’s instruction cache — no custom
memory placement or micro-optimization quirks — so the same source builds
unmodified across Apollo5 and Apollo4 targets.
Energy/power measurement is not part of this example. See the separate
power_benchmarkexample for the Joulescope-based power workflow.
It is a multi-target example: a single lean nsx.yml declares a
targets: block, and the resolved closure for every board is recorded in
one combined nsx.lock.
| Target | SoC | Core | Hardware |
|---|---|---|---|
apollo510_evb (default) |
Apollo510 | Cortex-M55 | Apollo510 EVB |
apollo510b_evb |
Apollo510B | Cortex-M55 | Apollo510B EVB |
apollo4p_blue_kxr_evb |
Apollo4P | Cortex-M4 | Apollo4 Blue Plus KXR EVB |
Build & Run
Section titled “Build & Run”# Default board (apollo510_evb)nsx configure --app-dir .nsx build --app-dir .nsx flash --app-dir . # requires JLink + EVB
# Other targetsnsx build --app-dir . --board apollo510b_evbnsx build --app-dir . --board apollo4p_blue_kxr_evbScore Output (SEGGER RTT)
Section titled “Score Output (SEGGER RTT)”The score is printed over SEGGER RTT channel 0, not SWO/ITM. RTT writes
to an in-SRAM ring buffer that the J-Link drains over SWD via background
memory reads — no peripheral pins and no sensitivity to clock/baud setup.
The registered nsx-segger-rtt module owns buffer placement: non-cached
TCM on Cortex-M55, shared SRAM on cacheless Cortex-M4 parts that provide
it. The port needs no D-cache clean after writes.
CoreMark links nsx::segger_rtt and defaults channel 0’s up buffer to 32 KiB
through NSX_SEGGER_RTT_BUFFER_SIZE_UP, set before module bootstrap. An
explicit CMake cache value overrides this default. The module also exposes
NSX_SEGGER_RTT_BUFFER_SIZE_DOWN (16 bytes by default). These settings apply
to the library itself; application-only BUFFER_SIZE_UP defines do not.
Other apps can use nsx module add nsx-segger-rtt, link nsx::segger_rtt,
and include SEGGER_RTT.h. The module ships SEGGER RTT V8.58.0 with its
upstream license and provenance; SEGGER_RTT_printf and the assembly fast
path are not included.
Use any RTT viewer (e.g. JLinkRTTViewer) to read the output, which looks
like:
--- CoreMark on Ambiq NSX ---2K performance run parameters for coremark....CoreMark 1.0 : <score> / GCC ... / STACK--- CoreMark complete. ---Capture using NSX’s shared RTT host command (after configuring, building, and flashing this executable):
pipx inject neuralspotx pylink-squarensx rtt --probe-serial <serial> --duration 25 --file cm.logNSX resolves _SEGGER_RTT from the exact CMake executable, including GCC’s
.axf suffix. --print-settings shows the resolved address and connection
settings without accessing a probe. The command attaches without explicitly
resetting the target. It creates a new byte-exact capture file and preserves
partial data on failure. The installed SEGGER J-Link Software is also required.
Use neuralspotx[rtt] for non-pipx Python installations.
How It Works
Section titled “How It Works”- Init (
portable_init):nsx_system_init()brings up the SoC atNSX_PERF_HIGHwith the instruction/data caches enabled, sets up the RTT control block, and starts a microsecond timer (nsx-timer). - Benchmark (
core_main): standard EEMBC CoreMarkPERFORMANCE_RUN, timed withnsx_timer_us_read(). - Report (
portable_fini): prints the completion banner and spins in__WFI()so the score stays readable.
Cleaning Up
Section titled “Cleaning Up”Nothing under build/, modules/, or .nsx/ is source-controlled —
it is all re-created by nsx configure/nsx build.
nsx clean --app-dir . # ninja clean inside the active build dirnsx clean --app-dir . --full # delete the active build directorynsx clean --app-dir . --reset # full reset before `git pull`nsx clean --app-dir . --reset --force # also discard local edits under modules/Project Layout
Section titled “Project Layout”coremark/├── CMakeLists.txt App build — CoreMark sources + NSX modules├── nsx.yml Lean multi-target manifest (targets + requires)├── nsx.lock Combined resolved module locks (targets: map)├── boards/ Vendored board definitions (one dir per target)├── cmake/nsx/ NSX CMake support (toolchains, modules, helpers)├── modules/ NSX module sources (app-local, gitignored)├── src/│ ├── core_portme.c Portable platform port (init, timer, RTT output)│ ├── core_portme.h Port configuration (types, seeds, timer)│ └── coremark/ Upstream EEMBC CoreMark (Apache-2.0)└── tools/ └── rtt_capture.py Legacy manual-address RTT helper (prefer nsx rtt)License
Section titled “License”- Platform port (
src/core_portme.c,src/core_portme.h): Apache-2.0 - EEMBC CoreMark (
src/coremark/): Apache-2.0 - SEGGER RTT (
modules/nsx-segger-rtt/): upstream license inLICENSE.md; source version and checksums inSOURCE.md