KymoCore/Documentation
v8.0.0 Stable⌄
Versions8.0.0 Current
GitHub ↗
KYMOCORE / API REFERENCE

kymo_config.h File Reference

API contracts in their original English. Navigation and guides are bilingual.

The one place for every KymoCore build setting. More...

#include "kymo_version.h"
#include "kymo_config_check.h"

Go to the source code of this file.

Macros

#define KYMO_ENABLED   1
 Global KymoCore gate; defaults to enabled. Define 0 for compile-out.
#define KYMO_PROFILE_MINIMAL   0
 Profile value: scalar telemetry only (library default).
#define KYMO_PROFILE_XYZ   1
 Profile value: X, Z and timestamp enabled.
#define KYMO_PROFILE_TRACE   2
 Profile value: XYZ plus complete execution tracing.
#define KYMO_PROFILE   KYMO_PROFILE_MINIMAL
 Selected preset; changes only the defaults of the switches below.
#define KYMO_ENABLE_CPP   0
 Enable the library-owned Core Init/Main entry (0 or 1).
#define KYMO_ENABLE_TX   0
 Enable the shared single-frame transport sender; disabled by default.
#define KYMO_ENABLE_ENDPOINT   0
 Enable modular Endpoint Init/Main; disabled by default.
#define KYMO_ENABLE_X   0
 Include X coordinates in the wire payload; on in the XYZ and TRACE profiles.
#define KYMO_ENABLE_Z   0
 Include Z coordinates in the wire payload; on in the XYZ and TRACE profiles.
#define KYMO_ENABLE_TIMESTAMP   0
 Include timestamps in DATA frames; on in the XYZ and TRACE profiles.
#define KYMO_ENABLE_CRC   0
 Protect outgoing DATA frames with CRC; defaults to disabled.
#define KYMO_ENABLE_CRC_TABLE   0
 Compute CRC-8 and the trace CRC-16 with lookup tables; defaults to disabled.
#define KYMO_ENABLE_TRACE_STACK_POINTER   0
 Compile complete-frame MCU decoding; defaults to disabled.
#define KYMO_MAX_CHANNELS   16u
 Telemetry channels a single KymoContext can schedule (1..256).
#define KYMO_TRACE_EVENTS_PER_CORE   64u
 Trace event ring capacity per core (power of two, 16..4096).
#define KYMO_TRACE_CORE_COUNT   1u
 Number of recorder cores supported (1 or 2).
#define KYMO_TRACE_MAX_CONTEXTS   16u
 Maximum tracked trace contexts such as tasks or ISRs (1..256).
#define KYMO_TRACE_MAX_DEPTH   32u
 Maximum stored scope symbols per trace context (1..255).
#define KYMO_TRACE_MAX_ISR_DEPTH   8u
 Maximum nested ISR activations when ISR tracing is effective (1..16).
#define KYMO_MUX_ADMIN_RECORD_MAX   512u
 Largest administrative record the mux can queue, in bytes (64..8192).
#define KYMO_MAX_PARAMETERS   8u
 Parameters one KymoParamReceiver can hold (1..256).
#define KYMO_MAX_WATCHES   8u
 Live-variable slots one KymoWatch can sample (1..64).
#define KYMO_WATCH_MIN_PERIOD_MS   5u
 Shortest live-variable sampling period in milliseconds (1..60000).
#define KYMO_MAX_MEMORY_ENTRIES   8u
 Most entries one KymoMemory reports (1..32).

Detailed Description

The one place for every KymoCore build setting.

Contains only settings: profile, feature switches and resource sizes. The version lives in kymo_version.h; kymo_config_check.h validates the settings and derives the KYMO_EFFECTIVE_* macros that the library and applications test. Both are included from here, so this stays the only header to include. All settings are preprocessor-only and create no firmware resources.

Precedence: compiler definitions (-D...) override the optional project header named by KYMO_USER_CONFIG_HEADER, which overrides the profile, which overrides the library defaults below.

