# Porting Tracelyser to AWS Free RTOS Kernel

**URL:** <https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048>\
**Category:** Kernel\
**Tags:** tracealyzer, debug, trace\
**Created:** [May 11, 2022, 5:04pm UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048 "2022-05-11T17:04:24Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Surender](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@Surender](https://forums.freertos.org/u/Surender)\
**Post date:** [May 11, 2022, 5:04pm UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/1 "2022-05-11T17:04:24Z")

</div>

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.

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/5/58326647c0e0a07e3e2783aac036c6594c817aea.png)

Regards,  
Surender Sampath

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [May 11, 2022, 5:34pm UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/2 "2022-05-11T17:34:15Z")

</div>

The Percepio website contains a lot of documentation, [including quick start guides](https://percepio.com/gettingstarted-freertos/).

---

<div class="post-metadata">

**Author:** ![johankraft](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@johankraft](https://forums.freertos.org/u/johankraft)\
**Post date:** [May 13, 2022, 2:12pm UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/3 "2022-05-13T14:12:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Surender](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@Surender](https://forums.freertos.org/u/Surender)\
**Post date:** [May 13, 2022, 3:01pm UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/4 "2022-05-13T15:01:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [May 13, 2022, 8:39pm UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/5 "2022-05-13T20:39:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Surender](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@Surender](https://forums.freertos.org/u/Surender)\
**Post date:** [May 20, 2022, 1:45pm UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/6 "2022-05-20T13:45:16Z")

</div>

@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](https://d2v6vdsk2p900z.cloudfront.net/original/2X/b/b35d81cf428344759ca5a9c7636e46dfad354ad7.png)

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.

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/0/0bef73c27799cb710cf1c32066cf7bff56b17705.jpeg)

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

![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/a/a4fb7ca58259c73ff698b4f99325308192eb51b0.png)

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/f/ffd9fb74834353f1e8bfb1d8382c4192ee1a945c.png)

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

---

<div class="post-metadata">

**Author:** ![johankraft](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@johankraft](https://forums.freertos.org/u/johankraft)\
**Post date:** [May 20, 2022, 3:06pm UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/7 "2022-05-20T15:06:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Surender](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@Surender](https://forums.freertos.org/u/Surender)\
**Post date:** [May 23, 2022, 10:02am UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/8 "2022-05-23T10:02:56Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Surender](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@Surender](https://forums.freertos.org/u/Surender)\
**Post date:** [May 24, 2022, 8:53am UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/9 "2022-05-24T08:53:17Z")

</div>

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?

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/3/32119dbd9683669297a384c0a80491a83cfe3a61.png)  
 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/c/c3d9b0d21434dde2e037d72445b3d9b6344d267d.png)

TIA,  
Surender

---

<div class="post-metadata">

**Author:** ![fredskar](https://avatars.discourse-cdn.com/v4/letter/f/a8b319/32.png) [@fredskar](https://forums.freertos.org/u/fredskar)\
**Post date:** [May 25, 2022, 6:21am UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/10 "2022-05-25T06:21:59Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![Surender](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@Surender](https://forums.freertos.org/u/Surender)\
**Post date:** [May 27, 2022, 1:44pm UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/11 "2022-05-27T13:44:40Z")

</div>

@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/](https://protect-eu.mimecast.com/s/EIWhCq2jwtNYN0CZ5NYq?domain=amazon.co.uk/) He has written a lot on RTOS and this set of two books (get both volumes, the theory and practice) focuses on FreeRTOS."

---

<div class="post-metadata">

**Author:** ![johankraft](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@johankraft](https://forums.freertos.org/u/johankraft)\
**Post date:** [May 29, 2022, 8:58am UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/12 "2022-05-29T08:58:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![fredskar](https://avatars.discourse-cdn.com/v4/letter/f/a8b319/32.png) [@fredskar](https://forums.freertos.org/u/fredskar)\
**Post date:** [June 17, 2022, 4:13pm UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/13 "2022-06-17T16:13:14Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![fredskar](https://avatars.discourse-cdn.com/v4/letter/f/a8b319/32.png) [@fredskar](https://forums.freertos.org/u/fredskar)\
**Post date:** [July 5, 2022, 9:49am UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/14 "2022-07-05T09:49:42Z")

</div>

@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](mailto:support@percepio.com)

---

<div class="post-metadata">

**Author:** ![Surender](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@Surender](https://forums.freertos.org/u/Surender)\
**Post date:** [July 5, 2022, 10:10am UTC](https://forums.freertos.org/t/porting-tracelyser-to-aws-free-rtos-kernel/15048/15 "2022-07-05T10:10:48Z")

</div>

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