FreeRTOS Examples

FreeRTOS Examples XploR Components list

This chapter covers the basics of C/C++ FreeRTOS projects including creating, building, running, and debugging FreeRTOS applications. Through the debug session, users can examine RTOS objects such as Task, Heap, Timer and Queue. The application can also be built and run on QEMU emulator.

Components Prerequisites

To build, run and debug C/C++ FreeRTOS applications, please make sure that all below components are installed. Please refer to Component management for more information about installing component.

  • xplor-studio-freertos-debug-plugin: FreeRTOS XploR Studio Plugin using for creating FreeRTOS examples and supporting RTOS views
  • rv-xplor-elf-linux64/rv-xplor-elf-win64: XploR Embedded Toolchain for RISC-V (supported both 32 and 64-bit)
  • rv-qemu-linux64/rv-qemu-win64: QEMU for running and debugging RISC-V applications (Baremetal, Embedded, Embedded Linux)

All above components are compulsory for debugging FreeRTOS projects.

Depending on applications, XploR Studio has many example components for specific cases:

  • freertos-virt-qemu-blinky-example: Blinky FreeRTOS Project for XploR Studio
    • This application prints Blink text
  • freertos-virt-qemu-heap-example: Generic Heap FreeRTOS Project for XploR Studio
    • This application simply prints Testing Heap on the console screen
  • freertos-virt-qemu-timer-example: Timer FreeRTOS Project for XploR Studio
    • This application simply prints Testing Timer on the console screen

Notes

  • To open FreeRTOS Objects View, select Windows > Show View > Others. In Show View wizard, select FreeRTOS Object Views
  • The FreeRTOS object views only contain information when user debugs a FreeRTOS project
  • Depending on the FreeRTOS application, not all FreeRTOS objects will display valid information. For example, if the application does not utilize a Timer object, XploR Studio will not display any useful information on FreeRTOS Timer view.
  • The display of FreeRTOS views is dependent on the xplor-studio-freertos component. Therefore, if you uninstall this component, please close these views to prevent any errors.

Working flow

Create project

  1. To create a new project, select File > New > C Project, please choose the suitable project (after clicking on a project, XploR Studio will show the description of that project):

example image

  1. Other steps (Update build settings, Build project) are same as the quick-start project. Please refer to Quick start with FreeRTOS project for general working flow.

FreeRTOS views

During the FreeRTOS debug sessions, developers need to examine the state of the applications. This state can be seen as Task, Queue, Heap, and Timer. The following sessions describe how XploR Studio helps to check this information.

FreeRTOS Task View

The FreeRTOS task view helps developers examine tasks during debug sessions. Each object is identified by its ID, name, address, state, task state, stack usage, event object, runtime, and priority.

example image

FreeRTOS Queue View

The FreeRTOS Queue view helps developers examine queues during debug sessions. Each object is identified by its type, ID, name, address, length, size, and state of TX and RX.

example image

FreeRTOS Timer View

The FreeRTOS Timer view helps developers examine timers during debug sessions. Each object is identified by its ID, name, status, callback functions, and similar.

example image

FreeRTOS Heap View

The FreeRTOS Heap view helps developers examine heaps during debug sessions. Each object is identified by its ID, address, usage information, and similar.

example image