Group Setting Default Effect
Master KYMO_ENABLED 1 0 compiles the whole library out
Profile KYMO_PROFILE MINIMAL Preset defaults for the switches below
1. Telemetry API KYMO_ENABLE_RUNTIME 1 Cyclic KymoRuntime_init/KymoRuntime_main (recommended)
KYMO_ENABLE_CPP 0 Optional C++ push sender (KymoSender)
Modular integration KYMO_ENABLE_ENDPOINT 0 Optional feature coordination (TX)
Shared transport KYMO_ENABLE_TX 0 Single-frame copy and partial writes
2. Telemetry payload KYMO_ENABLE_X 0 X coordinate per sample
KYMO_ENABLE_Z 0 Z coordinate per sample
KYMO_ENABLE_TIMESTAMP 0 Timestamp per sample
KYMO_ENABLE_CRC 0 CRC-8 on outgoing frames
KYMO_ENABLE_CRC_TABLE 0 Table CRCs: faster, 256/512 B flash
KYMO_ENABLE_DECODER 0 Frame decoder on the MCU
2b. Back channel KYMO_ENABLE_PARAMETERS 0 Host writes to registered parameters
KYMO_ENABLE_WATCH 0 Host samples variables by address (ELF)
KYMO_ENABLE_MEMORY 0 Stack peaks and heap levels as curves
3. Execution tracing KYMO_ENABLE_TRACE 0 Trace recorder, instrumentation, mux
KYMO_ENABLE_TRACE_ISR 0 ISR enter/exit (needs TRACE)
KYMO_ENABLE_TRACE_SCHEDULER 0 Task switches (needs TRACE_ISR)
KYMO_ENABLE_TRACE_FLOW 0 Send/receive correlation (needs TRACE)
KYMO_ENABLE_TRACE_STACK_POINTER 0 Stack pointer in ENTER/EXIT (TRACE)
4. Resource sizes KYMO_MAX_CHANNELS 16 Telemetry channels per context (1..256)
KYMO_TRACE_* see below Trace ring, contexts, depths
KYMO_MUX_ADMIN_RECORD_MAX 512 Largest queued admin record in bytes
KYMO_MAX_PARAMETERS 8 Parameters per receiver (1..256)
KYMO_MAX_WATCHES 8 Live-variable slots (1..64)
KYMO_WATCH_MIN_PERIOD_MS 5 Shortest sampling period (1..60000)
KYMO_MAX_MEMORY_ENTRIES 8 Reported memory entries (1..32)

Profiles only change defaults; every switch can still be set individually:

  • KYMO_PROFILE_MINIMAL (0): scalar values, no timestamp, no tracing.
  • KYMO_PROFILE_XYZ (1): X, Z and timestamps enabled.
  • KYMO_PROFILE_TRACE (2): XYZ plus trace recorder with ISR, scheduler and flow events.

Every boolean switch accepts only literal 0 or 1.

Usage
Pass settings with -D, or set KYMO_USER_CONFIG_HEADER to a quoted header path.
-DKYMO_PROFILE=KYMO_PROFILE_XYZ -DKYMO_MAX_CHANNELS=4
#define KYMO_PROFILE_XYZ
Profile value: X, Z and timestamp enabled.
Definition kymo_config.h:79

Definition in file kymo_config.h.

Macro Definition Documentation

◆ KYMO_ENABLE_CPP

#define KYMO_ENABLE_CPP   0

Enable the library-owned Core Init/Main entry (0 or 1).

Enables its internal dispatcher and sender automatically. Features remain separately gated and require successful feature Init to run.

Usage Define KYMO_ENABLE_CORE=1 consistently for all translation units.

Enable cooperative Init/Main scheduling; defaults to enabled.

Compile the optional C++ push sender; defaults to disabled.

Definition at line 108 of file kymo_config.h.

◆ KYMO_ENABLE_CRC

#define KYMO_ENABLE_CRC   0

Protect outgoing DATA frames with CRC; defaults to disabled.

Definition at line 160 of file kymo_config.h.

◆ KYMO_ENABLE_CRC_TABLE

#define KYMO_ENABLE_CRC_TABLE   0

Compute CRC-8 and the trace CRC-16 with lookup tables; defaults to disabled.

Same results, about eight times fewer operations per byte, for 256 bytes (CRC-8, when CRC or the decoder is compiled in) plus 512 bytes (CRC-16, when trace is compiled in) of flash. Worth it on fast transports such as USB or Wi-Fi.

Usage
-DKYMO_ENABLE_CRC_TABLE=1

Definition at line 172 of file kymo_config.h.

◆ KYMO_ENABLE_ENDPOINT

#define KYMO_ENABLE_ENDPOINT   0

Enable modular Endpoint Init/Main; disabled by default.

Requires TX; each feature is still selected by its own build switch.

Usage Define KYMO_ENABLE_ENDPOINT=1 and KYMO_ENABLE_TX=1 project-wide.

Definition at line 126 of file kymo_config.h.

◆ KYMO_ENABLE_TIMESTAMP

#define KYMO_ENABLE_TIMESTAMP   0

Include timestamps in DATA frames; on in the XYZ and TRACE profiles.

Definition at line 154 of file kymo_config.h.

◆ KYMO_ENABLE_TRACE_STACK_POINTER

#define KYMO_ENABLE_TRACE_STACK_POINTER   0

Compile complete-frame MCU decoding; defaults to disabled.

Compile the parameter receiver for host writes; requires the decoder; defaults to disabled.

Compile live variables: the host samples memory by address; requires the decoder; defaults to disabled.

Report stack peaks and heap levels (KymoMemory); defaults to disabled.

Needs no decoder: the device describes its entries with MEMORY_INFO frames by itself and samples them as ordinary DATA points.

Usage
-DKYMO_ENABLE_MEMORY=1, then KymoMemory_init with a read callback.

Compile the trace recorder, instrumentation and mux; on in the TRACE profile.

Compile ISR tracing; requires trace; on in the TRACE profile.

Compile scheduler tracing; requires ISR tracing; on in the TRACE profile.

Compile flow correlation tracing; requires trace; on in the TRACE profile.

Record the stack pointer in ENTER/EXIT events; requires trace; defaults to disabled.

