Skip to content

About

This example project shows how to use SEGGER RTT with pyOCD.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SEGGER-RTT

Build SEGGER RTT Multicore Build SEGGER RTT STM32F407 Run SEGGER RTT Multicore

This repository contains example projects that show how to use SEGGER RTT with pyOCD. The examples carry standard I/O over the existing debug connection, so neither the target nor the test system needs a dedicated UART, extra pins, a connector, or a serial adapter. RTT can route this I/O to an interactive console during development or to files for repeatable, headless test automation, with minimal impact on real-time behavior.

Quick Start

  1. Install Keil Studio for VS Code from the VS Code marketplace.
  2. Clone this repository, for example using Git in VS Code, or download the ZIP file. Then open the repository root folder.

There are 2 example projects in this repository for the following boards:

  1. STMicroelectronics STM32F407G-DISC1 (single-core standard input and output)
  2. Infineon KIT_T2G-B-H_LITE (multicore standard output)

Follow the instructions in the README file for each project.

Target Sets

Each solution contains two target sets that configure how RTT standard I/O is handled by pyOCD:

  • console connects RTT channel 0 to an interactive serial console I/O.
  • file-io redirects RTT standard I/O to files. This target set is especially useful for automated, headless tests with pyOCD because test output can be collected and checked without an interactive terminal. The STM example reads name.txt and writes output.txt; the Infineon multicore example writes output_Cortex-M0p.txt, output_Cortex-M7-0.txt, and output_Cortex-M7-1.txt.

After building the Infineon solution with the file-io target set and programming the board, run the test from Infineon/T2G-B-H/out with:

pyocd run --cbuild-run RTT_Multicore+CYT4BF8CDS.cbuild-run.yml --eot -O reset_type=sysresetreq --timelimit 10

About SEGGER RTT

SEGGER Real Time Transfer (RTT) provides fast, bidirectional communication between an embedded target and a host computer while the application is running. It can be used for terminal I/O, diagnostic messages, and other data transfers with minimal impact on real-time behavior.

RTT uses the target's existing debug port rather than a dedicated UART. This has several practical benefits:

  • No extra UART peripheral, pins, connector, or USB-to-serial adapter is needed.
  • Production hardware can retain terminal I/O and diagnostics even when a UART is unavailable or not exposed on the board.
  • Automated Hardware-in-the-Loop (HIL) tests can program, control, and communicate with a target through the same debug connection.
  • Input and output are available without changing the application hardware.

pyOCD provides the host-side debug connection. It connects to CMSIS-DAP debug units such as Arm ULINKplus, as well as ST-LINK probes, and accesses RTT data through the target's debug port.

pyOCD tools ecosystem

Continuous Integration and Hardware-in-the-Loop Test

The CMSIS solution files are used for local development, CI builds, and target execution. The workflows use:

  • vcpkg-configuration.json to install consistent tools on developer systems and GitHub-hosted runners.
  • The *.csolution.yml files to describe the projects, software packs, build contexts, and target sets.
  • The generated *.cbuild-run.yml file to provide pyOCD with the images and target configuration for hardware execution.

CI and HIL test setup

Workflow Description
Build SEGGER RTT Multicore Builds the Infineon application with the file-io target set on a GitHub-hosted runner and uploads the generated files as an artifact.
Run SEGGER RTT Multicore Runs on a self-hosted, Linux-based GitHub runner connected to the Infineon KIT_T2G-B-H_LITE. It downloads the build artifact, programs and executes the target with pyOCD, captures RTT output, and verifies the output from all three cores.
Build SEGGER RTT STM32F407 Builds the STM32F407 application on a GitHub-hosted runner. This example has no HIL run action.

The HIL equipment and self-hosted runner are configured outside this repository. See the shared Arm-Examples instructions:

About

This example project shows how to use SEGGER RTT with pyOCD.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages