FreeRTOS-Kernel/FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC
Florian La Roche 1aa47857a0
Various Qemu Cortex M3 ports now support picolibc (#1364)
* Various Qemu Cortex M3 ports now support picolibc

Allow various Qemu Cortex M3 ports to compile against
picolibc. Also support "-flto" to work correctly.
Tested with picolibc in current Debian 13.
Just use "PICOLIBC=1 make" to switch over from default newlib.

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>

* Add ffreestanding

Signed-off-by: Ubuntu <ubuntu@ip-172-31-15-241.ap-south-1.compute.internal>

* Fix formatting check

Signed-off-by: Ubuntu <ubuntu@ip-172-31-15-241.ap-south-1.compute.internal>

---------

Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
Signed-off-by: Ubuntu <ubuntu@ip-172-31-15-241.ap-south-1.compute.internal>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-15-241.ap-south-1.compute.internal>
2025-08-13 20:15:54 +05:30
..
.vscode VSCode launch configurations (#820) 2022-06-07 21:21:52 -07:00
build Various Qemu Cortex M3 ports now support picolibc (#1364) 2025-08-13 20:15:54 +05:30
CMSIS Add a GCC build to the QEMU/IAR project (#728) 2021-12-18 15:11:29 -08:00
TraceRecorderConfig TraceRecorder demo added in CORTEX_MPS2_QEMU_IAR_GCC (#1320) 2025-01-23 10:11:33 +05:30
FreeRTOSConfig.h Demo/CORTEX_MPS2_QEMU_IAR_GCC: fix warnings (#1352) 2025-06-11 20:41:51 +05:30
Instructions.url Add a GCC build to the QEMU/IAR project (#728) 2021-12-18 15:11:29 -08:00
IntQueueTimer.c Fix C source and header file license spacing (#1155) 2024-01-12 16:43:31 -08:00
IntQueueTimer.h Fix C source and header file license spacing (#1155) 2024-01-12 16:43:31 -08:00
main.c Various Qemu Cortex M3 ports now support picolibc (#1364) 2025-08-13 20:15:54 +05:30
main_blinky.c TraceRecorder demo added in CORTEX_MPS2_QEMU_IAR_GCC (#1320) 2025-01-23 10:11:33 +05:30
main_full.c Add register test tasks to QEMU project (#765) 2024-02-19 20:50:02 +05:30
Readme.md Added TraceRecorder also in IAR project for CORTEX_MPS2_QEMU_IAR_GCC demo (#1325) 2025-02-10 12:32:38 +05:30

Running with VSCode Launch Configurations

Prerequisites

  • Install C/C++ extension in VSCode.
  • Install arm-none-eabi-gcc.
  • Install GNU make utility.
  • Ensure the required binaries are in PATH with arm-none-eabi-gcc --version, arm-none-eabi-gdb --version, and make --version.

Building and Running

  1. Open VSCode to the folder FreeRTOS/Demo/CORTEX_MPS2_QEMU_IAR_GCC.
  2. Open .vscode/launch.json, and ensure the miDebuggerPath variable is set to the path where arm-none-eabi-gdb is on your machine.
  3. Open main.c, and set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to 1 to generate just the simply blinky demo.
  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.

Tracing with Percepio View

This demo project includes Percepio TraceRecorder, configured for snapshot tracing with Percepio View or Tracealyzer. Percepio View is a free tracing tool from Percepio, providing the core features of Percepio Tracealyzer but limited to snapshot tracing. No license or registration is required. More information and download is found at Percepio's product page for Percepio View.

TraceRecorder Integration

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. 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). See also the official getting-started guide.

Usage with GDB

To save the TraceRecorder trace, start a debug session with GDB. Halt the execution and the run the command below. This saves the trace as trace.bin in the build/gcc folder. Open the trace file in Percepio View or Tracealyzer.

If using an Eclipse-based IDE, run the following command in the "Debugger Console":

dump binary value trace.bin *RecorderDataPtr

If using VS Code, use the "Debug Console" and add "-exec" before the command:

-exec dump binary value trace.bin *RecorderDataPtr

Note that you can typically copy/paste this command into the debug console.

Usage with IAR Embedded Workbench for Arm

Launch the IAR debugger. With the default project configuration, this should connect to the QEMU GDB server. To save the trace, please refer to the "Snapshot Mode" guide at https://percepio.com/iar. In summary:

  • Download the IAR macro file save_trace_buffer.mac (click "save as")
  • Add the macro file in the project options -> Debugger -> Use Macro File(s).
  • Start debugging and open View -> Macros -> Debugger Macros.
  • Locate and run "save_trace_buffer". Open the resulting "trace.hex" in Percepio View or Tracealyzer.