The value goes into the otherwise unused arg field and sets KYMO_TRACE_FLAG_STACK_SAMPLE, so events keep their 32 bytes. The host derives the stack depth per context from it. Reading costs one compiler builtin per event.

Usage
-DKYMO_ENABLE_TRACE_STACK_POINTER=1; on compilers without __builtin_frame_address also define KYMO_TRACE_READ_STACK_POINTER() to return the current stack address.

Definition at line 251 of file kymo_config.h.

◆ KYMO_ENABLE_TX

#define KYMO_ENABLE_TX   0

Enable the shared single-frame transport sender; disabled by default.

Independent of runtime and trace; storage is supplied by the caller.

Usage Set KYMO_ENABLE_TX=1 for all application and library sources.

Definition at line 117 of file kymo_config.h.

◆ KYMO_ENABLE_X

#define KYMO_ENABLE_X   0

Include X coordinates in the wire payload; on in the XYZ and TRACE profiles.

Definition at line 136 of file kymo_config.h.

◆ KYMO_ENABLE_Z

#define KYMO_ENABLE_Z   0

Include Z coordinates in the wire payload; on in the XYZ and TRACE profiles.

Definition at line 145 of file kymo_config.h.

◆ KYMO_ENABLED

#define KYMO_ENABLED   1

Global KymoCore gate; defaults to enabled. Define 0 for compile-out.

Definition at line 72 of file kymo_config.h.

◆ KYMO_MAX_CHANNELS

#define KYMO_MAX_CHANNELS   16u

Telemetry channels a single KymoContext can schedule (1..256).

Each channel costs four bytes of scheduling state inside KymoContext.

Definition at line 261 of file kymo_config.h.

◆ KYMO_MAX_MEMORY_ENTRIES

#define KYMO_MAX_MEMORY_ENTRIES   8u

Most entries one KymoMemory reports (1..32).

Costs nothing per entry inside KymoCore; the entries live in the application.

Usage
-DKYMO_MAX_MEMORY_ENTRIES=16 for many tasks.

Definition at line 326 of file kymo_config.h.

◆ KYMO_MAX_PARAMETERS

#define KYMO_MAX_PARAMETERS   8u

Parameters one KymoParamReceiver can hold (1..256).

Each parameter costs one bit of pending-readback state inside the receiver; the parameter table itself is owned by the application.

Definition at line 300 of file kymo_config.h.

◆ KYMO_MAX_WATCHES

#define KYMO_MAX_WATCHES   8u

Live-variable slots one KymoWatch can sample (1..64).

Each slot costs 16 bytes inside KymoWatch.

Definition at line 308 of file kymo_config.h.

◆ KYMO_MUX_ADMIN_RECORD_MAX

#define KYMO_MUX_ADMIN_RECORD_MAX   512u

Largest administrative record the mux can queue, in bytes (64..8192).

Definition at line 291 of file kymo_config.h.

◆ KYMO_PROFILE

#define KYMO_PROFILE   KYMO_PROFILE_MINIMAL

Selected preset; changes only the defaults of the switches below.

Definition at line 86 of file kymo_config.h.

◆ KYMO_PROFILE_MINIMAL

#define KYMO_PROFILE_MINIMAL   0

Profile value: scalar telemetry only (library default).

Definition at line 76 of file kymo_config.h.

◆ KYMO_PROFILE_TRACE

#define KYMO_PROFILE_TRACE   2

Profile value: XYZ plus complete execution tracing.

Definition at line 82 of file kymo_config.h.

◆ KYMO_PROFILE_XYZ

#define KYMO_PROFILE_XYZ   1

Profile value: X, Z and timestamp enabled.

Definition at line 79 of file kymo_config.h.

◆ KYMO_TRACE_CORE_COUNT

#define KYMO_TRACE_CORE_COUNT   1u

Number of recorder cores supported (1 or 2).

Definition at line 271 of file kymo_config.h.

◆ KYMO_TRACE_EVENTS_PER_CORE

#define KYMO_TRACE_EVENTS_PER_CORE   64u

Trace event ring capacity per core (power of two, 16..4096).

Definition at line 266 of file kymo_config.h.

◆ KYMO_TRACE_MAX_CONTEXTS

#define KYMO_TRACE_MAX_CONTEXTS   16u

Maximum tracked trace contexts such as tasks or ISRs (1..256).

Definition at line 276 of file kymo_config.h.

◆ KYMO_TRACE_MAX_DEPTH

#define KYMO_TRACE_MAX_DEPTH   32u

Maximum stored scope symbols per trace context (1..255).

Definition at line 281 of file kymo_config.h.

◆ KYMO_TRACE_MAX_ISR_DEPTH

#define KYMO_TRACE_MAX_ISR_DEPTH   8u

Maximum nested ISR activations when ISR tracing is effective (1..16).

Definition at line 286 of file kymo_config.h.

◆ KYMO_WATCH_MIN_PERIOD_MS

#define KYMO_WATCH_MIN_PERIOD_MS   5u

Shortest live-variable sampling period in milliseconds (1..60000).

Reported to the host; shorter requests are rejected.

Definition at line 316 of file kymo_config.h.