Trace functionality is supported in the S32 Debugger for A53 cores on the S32R, RAM-target builds. With Trace, you can record some execution data on an application project and then review it to determine the actions and data surrounding an event of interest.
This document outlines the method to begin using Trace on the S32R45 device. We start by creating a project on which to execute the trace, however, you may start at step 2, if you are starting with an existing project. Please note, you will need to have debug configurations for the S32 Debugger setup for each core which you intend to capture trace. If you do not already have such configurations, you may copy them from another project and adapt them to the new project as shown in HOWTO: Add a new debugger configuration to an existing project.
- Create a new application project, selecting the 'S32R45 Cortex-A53' processor and 'S32 Debugger' options.
![image.png image.png](/t5/image/serverpage/image-id/141569i48970E2125D5685E/image-size/large?v=v2&px=999)
![image.png image.png](/t5/image/serverpage/image-id/141570i6CFA837A9F66F0A9/image-size/large?v=v2&px=999)
- There should now be 4 new application projects in your workspace. One for each A53 core. The first core of the S32R45, A53_0_0, is also a possible boot core, so this project will have build configurations for RAM and FLASH. The other A53 cores (0_1, 1_0, 1_1) will not. Build all projects for Debug_RAM and check that they build clean before proceeding.
- Open 'Debug Configurations...' and select the 'Debug_RAM' configuration for the first core (A53_0_0_Debug_RAM_S32Debug). Select the 'Debugger' tab. Enter the Debug Probe Connection settings as appropriate for your hardware setup. Click Apply.
![image.png image.png](/t5/image/serverpage/image-id/141571i05FC5979D7681077/image-size/large?v=v2&px=999)
- Now select the Launch Group configuration for 'Debug_RAM'. It is important to use the launch group to start the debug for each core, not just because it makes it easier, but also because it is necessary to allow for some delay after the first A53 core is started before bringing the other A53 cores from reset to debug state. Press Debug
![image.png image.png](/t5/image/serverpage/image-id/141572i6134F2075AB24139/image-size/medium?v=v2&px=400)
- Once the code is loaded to the target and the debugger has started each core and executed to the first line within main(), then it is ready to perform any of the standard debug functions including Trace. Trace does not start automatically, it must be turned on before it will start logging data. To do this, it is necessary to add the view 'Trace Commander'. It can be found by either Window -> Show View -> Other, then search for 'Trace Commander' or enter 'Trace Commander' in the Quick Access field of the toolbar and select Trace Commander from the list.
![pastedImage_2.png pastedImage_2.png](/t5/image/serverpage/image-id/88896i0CC978A0823D507B/image-size/large?v=v2&px=999)
![pastedImage_1.png pastedImage_1.png](/t5/image/serverpage/image-id/87141i40C4778CA8D8095E/image-size/large?v=v2&px=999)
- The Trace Commander view will show in the panel with the Console, Problems, etc. Double-click on the tab to enlarge it.
![image.png image.png](/t5/image/serverpage/image-id/141573i58D1192519DF4614/image-size/large?v=v2&px=999)
- Click on the configure button to change settings.
![image.png image.png](/t5/image/serverpage/image-id/141552i55F7BE5554530E56/image-size/large?v=v2&px=999)
- Click on the Advanced Trace Generators configuration button
![image.png image.png](/t5/image/serverpage/image-id/141574iEDD2248874717657/image-size/large?v=v2&px=999)
- For each core to be logged, set the associated ELF file. Select the core, click Add, then '...', and select the elf file for that core.
![image.png image.png](/t5/image/serverpage/image-id/141575iC359D6EF86B39EA6/image-size/large?v=v2&px=999)
- Select Data Streams. Now it is possible to change how the data is captured. Since the buffers have finite memory, they can be set to collect data until full, or to overwrite. If set to One buffer, the data will be collected until the buffer is full, then data collection stops. It is useful to gather data when starting logging from a breakpoint to gather data during execution of a specific section of code. If set to Overwrite, the data collection continues and starts overwriting itself once the buffer is full. This is useful when trying to gather data prior to a breakpoint triggered by a condition.
![image.png image.png](/t5/image/serverpage/image-id/141576i8EE7323AB1B5FE1D/image-size/large?v=v2&px=999)
- To turn on the Trace logging, click on the 'Close this trace stream' button.
![image.png image.png](/t5/image/serverpage/image-id/141556i6CE2209C25BEE5E8/image-size/large?v=v2&px=999)
- The Trace is now enabled. To collect trace data, the cores must be executing. First double-click the Trace Commander tab to return to the normal Debug Perspective view. Then, one by one, select the main() thread on each core and press Resume to start them all. If collecting from a breakpoint, start the code first with Trace disabled, wait for the breakpoint to be reached, then enable the Trace.
![image.png image.png](/t5/image/serverpage/image-id/141579i85EB23E5D81316B3/image-size/large?v=v2&px=999)
- Allow the cores to run for a period of time to gather the data, then press Suspend on each one until they are all suspended.
![image.png image.png](/t5/image/serverpage/image-id/141580iFC4E4BDB0CBBE8D2/image-size/large?v=v2&px=999)
- Look to the Trace Commander tab to see that the data icon is no longer shaded and click on it to upload the trace data.
![image.png image.png](/t5/image/serverpage/image-id/141562i69689D7E732AB5CF/image-size/large?v=v2&px=999)
- A new tab, Analysis Results, has appeared. Double-click this tab to see it better. Click on the arrow next to ETF 0 to show the data collected in the trace buffer.
![image.png image.png](/t5/image/serverpage/image-id/141581i9A74350D10EDBB45/image-size/large?v=v2&px=999)
- Notice there are 5 separate views on the captured data: Trace (raw data), Timeline, Code Coverage, Performance, and Call Tree.
- Trace - this is the fully decoded trace data log
![image.png image.png](/t5/image/serverpage/image-id/141582iE1F765F129B6E4D4/image-size/large?v=v2&px=999)
- Timeline - displays the functions that are executed in the application and the number of cycles each function takes, separate tabs for each core
![image.png image.png](/t5/image/serverpage/image-id/141583i9040948D831F5F7A/image-size/large?v=v2&px=999)
- Code Coverage - displays the summarized data of a function in a tabular form, separate tabs for each core
![image.png image.png](/t5/image/serverpage/image-id/141584i4AA6825FB9477FC4/image-size/large?v=v2&px=999)
- Performance - displays the function performance data in the upper summary table and the call pair data for the selected function and it's calling function
![image.png image.png](/t5/image/serverpage/image-id/141585i254E5682003A55AF/image-size/large?v=v2&px=999)
- Call Tree - shows the call tree for identification of the depth of stack utilization
![image.png image.png](/t5/image/serverpage/image-id/141586iC3CE31B236F966F3/image-size/large?v=v2&px=999)
- See the S32DS Software Analysis Documentation for more details on settings, ways to store the logged data, etc.