TNeo  v1.07
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Building TNeo

Table of Contents

Some notes on building the project.

Note: you don't have to build TNeo to use it. If you want to just use pre-built library (with default configuration), refer to the section Using TNeo in your application.

Configuration file

TNeo is intended to be built as a library, separately from main project (although nothing prevents you from bundling things together, if you want to).

There are various options available which affects API and behavior of the kernel. But these options are specific for particular project, and aren't related to the kernel itself, so we need to keep them separately.

To this end, file tn.h (the main kernel header file) includes tn_cfg.h, which isn't included in the repository (even more, it is added to .hgignore list actually). Instead, default configuration file tn_cfg_default.h is provided, and when you just cloned the repository, you might want to copy it as tn_cfg.h. Or even better, if your filesystem supports symbolic links, copy it somewhere to your main project's directory (so that you can add it to your VCS there), and create symlink to it named tn_cfg.h in the TNeo source directory, like this:

$ cd /path/to/tneo/src
$ cp ./tn_cfg_default.h /path/to/main/project/lib_cfg/tn_cfg.h
$ ln -s /path/to/main/project/lib_cfg/tn_cfg.h ./tn_cfg.h

Default configuration file contains detailed comments, so you can read them and configure behavior as you like.

Makefile or library projects

If you need to build TNeo with some non-default configuration, the easiest way is to use ready-made Makefile or library project.

Makefile

It is tested only in Unix-like environment, so that you can't use makefile to build the kernel with Keil Realview or IAR. For Keil Realview or IAR, use library project (see the section below).

There are two makefiles available: Makefile-all-arch and Makefile.

The first one is used to build all possible targets at once, so it is more for the kernel developer than for kernel user. The second one is used to build the kernel for some particular architecture, and it takes two params: TN_ARCH and TN_COMPILER.

Valid values for TN_ARCH are:

Valid values for TN_COMPILER depend on architecture. For Cortex-M series, they are:

For PIC32, just one value is valid:

For PIC24/dsPIC, just one value is valid:

Example invocation (from the TNeo's root directory) :

$ make TN_ARCH=cortex_m3 TN_COMPILER=arm-none-eabi-gcc

As a result, there will be archive library file bin/cortex_m3/arm-none-eabi-gcc/tneo_cortex_m3_arm-none-eabi-gcc.a

Library project

In the root of TNeo repository, there is a directory lib_project which contains ready-made projects for various platforms. You may use it for building library, and then use resulting library file in your project.

For MPLABX projects, there are library projects, so that you even don't need to build a library: just add this library project to your main project, and MPLABX will do all the work for you. You can change tn_cfg.h file "on-the-fly" then. Other IDEs don't offer such a luxuries, so you need to build library file as a separate step.

Building manually

If you want to create library project yourself (say, in some different IDE, or anything), or if you want to build TNeo as a direct part of your project, there are some generic requirements (there might be additional architecture-dependent requirements, see links below):

For arch-dependent information on building TNeo, please refer to the appropriate section: