Porting FreeRTOS on Infineon TC3xxx

Abstract

This document mainly introduces the porting and usage of FreeRTOS on Infineon TriCore TC33x series.

Introduction to FreeRTOS

Since being acquired by AWS, FreeRTOS has been continuously developing and growing, with a large user base. FreeRTOS is the market-leading real-time operating system (RTOS) for microcontrollers and small microprocessors, developed in collaboration with world-leading chip companies. FreeRTOS is distributed for free under the MIT open-source license, including a kernel and a set of constantly enriched IoT libraries, suitable for all industry sectors. The construction of FreeRTOS emphasizes reliability and ease of use.

Introduction to TC3xx

The TC3xxx series is a 32-bit microcontroller based on the Tricore architecture launched by Infineon, with excellent performance and widely used in automotive electronics for components with high safety requirements, such as steering and braking. Specific performance parameters can be referenced in the official data sheet, which will not be elaborated here.

Porting FreeRTOS on Infineon TC3xxx

Hands-on Porting

Before porting, you need to download the FreeRTOS software source package, which is open-source and can be downloaded from the official website or GitHub. In addition, you need to install the development environment IDE, here we use the free AURIX Development Studio V1.9.

Create a New Project

Create a new project in ADS.

Porting FreeRTOS on Infineon TC3xxx

Select Chip

Porting FreeRTOS on Infineon TC3xxx

Porting FreeRTOS on Infineon TC3xxx

Add Folders

After completing the above steps, create a basic project under the workspace, and create two folders in the project directory structure: OS and AppSw, one for storing the RTOS source package and the other for storing our application. After creating, load the project as shown in the figure below.

Porting FreeRTOS on Infineon TC3xxx

Modify Configuration

First, modify the FreeRTOSConfig.h file to configure and trim the system. Since we are using a chip with a frequency of 300M, modify the CPU clock frequency to 300000000Hz, set the heartbeat to 1ms, adjust the stack size according to actual needs, and select STM0 as the system heartbeat timer, although other timers can also be selected.

Porting FreeRTOS on Infineon TC3xxx

Porting FreeRTOS on Infineon TC3xxx

Modify Porting

Modify the porting files in the port folder. If you refer to the official documentation, the modifications are minimal, which is recommended. I will provide the ported project at the end of this document for reference.

Porting FreeRTOS on Infineon TC3xxx

Porting FreeRTOS on Infineon TC3xxx

Create Application

Modify the OsTasks.c file.

Porting FreeRTOS on Infineon TC3xxx

Create Tasks

Porting FreeRTOS on Infineon TC3xxx

After implementing the task function, you can call and use it. Here we have created two tasks: Task 1 blinks LED1 every 200ms, and Task 2 blinks LED2 every 500ms.

Porting FreeRTOS on Infineon TC3xxx

Verification

Initialize the tasks and start the scheduler. If there are no compilation errors, you can download the code to the board for verification. The hardware used in this project is the AURIX TCxx4 lite Kit V1 version. You can see that the two LEDs blink as expected, proving normal operation. More functions can be added to this project in the future.

Porting FreeRTOS on Infineon TC3xxx

Conclusion

Previously, I introduced the porting of FreeRTOS on the ARM platform. Today’s porting is based on the Tricore platform architecture. It can be seen that as long as you master the key steps of porting and refer to some materials, it is still easy to succeed in porting. The project is attached at the end for reference.

Link: https://pan.baidu.com/s/1z0GwKzxf4y78WQIjcDO7XA

Extraction code: ytnb

Leave a Comment

×