System Initialization - Texas Instruments TMS320C2x User Manual

Optimizing c compiler digital signal processor
Hide thumbs Also See for TMS320C2x:
Table of Contents

Advertisement

6.8 System Initialization

Before you can run a C program, you must create the C run-time environment.
The C boot routine performs this task using a function called c_int0. The run-
time-support source library, rts.src, contains the source to this routine in a
module named boot.asm.
To begin running the system, the c_int0 function can be branched to or called,
but it is usually vectored to by reset hardware. You must link the c_int0 function
with the other object modules. This occurs automatically when you use the −c
or − cr linker option and include rts25.lib, rts2xx.lib, or rts50.lib as one of the
linker input files.
When C programs are linked, the linker sets the entry point value in the execut-
able output module to the symbol _c_int0. This does not, however, set the
hardware to automatically vector to c_int00 at reset (see the).
The c_int0 function performs the following tasks to initialize the environment:
1) It defines a section called .stack for the system stack and sets up the initial
stack pointers.
2) It initializes global variables by copying the data from the initialization
tables in the .cinit section to the storage allocated for the variables in the
.bss section. If you are initializing variables at load time (−cr option), a
loader performs this step before the program runs (it is not performed by
the boot routine). For more information, see section 6.8.2, Automatic Init-
ialization of Variables, on page 6-32.
3) It calls the function main to run the C program.
You can replace or modify the boot routine to meet your system requirements.
However, the boot routine must perform the operations listed above to
correctly initialize the C environment.
System Initialization
Run-Time Environment
6-31

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C2x and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Tms320c2xxTms320c5x

Table of Contents