Integration Guide

All the delivered ChibiOS/RT demos are stand alone applications so if you just start your application from an existing demo there isn't any integration effort, you are simply using the existing makefiles, the default startup files etc, minimal effort.
The matter is very different if you are going to integrate the OS into a different runtime framework or if you want to use a different build system, in that case you have the problem to integrate the OS source code into your application.

What this guide does not cover

This guide has a limited scope, the following topics are handled elsewhere:

  • Porting the OS to different architectures or different compilers is not covered in this guide, see the ”ChibiOS/RT port guide” article instead.
  • This guide does not describe any specific environment or development tool, it is assumed you already know in detail the environment you want to work with.

Integrating the Kernel

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:

  • The portable kernel.
  • The port layer for your microcontroller.

See the ChibiOS/RT general architecture document for more details.

Kernel project settings

You need to add the following files to your build process:

  • All the source files contained under ./os/kernel/src, note that you should add all of them even if you don't plan to use some of the subsystems. Unused subsystems can be excluded from the kernel configuration file chconf.h.
  • All the source files contained under ./os/ports/<compiler>/<architecture>. Note that those could be both C source files and assembler source files and that some architectures have an extra directories layer containing files required for a specific platform.

You also need to add to the compiler options the following paths for searching header files:

  • The portable kernel headers ./os/kernel/include.
  • The port layer headers ./os/ports/<compiler>/<architecture>.

Required files

The kernel requires the following files in the project directory:

  • chconf.h, this file contains the per-project kernel settings, a copy of this file can found into ./os/kernel/templates.

Integrating the HAL

If, in addition to the kernel as described in the previous section, you also need to integrate the HAL into your application you also need to import the following components:

  • HAL portable files.
  • Platform specific files.

See the ChibiOS/RT general architecture document for more details.

HAL project settings

You need to add the following files to your build process:

  • All the source files contained under ./os/hal/src, note that you should add all of them even if you don't plan to use some of the subsystems. Unused drivers can be excluded from the HAL configuration file halconf.h.
  • All the source files contained under ./os/hal/platforms/<platform>.
  • All the source files contained under ./boards/<board_model>.

You also need to add to the compiler options the following paths for searching header files:

  • The portable HAL headers ./os/hal/include.
  • The platform layer headers ./os/hal/platforms/<platform>.
  • The board description headers ./boards/<board_model>.

Required files

The HAL requires the following files in the project directory:

  • halconf.h, this file contains the per-project high level HAL settings, a copy of this file can found into ./os/hal/templates.
  • mcuconf.h, this file contains the per-project device driver settings, you can get a copy of this file from any demo using your same MCU. This file is optional and must be enabled from within halconf.h.

Notes

The project tree contains some directories named templates, those directories contains just file templates and must not be included in the project.

 
chibios/guides/integration_guide.txt · Last modified: 2011/10/03 20:51 by giovanni
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.3