RTT in Embedded Studio

From SEGGER Wiki
Jump to: navigation, search

SEGGER Embedded Studio provides RTT printf(); functionality automatically. To use more RTT functions, the full RTT target package needs to be added to the current Embedded Studio Project.

The following Tutorial will show how to implement the RTT target package to an Embedded Studio project.

Get the RTT Target Package

The RTT Target Package is included in the J-Link Software and Documentation Pack.

  1. Download the J-Link Software and Documentation Pack from the link below.
  2. Open the downloaded file and start the installation process.
  3. Open the installation directory of the J-link Software and Documentation Pack in the file explorer.
    • Example on Windows: C:\Program Files\SEGGER\JLink
  4. Go to Samples/RTT
  5. The RTT Target Package can be found in the .zip file.

Add the RTT Target Package to the Embedded Studio Project

Project Options
  1. Open the Solution Directory in the file explorer.
  2. Copy the folders Config and RTT from the RTT Target Package into the solution directory.
    • Embedded Studio (version 6.20 or newer) does not require Syscalls to retarget printf(). Do not copy the Syscalls folder!
  3. In Embedded Studio open the Project Settings and select the "Common" configuration to be edited.
  4. Select Preprocessor -> User Include Directories and add the paths to the folders copied into the solution.
    • Example: $(ProjectDir)/RTT and $(ProjectDir)/Config
  5. In the Project Explorer create two folders in the project Config and RTT.
  6. Add the Files from the solution Directory to those two folders in the Project Explorer.

If everything is installed correctly, the project should look like this in the solution directory and in Embedded Studio:

Project Directory

Project Explorer

The RTT functions can now be used in the project to print output. Embedded Studio directly supports RTT and prints the output to the Debug Terminal. Other tools, such as RTT Viewer can be used, too.

RTT Functions example

RTT Functions example Output in Debug Terminal of ES