From 8b3a9ed38144e0b34a8efa6b78a1ccf0a5d6db48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominic=20H=C3=B6glinger?= Date: Wed, 14 May 2025 20:59:02 +0200 Subject: [PATCH] README.md: Fix example program, elaborate on blurb The example program (which is untested by the way) is corrected to generate the desired sawtooth, and a more realistic baudrate is chosen. Blurb extended by supported signal types. --- README.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 75ea4ac..d548781 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ▓ ▓ ▒ ░ ██ ██ ██ Streaming Event Trace ▓ ▓ ▓ ░░ ███████ █████ ██ A tiny signal tracing library ▓ ▓ ▒ ░ ██ ██ ██ - ▓▓▓▓▓ ░░░ ███████ ███████ ██ Version 1.0.1 Alpha + ▓▓▓▓▓ ░░░ ███████ ███████ ██ Version 1.0.2 Alpha ``` # Introduction @@ -12,6 +12,9 @@ SET is a small tracing library written in C99. It is highly optimized for minimal data usage and aims to be easy to use while also being flexible enough to be integrated in hard real time systems. +Signals types supported are almost all skalars (integers, floats), +integer arrays, events and strings. + # How to use SET requires the integrator to implement a few functions such as the timestamp and output functions in order to work. @@ -19,11 +22,11 @@ Apart from that, it is up to the specific use case how to stream data. In its simplest form, traces are processed with no real time demands on a dedicated interface. For more advanced usage, this library allows packets to be written, as the time budget allows, into any given buffer to send its contents via DMA to for instance a serial output. +Due to its packet format, the output interface can still be utilitzed as is unless +the text sent contains the packet preamble or epilouge, which are "\033[s" and "\033[u" respectively. -Simple example on Arduino: - +## Simple example on Arduino ````c - #include "set.h" // Basic implementation of output and timestamp retrieval @@ -43,14 +46,14 @@ void setup() set_enable(set_drop); // drop traces on full buffer set_u8trace("Serial.Ready", 0, false); - Serial.begin(921600); + Serial.begin(2000000); while (!Serial); set_u8trace("Serial.Ready", 1, false); } void loop() { - unsigned sawtooth = 0; + static unsigned sawtooth = 0; if (sawtooth < 0xFFFF) sawtooth++; else sawtooth = 0; @@ -92,8 +95,10 @@ It expects data via stdin, and displays any non-tracing traffic. Example usage tracing remotely via SSH: ````bash -# Open /dev/ttyUSB0 via SSH and record to "trace.vcd" with timescale of 1 microsecond with diagnostics enabled -ssh user@host -C "picocom -b 921600 /dev/ttyUSB0" | ./set_record.py -d trace.vcd -s ./Sources -t "1 us" --diagnostics +# Open /dev/ttyUSB0 via SSH and record to "trace.vcd" +# with timescale of 1 microsecond with diagnostics enabled +ssh user@host -C "picocom -b 921600 /dev/ttyUSB0" | \ +./set_record.py -d trace.vcd -s ./Sources -t "1 us" --diagnostics ```` The resulting VCD can be inspected with dedicated programs such as GTKwave.