This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Tracealyzer for "FreeRTOS+Trace"

This question is similar to the feature request: devzone.nordicsemi.com/.../sdk-12-x-0-future-feature-requests

I have to evaluate if we buy Tracealyzer (percepio.com/.../). However, it's only of use to us, if we can use it with: Nordic SDK + "FreeRTOS+Trace". Does that work? Especially regarding the softdevice (S132 for nrf52832)

I'm asking because I didn't have much luck with SystemView, as it looks like we'd need to add some hacks...which I don't feel comfortable with for production. Refer to: https://devzone.nordicsemi.com/b/blog/posts/profiling-the-softdevice-and-freertos-with-segger-

Or is there any other way to get either Tracealyzer or SystemView to work?

  • No, there are no hooks in the softdevice that will allow you to use the SystemViewer. So you cannot use them to analyze softdevice interrupts. But  you can ofcourse use it to analyze application interrupts. A long time ago  RK has provided some hacks to be able to instrument your whole system using SystemViewer. Maybe you can use that .

  • Thank you for your answer Slight smile

    I found the article where RK has provided instructions on getting it to work with hacks. However, I don't feel comfortable applying those hacks and then ship that product. (refer to initial question)

    What about Tracealyzer for "FreeRTOS+Trace"? Would it work without any hacks in the softdevice? I only want to analyze the behavior of FreeRTOS (blocking tasks, ressource usage, etc.). To my knowledge, Tracealyzer would be perfect for that.

    However, this requires that Tracealyzer works even if the softdevice is present.

  • Sorry for the late reply, I am on vacation and hence did not have internet access at all times.

    Looking at the picture below

    The library itself is in FreeRTOS kernel and the application, which does not depend on softdevice resources. So  Tracealyzer should work with the softdevice presence. But I am not sure about the statistics it will present. I mean that FreeRTOS port that Nordic has implemented has no clue about the softdevice activity.

    Lets assume that there are two FreeRTOS tasks that you are trying to analyze using the Tracealyzer. Lets say that Task A runs for 20 ms and then softdevice steals the CPU  for 3 ms to configure for the upcoming RADIO activity and give the control back to the FreeRTOs at which point it will schedule Task B. But your Tracealyzer will definitely show that Task A has been running for 23 ms (Task A + Softdevice run time) instead of 20 ms since it has no clue about softdevice (as this is not running as a task) but it still can see that 23 ms ticks has been passed when it does a context switch from Task A to Task B. I am sure that this will be very confusing data for you.

    In short, You cannot get meaningful data without telling Tracealyzer about the softdevice activity, which in turn cannot be done without RK's hacks.

Related