Skip to content

Commit 6d364f0

Browse files
authored
TraceRecorder demo added in CORTEX_MPS2_QEMU_IAR_GCC (FreeRTOS#1320)
* * Added TraceRecorder demo for Percepio View in CORTEX_MPS2_QEMU_IAR_GCC (only gcc supported at the moment) * * Added TraceRecorder demo instructions in readme.md. * * Updated FreeRTOS-Plus-Trace pointer * * Using FreeRTOS-Plus-Trace submodule (TraceRecorder) instead of a static TraceRecorder copy.
1 parent 642e2ec commit 6d364f0

File tree

16 files changed

+1057
-6
lines changed

16 files changed

+1057
-6
lines changed

.github/workflows/freertos_demos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ jobs:
459459
# ${{ env.stepName }}
460460
echo -e "::group::${{ env.stepName }}"
461461
set +e
462-
git submodule update --checkout --init --depth 1 FreeRTOS/Source FreeRTOS/Demo/ThirdParty/Community-Supported-Demos
462+
git submodule update --checkout --init --depth 1 FreeRTOS/Source FreeRTOS/Demo/ThirdParty/Community-Supported-Demos FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace
463463
exitStatus=$?
464464
set -e
465465
echo -e "::endgroup::"
Submodule FreeRTOS-Plus-Trace updated 415 files

FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC/FreeRTOSConfig.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
* See http://www.freertos.org/a00110.html
4040
*----------------------------------------------------------*/
4141

42-
#define configUSE_TRACE_FACILITY 0
4342
#define configGENERATE_RUN_TIME_STATS 0
4443

4544
#define configUSE_PREEMPTION 1
@@ -50,7 +49,10 @@
5049
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 80 )
5150
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 60 * 1024 ) )
5251
#define configMAX_TASK_NAME_LEN ( 12 )
53-
#define configUSE_TRACE_FACILITY 0
52+
53+
/* TODO TraceRecorder (Step 4): Enable configUSE_TRACE_FACILITY in FreeRTOSConfig.h. */
54+
#define configUSE_TRACE_FACILITY 1
55+
5456
#define configUSE_16_BIT_TICKS 0
5557
#define configIDLE_SHOULD_YIELD 0
5658
#define configUSE_CO_ROUTINES 0
@@ -133,4 +135,7 @@
133135

134136
#define configENABLE_BACKWARD_COMPATIBILITY 0
135137

138+
/* TODO TraceRecorder (Step 5): Include trcRecorder.h at the end of FreeRTOSConfig.h. */
139+
#include "trcRecorder.h"
140+
136141
#endif /* FREERTOS_CONFIG_H */

FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC/Readme.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,31 @@
1111
2. Open ```.vscode/launch.json```, and ensure the ```miDebuggerPath``` variable is set to the path where arm-none-eabi-gdb is on your machine.
1212
3. Open ```main.c```, and set ```mainCREATE_SIMPLE_BLINKY_DEMO_ONLY``` to ```1``` to generate just the [simply blinky demo](https://www.freertos.org/a00102.html#simple_blinky_demo).
1313
4. On the VSCode left side panel, select the “Run and Debug” button. Then select “Launch QEMU RTOSDemo” from the dropdown on the top right and press the play button. This will build, run, and attach a debugger to the demo program.
14+
15+
## Tracing with Percepio View
16+
This demo project includes Percepio TraceRecorder, configured for snapshot tracing with Percepio View or Tracealyzer.
17+
Percepio View is a free tracing tool from Percepio, providing the core features of Percepio Tracealyzer but limited to snapshot tracing.
18+
No license or registration is required. More information and download is found at [Percepio's product page for Percepio View](https://traceviewer.io/freertos-view).
19+
20+
### TraceRecorder Integration
21+
If you like to study how TraceRecorder is integrated, the steps for adding TraceRecorder are tagged with "TODO TraceRecorder" comments in the demo source code.
22+
This way, if using an Eclipse-based IDE, you can find a summary in the Tasks window by selecting Window -> Show View -> Tasks (or Other, if not listed).
23+
See also [the official getting-started guide](https://traceviewer.io/getting-started-freertos-view).
24+
25+
### Usage with GCC
26+
To save the TraceRecorder trace, start a debug session with GDB, for example using the provided Eclipse launch profile (should work in most Eclipse-based IDEs).
27+
Halt the execution and the run the command below.
28+
This saves the trace as trace.bin in the build/gcc folder.
29+
Open the trace file in Percepio View or Tracealyzer.
30+
31+
```
32+
dump binary value trace.bin *RecorderDataPtr
33+
```
34+
Note that you can copy/paste this command into the Eclipse Debugger Console by using Ctrl-C, Ctrl-V.
35+
36+
### Usage with IAR Embedded Workbench for Arm
37+
The IAR project is not yet updated for TraceRecorder (work in progress). However, you can easily extend the existing IAR project with TraceRecorder.
38+
Simply add the source files and include paths for TraceRecorder listed in build/gcc/Makefile. Build and run.
39+
To save the trace, please refer to the guides at [https://percepio.com/iar](https://percepio.com/iar).
40+
41+

0 commit comments

Comments
 (0)