Faster FreeRTOS Percepio Tracealyzer Streaming with Segger RTT

To solve the real hard problem of Embedded Systems development, I usually need all the data I can get from the target. The Percepio Tracealizer is such a tool which can stream application and FreeRTOS trace from the target over a Segger J-Link connection using the Segger RTT protocol. I’m using that combination a lot.

Streaming trace data that way does not need a dedicated hardware like ETM Trace. Using RTT is usually not much intrusive and affects the performance of the target in the 1-2% range (of course depending on the amount of data).

But what worried me for several weeks is that after moving to FreeRTOS V10.0.0 and the same time updating the Segger libraries, the target performance was heavily affected:

RTT Streamnig affects target performance

RTT streaming affects target performance?

My thought was that it must have something to do with the new FreeRTOS V10.0.0, but I was never able to isolate the problem. It seemed even kind of random, as on some targets the effect was not that noticeable.

I’m using the following versions:

  • FreeRTOS V10.0.0
  • Percepio Tracealyzer V3.3.0.7920
  • Segger RTT V6.22c
  • Segger J-Link JLinkARM.dll V6.30c (DLL compiled Feb 9 2018 17:20:54)

I contacted Percepio, and they were puzzled with that problem too. Finally, Percepio has find something:

Because most of my ARM targets implements SWD, I’m using that method to connect to the target in the debug launch configurations:

SWD Interface in GDB Launch Configuration

SWD Interface in GDB Launch Configuration

In the Percepio Tracealyzer setting there is a similar setting, which usually is set to default:

Percepio Tracealizer RTT Setting

Percepio Tracealyzer RTT Setting

The thing is that changing it from ‘Default’ to ‘SWD’ solves the performance problem:

Connection Setting to SWD

Connection Setting to SWD

Now the target performance is what it should be, and back to were it was πŸ™‚ :

IImproved Target Performance

Improved Target Performance

So if you see slow RTT performance, make sure that both sides are using SWD.

So at the end it was not the FreeRTOS, but possible a change in the Segger DLL’s causing that performance problem, because in the past using ‘Default’ was fine. And I did not realize that having updated the Segger DLL’s could have caused such an effect. Probably something goes wrong with that automatic protocol detection.

Thanks to Johan Kraft from Percepio for the hint!

Happy Streaming πŸ™‚


9 thoughts on “Faster FreeRTOS Percepio Tracealyzer Streaming with Segger RTT

  1. Pingback: Having problems with J-Link RTT streaming? - Percepio AB

  2. Pingback: Tutorial: FreeRTOS 10.0.1 with NXP S32 Design Studio 2018.R1 | MCU on Eclipse

  3. Pingback: Running FreeRTOS on the VEGA RISC-V Board | MCU on Eclipse

  4. Pingback: Implementing FreeRTOS Performance Counters on ARM Cortex-M | MCU on Eclipse

  5. Pingback: Tutorial: Adding FreeRTOS to where there is no FreeRTOS | MCU on Eclipse

  6. Pingback: RTOS Trace: TraceX with Microsoft Azure RTOS (aka ThreadX) | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.