KymoCore/Dokumentation
v8.0.0 Stabil⌄
Versionen8.0.0 Aktuell
GitHub ↗
KYMOCORE / API REFERENCE

kymo_core_watch.h File Reference

API-Verträge im englischen Original. Navigation und Anleitungen sind zweisprachig.

Complete application interface for the default Core watch feature. More...

#include "kymo_types.h"

Go to the source code of this file.

Classes

struct  KymoWatchRange
 One memory range the host may read. More...
struct  KymoCoreWatchConfig
 Application configuration for watch. More...

Macros

#define KYMO_WATCH_BUILD_ID_MAX   20u
 Longest build ID in bytes.
#define KYMO_WATCH_MAX_RANGES   4u
 Most memory ranges one KymoWatch reports and checks.
#define KYMO_WATCH_FRAME_MAX_SIZE   (11u + KYMO_WATCH_BUILD_ID_MAX + (8u * KYMO_WATCH_MAX_RANGES))
 Largest frame KymoWatch_nextReply produces (a full WATCH_INFO_REPLY).

Typedefs

typedef uint8_t(*) KymoWatchReadFn(void *pContext, uint32_t address, uint8_t sizeBytes, uint8_t *pOutputAv)
 Optional memory reader.

Functions

KymoStatus KymoCoreWatch_init (const KymoCoreWatchConfig *pConfig)
 Initialize watch and activate its processing in Core Main.

Detailed Description

Complete application interface for the default Core watch feature.

Configuration is copied; referenced tables, buffers and callback contexts must remain alive. No heap or application-owned dispatcher state is required.

Usage Enable the feature, initialize Core, initialize this feature, call Core Main.

Definition in file kymo_core_watch.h.

Macro Definition Documentation

◆ KYMO_WATCH_BUILD_ID_MAX

#define KYMO_WATCH_BUILD_ID_MAX   20u

Longest build ID in bytes.

KymoWatch_init rejects longer IDs. 20 bytes hold a SHA-1 GNU build ID.

Usage
Pass at most this many bytes, e.g. the first 16 of an ESP32 app_elf_sha256.

Definition at line 25 of file kymo_core_watch.h.

◆ KYMO_WATCH_FRAME_MAX_SIZE

#define KYMO_WATCH_FRAME_MAX_SIZE   (11u + KYMO_WATCH_BUILD_ID_MAX + (8u * KYMO_WATCH_MAX_RANGES))

Largest frame KymoWatch_nextReply produces (a full WATCH_INFO_REPLY).

Sync (2), descriptor, length, 6 fixed payload bytes, build ID, range count, 8 bytes per range and CRC.

Usage
Declare uint8_t frame[KYMO_WATCH_FRAME_MAX_SIZE] for KymoWatch_nextReply.

Definition at line 42 of file kymo_core_watch.h.

◆ KYMO_WATCH_MAX_RANGES

#define KYMO_WATCH_MAX_RANGES   4u

Most memory ranges one KymoWatch reports and checks.

Limited by the 64-byte control payload together with the build ID.

Usage
Typically one range for .data/.bss, perhaps a second for external RAM.

Definition at line 33 of file kymo_core_watch.h.

Typedef Documentation

◆ KymoWatchReadFn

typedef uint8_t(*) KymoWatchReadFn(void *pContext, uint32_t address, uint8_t sizeBytes, uint8_t *pOutputAv)

Optional memory reader.

Copies sizeBytes bytes from device address address into pOutputAv in the device's own byte order. Use it to lock around 8-byte reads or to map wire addresses on a host build. Called only for checked, aligned addresses.

Parameters
[in]pContextApplication context supplied through pReadContext.
[in]addressDevice address inside an allowed range.
[in]sizeBytes1, 2, 4 or 8.
[out]pOutputAvDestination of at least sizeBytes bytes.
Returns
1 when the bytes were read, 0 to skip this sample.
Usage
static uint8_t read_locked(void *c, uint32_t a, uint8_t n, uint8_t *o) { lock(); memcpy(o, (void *)(uintptr_t)a, n); unlock(); return 1u; }

Definition at line 75 of file kymo_core_watch.h.

Function Documentation

◆ KymoCoreWatch_init()

KymoStatus KymoCoreWatch_init ( const KymoCoreWatchConfig * pConfig)

Initialize watch and activate its processing in Core Main.

Call once after Core Init and before the first Main. Setup errors latch a Core fault; late calls are rejected without altering the running Core. No callbacks are invoked periodically until Core Main runs. Not ISR-safe.

Parameters
[in]pConfigPersistent referenced data and callbacks; NULL is invalid.
Returns
OK, BAD_CONFIG, REJECTED, or an existing Core error.
Usage Check success before entering the common main loop.