This guide describes what is needed in order to integrate ChibiOS/RT or ChibiOS/NIL in a build environment different from the default one provided in ChibiOS distribution.
This guide has a limited scope, the following topics are handled elsewhere:
This guide also applies to ChibiOS/NIL, just replace
/nil/ in paths and replace
This section covers the scenario where you want to use the ChibiOS/RT kernel into an existing application. In order to accomplish this you need to import in your project two components:
You need also to consider the port-specific requirements, random startup files and linker files are not going to work. It is advised to use the provided support files before trying to use alternatives.
You need to add the following files to your build process:
Also add to the search paths for headers the RT portable headers located in:
Port layers can differ from each other but the general layout is the same. You need to include the source code from:
./os/rt/ports/<architecture>/*.c(note some files could be optional here)
The directory containing pertinent headers are:
The port layer can, and usually does, have architecture-specific requirements. Usually a small header must be provided to the port containing the MCU-specific parameters. This file is named:
cmparams.hfor the ARM Cortex-M port
armparams.hfor the ARM port
ppcparams.hfor the Power e200Z port
Additionally the ARM Cortex-M port also requires the vendor-provided CMSIS-compliant registers definition headers. The headers is usually included from
Templates of the parameters headers are provided under:
CMSIS headers for the supported Cortex-M MCUs are also provided under:
You should add the proper CMSIS path to you project search paths.
The RT kernel requires a configuration file, it is usually placed under the project root directory but it can be placed in any directory reachable by the compiler. The file is named
chconf.h and a template can be taken from:
Do not use the file directly, copy it in your project and edit the copy.
If in doubt remember that the provided makefiles are the ultimate guide for the integrator, all required the paths and options are necessarily present there. It is a good idea to look at the
Makefile present in all demos if some detail is not clear. By compiling the demo all compiler options are printed on the console, that should remove any doubt about the required paths, files and options.