Over a million developers have joined DZone.

Faster FreeRTOS Percepio Tracealyzer Streaming With Segger RTT

DZone 's Guide to

Faster FreeRTOS Percepio Tracealyzer Streaming With Segger RTT

Noticing a plunge in the performance of your embedded apps that use FreeRTOS? Let's take a look at what the root cause could be and how to fix it.

· IoT Zone ·
Free Resource

To solve the really hard problems of embedded systems development, I usually need all the data I can get from the target. The Percepio Tracealyzer is such a tool. It can stream applications and FreeRTOS traces 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. But finally, Percepio found something.

Because most of my ARM targets implement 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 where it was:

IImproved Target Performance

Improved Target Performance

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

So, in the end, it was not FreeRTOS, but possibly a change in the Segger DLLs causing that performance problem, because in the past, using ‘Default’ was fine. I did not realize that updating the Segger DLLs could have caused such an effect. Probably, something went wrong with automatic protocol detection.

Thanks to Johan Kraft from Percepio for the hint!

Happy streaming!

iot ,freertos ,embedded systems ,percepio tracealyzer ,segger rtt ,performance ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}