Reference documents:
- Understanding the FreeRTOS directory structure.
The FreeRTOS source package downloaded from the official website has a demo application for each processor that has been ported to it for reference. Beginners are strongly advised to start with the demo to learn how to use FreeRTOS.
- Basic directory Structure
For each processor to do the porting, and its corresponding demo, the number of files, all stored in the same compressed file. This greatly simplifies the FreeRTOS release process, but facing so many source files is likely to be daunting for novices. In fact, the directory structure of the FreeRTOS source package is very concise, and, more surprisingly, the freertos real-time kernel contains only 3 files (if you need to use software timer, Event Group or Co-routine function, Other files are also included).
After extracting the FreeRTOS source package, you can see two subdirectories,FreeRTOS and freertos-plus. As shown in the following:
+-freertos-plus Contains freertos+ Components and demo Projects.¦+-freertos Contains the FreeRTOS real time Kernel source files and demo projects
In the Freertos-plus directory are some components and their demos, while the FreeRTOS directory contains the following two subdirectories:
FreeRTOS ¦ +-demo Contains the Demo application projects. ¦ +-source Contains The real time kernel Source code.
There are only 3 kernel-related files, each of which is tasks.c, queue.c , and timers.c and croutine.c, each of which implements the two files Software timer and Co-routine function.
For each architecture processor, there is a part of the RTOS code associated with it, which is called the RTOs Portable layer, located in the Freertos/source/portable/[compiler]/[architecture] subdirectory, where
compiler is the compiler used by the user, Architecture refers to a specific architecture. Examples are as follows:
-
- If the user is using the TriCore 1782 schema processor and the GCC compiler:
Then, the files associated with TriCore (PORT.C) are located in the freertos/source/portable/gcc/tricore_1782 directory. As a result, all subdirectories under the freertos/source/portable directory, except Freertos/source/portable/memmang, can be deleted.
-
- If the user is using the Renesas RX600 architecture processor and the IAR compiler:
Then, the files associated with RX600 (PORT.C) are located in the freertos/source/portable/iar/rx600 directory. As a result, all subdirectories under the freertos/source/portable directory, except Freertos/source/portable/memmang, can be deleted.
The Freertos/source directory tree looks like this:
FreeRTOS ¦ +-source The core FreeRTOS kernel files ¦ +-include The core FreeRTOS kernel Header files ¦ +-portable Processor specific code. ¦ +-compiler x All the ports supported for Compiler x +-compiler y all the ports supported for compile R y +-memmang the sample heap implementations
For each processor architecture and compiler, the FreeRTOS source file package has a corresponding demo application. Most of the files that are shared by the Demo application are located in the Freertos/demo/common/minimal directory. (Files in the Freertos/demo/common/full directory need not be ignored, these files will be used when porting FreeRTOS to the PC).
Other subdirectories in the Freertos/demo directory, each of which corresponds to a processor and compiler for a particular architecture. This can be seen from its directory name, for example, as follows:
-
- If the user is using Infineon triboard hardware (TriCore schema, GCC compiler):
Then, the Demo application corresponding to TriCore is located in the FREERTOS/DEMO/TRICORE_TC1782_TRIBOARD_GCC directory, so that all Freertos/demo Subdirectories under the directory (except for common subdirectories) can be ignored or deleted.
-
- If the user is using rx62n RDK hardware (Renesas RX6000 schema, IAR compiler):
Then, the Demo application corresponding to TriCore is located in the freertos/demo/rx600_rx62n-rdk_iar directory, so that all Freertos/demo Subdirectories under the directory (except for common subdirectories) can be ignored or deleted.
The Freertos/demo directory tree looks like this:
FreeRTOS ¦ +-demo ¦ +-common The Demo application files that is used by all the demos. +-dir x The demo application build files for port x +-dir y the demo application build files for Port y
- Create your own application
For beginners, it is recommended to first run the corresponding demo, and then on this basis, gradually replace the application files in the demo with their own application files.
Understanding the FreeRTOS source file directory structure