Porting Tracelyser to AWS Free RTOS Kernel

Hello,

I’m trying to use the Tracelyser in AWS-Kernel

I use idf version 4.2 on my Esp32.

When I build my project,
I can see the following screen. As you can see in the highlighted section of 3rd party libraries,
How to include tracelyser.

Regards,
Surender Sampath

The Percepio website contains a lot of documentation, including quick start guides.

Hello Surender. We have support for ESP32 since Tracealyzer v4.5. Make sure to read Section 2 in the user manual (under help) and there is also a special section about the ESP32 support. Search for ESP32 in the user manual viewer and it should be easy to find.

Hi @johankraft ,

I did get in touch with the technical staff at Perceptio and turns out the user manual doesn’t give us directions in a straight forward way to use Tracelyser in the AWS version of FreeRTOS.
Its meant for either a ESP Project or a standard FreeRTOS Kernel.

If you are talking about just the kernel then the “AWS version” of FreeRTOS is the standard version - that is - it is the one in the FreeRTOS org in github. The WinSim demo in the FreeRTOS download demonstrates the Percepio trace.

@rtel , @johankraft

Thank you for the reply. The user manuals focus on the ESP32 is for a IDF-FreeRTOS project and clearly doesn’t work with the AFR kernel. There are instructions on the missing configuration and it needs to be updated.

Also, the third party library of Tracelyser withing the afr free rtos project is outdated and is never included in the cmakelists for it to actually build that as a component. I could not find any instructions on how to build a 3rd party component into my project.

The Tracelyser asks me to include “TraceRecorder.h” in the freertos config.
But the error is that of missing TraceRecorder.h file as I’m not able to tell the linker how to include them.

These are my steps below.

  1. Copied the all the files from the FreeRTOS/TraceRecorder into freertos\libraries\3rdparty\tracealyzer_recorder

  2. Modified the freertos\libraries\3rdparty\CMakeLists.txt as below :

  3. Modified the freertos\libraries\Cmakelists.txt
    image

  4. Changed freertos\libraries\3rdparty\tracealyzer_recorder\config\trcConfig.h as below

  5. TRC_CFG_HARDWARE_PORT TRC_HARDWARE_PORT_XTensa_LX6

  6. Removed the “Include processor header file” line in trcConfig.h and “include sdkconfig.h”

  7. Modified freertos\libraries\3rdparty\tracealyzer_recorder\config\trcKernelPortConfig.h as below

  8. #define TRC_CFG_RECORDER_MODE TRC_RECORDER_MODE_SNAPSHOT

  9. Disabled Application Level Tracing. (No instructions to disable this for ESP32 AWS Kernel)

  10. Enabled Trace Facility in the Free Rtos Config.

  11. Included “trcRecorder.h” in the end of FreeRTOSconfig.h

  12. Added vTraceEnable(TRC_START); in the main()

I’m getting an error below.

My cmakelists looks like this as per AFR get started guide.

image

Could someone help how to include the trcrecorder before freertos config?

We are working on updated instructions for CMake.
Have you been in contact with Percepio support? (support@percepio.com)

@johankraft , I did get in touch with percepio and been able to come this far thanks to the support team. As I mentioned, we are still betwixt on the missing pieces to to get it work alongside afr-freertos on the esp32.

Could you anyone please help me with the following issue.
I was able to build 3rd party dependency and when I include a header file in the FreeRtosConfig.h, I get a error saying it’s missing.
How do include 3rd party dependency in my cmakelists?


TIA,
Surender

@Surender I just want to let you know that we are working on this and are trying to find a solution that will work.

/Percepio

1 Like

@fredskar Just wanted to update the solution I received here. So everyone could find it useful.

Chris Hills on behalf of Percepio suggests :
"Porting of Tracealyzer tends to be done by the Users and/or silicon companies rather than Percepio.

If you are going to be using FreeRTOS you need to get up to speed yourselves on the environment, the code files and make files. Also how to build components. I can recommend a good book or RTOS by Jim Cooling https://www.amazon.co.uk/Real-time-Operating-Systems-Book-engineering/dp/1795340657/ He has written a lot on RTOS and this set of two books (get both volumes, the theory and practice) focuses on FreeRTOS."

The reply from Chris is a bit simplified. While it is true that some users make their own ports and that some configuration is needed, we try to make it as easy as possible to get started. The issues you have encountered seems to go way beyond what is reasonable.

While we already support ESP32 with the Espressif variant of FreeRTOS, we had not yet tried using the regular (Amazon) FreeRTOS with the ESP32 tools. As Fredrik mentioned, we are looking into it and I expect we will provide a solution in the near future.

@Surender sorry for the delay, I have been rather busy and this was easier said than done. Since the ESP32 hardware port for our recorder is made for the ESP-IDF version of FreeRTOS there are some things that don’t work for the official FreeRTOS version that we need to look into.

Regarding the build system, it’s rather tricky when there are two different build systems that our recorder needs to be integrated to. If it’s built as a FreeRTOS library the ESP-IDF components won’t find it and vise versa. The best way I have found so far (I haven’t tested to run it yet because of the above-mentioned problem) is to add the recorder as a FreeRTOS library (as you have done) and then add the include paths for the recorder into the CMakeLists.txt file for the FreeRTOS component in ESP-IDF.

@Surender we have a working solution for ESP32 with AWS-FreeRTOS now (not officially released yet). If you still are interested, please contact support@percepio.com

@fredskar Thank you for getting back to us. I’ll reach out to percepio.