From 0db2685674fe0aa46c3bf94947edbbca070af2e7 Mon Sep 17 00:00:00 2001 From: David Lesnjak Date: Thu, 23 Jul 2026 09:47:01 +0200 Subject: [PATCH] Documentation: document pyOCD CI termination after SDS playback --- documentation/sdsio.md | 4 +++- documentation/utilities.md | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/documentation/sdsio.md b/documentation/sdsio.md index fbf9241..7e63888 100644 --- a/documentation/sdsio.md +++ b/documentation/sdsio.md @@ -150,7 +150,9 @@ python sdsio-server.py -c myproject.sdsio.yml **How it works:** -pyOCD does not required a connect message. Instead the RTT channel configuration is part of the `*.cbuild-run.yml` file that also specifies project files and other hardware related parameters. Refer to [CMSIS-Toolbox - Run and Debug Configuration](https://open-cmsis-pack.github.io/cmsis-toolbox/build-overview/#run-and-debug-configuration) for further information. +pyOCD does not require a connect message. Instead the RTT channel configuration is part of the `*.cbuild-run.yml` file that also specifies project files and other hardware related parameters. Refer to [CMSIS-Toolbox - Run and Debug Configuration](https://open-cmsis-pack.github.io/cmsis-toolbox/build-overview/#run-and-debug-configuration) for further information. + +For CI runs that should stop automatically after SDS playback, start pyOCD with `--eot` and run SDSIO-Server with `--playback --exit-after-playback`. After playback completes, SDSIO-Server sets `SDS_FLAG_TERMINATE`. The target application can then write EOT (`0x04`). pyOCD can terminate on this character only when it receives the target standard output stream, for example through semihosting or RTT stdio. If standard output is retargeted directly to UART, the character bypasses pyOCD and `--eot` will not stop the pyOCD run. ## Layer: sdsio_fs diff --git a/documentation/utilities.md b/documentation/utilities.md index b75e1dc..f30fb34 100644 --- a/documentation/utilities.md +++ b/documentation/utilities.md @@ -425,6 +425,8 @@ Then reload rules with `sudo udevadm control --reload && sudo udevadm trigger`. The SDSIO-Server can be used in CI systems. When combined with the [pyOCD Debugger](https://open-cmsis-pack.github.io/cmsis-toolbox/pyOCD-Debugger/) fully automated HIL tests can be configured. +When `sdsio-server` runs with `--playback --exit-after-playback`, playback completion requests CI termination by setting `SDS_FLAG_TERMINATE` in the flags sent to the target. If the target application writes EOT (`0x04`) to standard output retargeted through a pyOCD-managed channel, such as semihosting or RTT stdio, pyOCD can detect it when started with `--eot` and exit. If standard output is retargeted directly to UART, pyOCD does not see that character, so `--eot` will not terminate pyOCD. Keep `--timelimit` as a fallback in case the target application does not reach the termination state or EOT is not routed through pyOCD. + This example contains the relevant steps in a GitHub workflow: ```