From 2df5339b7d9929fafb6716d03f895da5026797a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20H=C3=B6henleitner?= Date: Wed, 4 Sep 2024 16:12:07 +0300 Subject: [PATCH] Update TraceWithTrice.md --- docs/TraceWithTrice.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/TraceWithTrice.md b/docs/TraceWithTrice.md index 681a6378..ef19a4ab 100644 --- a/docs/TraceWithTrice.md +++ b/docs/TraceWithTrice.md @@ -102,7 +102,7 @@ Learning that *Trice* is also a [baby girl name](https://www.babynamespedia.com *Trice* performs **no** [costly](./TriceVsPrintfSimilaritiesAndDifferences.md#printf-like-functions) printf-like functions on the target at all. The `trice` macro, instead, just copies an ID together with the optional values to a buffer and is done. In the minimum case this can happen in [6-8](./TriceSpeed.md) processor clocks even with target timestamps included. When running on a 64 MHz clock, **light can travel about 30 meters in that time**. -To achieve that, an automatable pre-compile step is needed, executing a `trice insert` command on the PC. The **trice** tool parses then the source tree for macros like `trice( "msg: %d Kelvin\n", k );` and patches them to `trice( iD(12345), "msg: %d Kelvin\n", k );`, where `12345` is a generated 14-bit identifier copied into a [**T**rice **I**D **L**ist](../til.json). During compilation than, the `trice` macro is translated to the `12345` ID only, and the optional parameter values. The format string is ignored by the compiler. +To achieve that, an automatable pre-compile step is needed, executing a `trice insert` command on the PC. This is fast enough not to disturb the build process. The **trice** tool parses then the source tree for macros like `trice( "msg: %d Kelvin\n", k );` and patches them to `trice( iD(12345), "msg: %d Kelvin\n", k );`, where `12345` is a generated 14-bit identifier copied into a [**T**rice **I**D **L**ist](../til.json). During compilation than, the `trice` macro is translated to the `12345` ID only, and the optional parameter values. The format string is ignored by the compiler. The target code is [project specific](../test/F030R8/Core/Inc/triceConfig.h) configurable. In **immediate mode** the the stack is used as *Trice* buffer and the TRICE macro execution includes the quick [COBS](https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing) encoding and the data transfer. This more straightforward and slower architecture can be interesting for many cases because it is anyway much faster than printf-like functions calls. In **deferred mode** a service swaps the *Trice* double buffer periodically, the COBS encoding takes part and with the filled buffer the background transfer is triggered. Out buffer and half *Trice* buffer share the same memory for efficiency.