This repository is the Zephyr project module for integrating Segger RTT (wiki), SystemView (wiki) and Monitor mode debugging with Zephyr RTOS.
The code here is predominantly untouched public Segger source code with changes to support Zephyr RTOS.
This README identifies the origin of upstream Segger files and suggests a procedure to follow when updating to a new Segger release.
Segger's official GitHub repository is not currently actively maintained, hence Segger code is obtained from publicly accessible download links posted on Segger's website.
Download "SystemView, Target Sources" from the SystemView downloads webpage. This download contains both RTT and SystemView sources.
Download "Example project" from the Monitor mode debugging webpage.
Upgrading to a new Segger release means migrating existing Zephyr changes to the latest Segger
code. There are many tools (diff
, patch
, git diff
, etc.) and different approaches to
accomplishing this -- use what you are familiar with. The following procedure is a guide to
achieving the desired result.
- Obtain the updated Segger code and prepare for subsequent steps
- Download upstream code from the links above
- Extract the SystemView update and delete the
Samples
directory - Extract the Monitor mode example and delete non-JLINK_MONITOR* files
- Organize the files to match the directory structure of this repository
- Convert line endings of all files to Unix style LF (
\n
) - Strip trailing white space of all files
- Establish the Zephyr patches that will be applied in step 3
- Download the SystemView release this repository is currently based on (refer to "SystemView version: x.yy" in the source files to determine the current release)
- Repeat step 1 parts ii-vi for these downloaded files
- Compare the files of this repository to those of step 2 part ii to identify the existing Zephyr changes (the "diff", or "patch") needed for step 3
- Apply the Zephyr changes to the new Segger release
- Apply the patches from step 2 part iii to the files of step 1
- Sanity check the result and revise as needed
- Review/update the list of patched files below
- Commit the updated + modified Segger files and push the change
- Open a pull-request to merge the change into this repository
Segger source files with Zephyr specific changes:
Config/SEGGER_RTT_Conf.h
- Defines related to RTT buffers, memory region, locking mechanism
Config/SEGGER_SYSVIEW_Conf.h
- Defines related to SystemView buffers, memory region, locking mechanism
SEGGER/SEGGER_RTT.c
- RTT initialization options