This chapter contains the following sections:
Create a New Project Space with a Project
Set Options for the Tools in the Toolchain
Build your Application
Viewing the Results of a Build
Compiling a Single File
Rebuild your Entire Application
How to Build you Application on the Command Line
With the TASKING TriCore suite you can write, compile, assemble, link and locate applications for the several TriCore cores. The TASKING TriCore suite conforms to Infineon's TriCore Embedded Applications Binary Interface (EABI), which defines a set of standards to ensure interoperability between software components.
The TASKING Embedded Development Environment (EDE) is a Windows application that facilitates working with the tools in the toolchain and also offers project management and an integrated editor.
EDE has three main functions: Edit / Project management, Build and Debug. The figure below shows how these main functionalities relate to each other.
Figure 2-1: EDE development flow
In the Edit part you make all your changes:
- create a project space
- create and maintain one or more projects in a project space
- add, create and edit source files in a project
- set the options for each tool in the toolchain
- select another toolchain if you want to create an application for another target than the TriCore.
In the Build part you build your files:
- a makefile (created by the Edit part) is used to invoke the needed toolchain components, resulting in an absolute object file.
In the Debug part you can debug your project:
- call the TASKING debugger "CrossView Pro" with the generated absolute object file.
This Getting Started Chapter guides you step-by-step through the most important features of EDE
The TASKING EDE is an embedded environment and differs from a native program development.
A native program development environment is often used to develop applications for systems where the host system and the target are the same. Therefore, it is possible to run a compiled application directly from the development environment.
In an embedded environment, however, a simulator or target hardware is required to run an application. TASKING offers a number of simulators and target hardware debuggers.
You can use all tools in the toolchain from the embedded development environment (EDE) and from the command line in a Command Prompt window or a UNIX shell.
The next illustration shows all components of the TriCore toolchain with their input and output files.
Figure 2-2: TriCore toolchain
The following table lists the file types used by the TriCore toolchain.
Extension | Description |
Source files | |
.cc | C++ source file, input for the C++ compiler |
.c | C source file, input for the C compiler |
.asm | Assembler source file, hand coded |
.lsl | Linker script file using the Linker Script Language |
.i | Locating control file with defines for linker script file |
Generated source files | |
.ic | C source file, generated by the C++ compiler, input for the C compiler |
.src | Assembler source file, generated by the C compiler, does not contain macros |
Object files | |
.o | ELF/DWARF relocatable object file, generated by the assembler |
.a or .elb | Archive with ELF/DWARF object files |
.abs | IEEE-695 absolute object file, generated by the locating part of the linker |
.out | Relocatable linker output file |
.elf | ELF/DWARF absolute object file, generated by the locating part of the linker |
.hex | Absolute Intel Hex object file |
.sre | Absolute Motorola S-record object file |
List files | |
.lst | Assembler list file |
.map | Linker map file |
.mcr | MISRA C report file |
Error list files | |
.err | Compiler error messages file |
.ers | Assembler error messages file |
.elk | Linker error messages file |
Table 2-1: File extensions
EDE is a complete project environment in which you can create and maintain project spaces and projects. EDE gives you direct access to the tools and features you need to create an application from your project.
A project space holds a set of projects and must always contain at least one project. Before you can create a project you have to setup a project space. All information of a project space is saved in a project space file (.psp):
Within a project space you can create projects. Projects are bound to a target! You can create, add or edit files in the project which together form your application. All information of a project is saved in a project file (.pjt):
When you build your project, EDE handles file dependencies and the exact sequence of operations required to build your application. When you push the Build button, EDE generates a makefile, including all dependencies, and builds your application.
1. Create a project space
2. Add one or more projects to the project space
3. Add files to the project
4. Edit the files
5. Set development tool options
6. Build the application
Figure 2-3: EDE icon
The EDE screen contains a menu bar, a toolbar with command buttons, one or more windows (default, a window to edit source files, a project window and an output window) and a status bar.
Figure 2-4: EDE desktop
When you start EDE for the first time (see section 2.3 , Start EDE), EDE opens with a ready defined project space that contains several sample projects. Each project has its own subdirectory in the examples directory. Each directory contains a file readme.txt with information about the example. The default project is called demo.pjt and contains a CrossView Pro debugger example.
To select a project from the list of projects in a project space:
1. In the Project Window, right-click on the project you want to open.
A menu appears.
2. Select Set as Current Project.
The selected project opens.
3. Read the file readme.txt for more information about the selected sample project.
To build the currently active sample project:
Once the files have been processed you can inspect the generated messages in the Build tab of the Output window.
Creating a project space is in fact nothing more than creating a project space file (.psp) in an existing or new directory.
1. From the File menu, select New Project Space...
The Create a New Project Space dialog appears.
2. In the the Filename field, enter a name for your project space (for example MyProjects). Click the Browse button to select a directory first and enter a filename.
3. Check the directory and filename and click OK to create the .psp file in the directory shown in the dialog.
A project space information file with the name MyProjects.psp is created and the Project Properties dialog box appears with the project space selected.
4. In the Project Properties dialog, click on the Add new project to project space button (see previous figure).
The Add New Project to Project Space dialog appears.
5. Give your project a name, for example getstart\getstart.pjt (a directory name to hold your project files is optional) and click OK.
A project file with the name getstart.pjt is created in the directory getstart, which is also created. The Project Properties dialog box appears with the project selected.
Now you can add all the files you want to be part of your project.
6. Click on the Add new file to project button.
The Add New File to Project dialog appears.
7. Enter a new filename (for example hello.c) and click OK.
A new empty file is created and added to the project. Repeat steps 6 and 7 if you want to add more files.
8. Click OK.
The new project is now open. EDE loads the new file(s) in the editor in separate document windows.
EDE automatically creates a makefile for the project (in this case getstart.mak). This file contains the rules to build your application. EDE updates the makefile every time you modify your project.
9. As an example, type the following C source in the hello.c document window:
#include <stdio.h> void main(void) { printf("Hello World!\n"); }
10. Click on the Save the changed file <Ctrl-S> button.
EDE saves the file.
The next step in the process of building your application is to select a target processor and specify the options for the different parts of the toolchain, such as the C and/or C++ compiler, assembler, linker and debugger.
1. From the Project menu, select Project Options...
The Project Options dialog appears.
2. Expand the Processor entry and select Processor Definition.
3. In the Target processor list select (for example) TC10GP.
4. Click OK to accept the new project settings.
1. From the Project menu, select Project Options...
The Project Options dialog appears. Here you can specify options that are valid for the entire project. To overrule the project options for the currently active file instead, from the Project menu select Current File Options...
2. Expand the C Compiler entry.
The C Compiler entry contains several pages where you can specify C compiler settings.
3. For each page make your changes. If you have made all changes click OK.
The Cancel button closes the dialog without
saving your changes. With the Defaults button you can restore
the default project options (for the current page, or all pages in the dialog).
4. Make your changes for all other entries (Assembler, Linker, CrossView Pro) of the Project Options dialog in a similar way as described above for the C compiler.
If available, the Options string field
shows the command line options that correspond to your graphical selections.
If you have set all options, you can actually compile the file(s). This results in an absolute ELF/DWARF object file which is ready to be debugged.
To build the currently active project:
The file is compiled, assembled, linked and located. The resulting file is getstart.elf.
The build process only builds files that are out-of-date.
So, if you click Make again in this example nothing is done,
because all files are up-to-date.
Once the files have been processed, you can see which commands have been executed (and inspect generated messages) by the build process in the Build tab of the Output window.
This window is normally open, but if it is closed you can open it by selecting the Output menu item in the Window menu.
1. Select the window (document) containing the file you want to compile or assemble.
2. Click on the Execute 'Compile' command button. The following button is the execute Compile button which is located in the toolbar.
If you selected the file hello.c, this results in the compiled and assembled file hello.o.
If you want to compile, assemble and link/locate all files of your project from scratch (regardless of their date/time stamp), you can perform a rebuild.
If you are not using EDE, you can build your entire application on the command line. The easiest way is to use the control program cctc.
1. In a text editor, write the file hello.c with the following contents:
#include <stdio.h> void main(void) { printf("Hello World!\n"); }
2. Build the file getstart.elf:
cctc -ogetstart.elf hello.c -v
The control program calls all tools in the toolchain. The -v option shows all the individual steps. The resulting file is getstart.elf.
The application getstart.elf is the final result, ready for execution and/or debugging. The debugger uses getstart.elf for debugging but needs symbolic debug information for the debugging process. This information must be included in getstart.elf and therefore you need to compile and assemble hello.c once again.
cctc -g -ogetstart.elf hello.c
Now you can start the debugger with getstart.elf and see how it executes.
CrossView Pro is launched. CrossView Pro will automatically download the file getstart.elf for debugging.
See the CrossView Pro Debugger
User's Guide for more information.