Texas Instruments TMS320C54x User Manual page 403

Digital signal processors
Hide thumbs Also See for TMS320C54x:
Table of Contents

Advertisement

The on-chip boot loader loads only a single block. This may present a problem
when you are loading C code compiled with the TMS320C54x C compiler. The
TMS320C54x C compiler creates several sections or blocks when it compiles
C source code. Some applications may require that all sections associated
with the program be included in the boot to have a complete executable
program. In this case, the individual sections must be combined into a single
section for boot.
The hex conversion utility does not combine individual sections; therefore, you
must use the linker to group those sections.
The sections that the compiler creates are divided into two categories: initial-
ized sections (sections that contain data or code) and uninitialized sections
(sections that reserve space but contain no actual data). Initialized sections
created by the TMS320C54x C compiler include .text, .cinit, .const, and .data.
Uninitialized sections are ignored by the hex conversion utility and are not
converted.
Most applications require that .text and .cinit sections are included in the boot.
This allows code and information for the C boot routine (c_int00 defined in
boot.asm) to load and run, initializing the C environment and branching to the
main function in the applications code.
The .text and .cinit sections must be linked together as a single section in the
linker command file. The .cinit section contains the initialization data and
tables for all global or static C symbols that were declared with an initial value
(i.e. int x = 5; ). Note that the linker handles the .cinit section differently than
the other sections.
When the linker encounters a .cinit section specified as an output section in
the link, it automatically:
-
Sets the symbol cinit to point to the start of the included .cinit section
-
Appends a single word to the end of the section
This last word contains a zero that is used to mark the end of the initialization
table. However, if .cinit is included as an input section only, the linker sets cinit
to –1, indicating that no initialization tables were loaded. Therefore, the C boot
routine, c_int00, does not attempt to initialize any of the global or static C
symbols.
When linking the .cinit section into an output section other than .cinit, the linker
does not perform the automatic functions listed above. Therefore, these func-
tions must be implemented explicitly within the linker command file. The fol-
lowing example shows a linker command file that places .text and .cinit into a
single output section named boot_sec.
Example 3: Generating a Boot Table
Hex Conversion Utility Examples
C-11

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

Table of Contents