Example 3: Generating a Boot Table
C-11
Hex Conversion Utility Examples
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.
Summary of Contents for TMS320C54x
Page 38: ......
Page 39: ......
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 44: ......
Page 45: ......
Page 46: ......
Page 47: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 51: ......
Page 52: ......
Page 53: ......
Page 54: ......
Page 55: ......
Page 56: ......
Page 57: ......
Page 58: ......
Page 59: ......
Page 60: ......
Page 61: ......
Page 62: ......
Page 276: ......
Page 277: ......
Page 278: ......
Page 279: ......
Page 280: ......
Page 281: ......
Page 282: ......
Page 283: ......
Page 284: ......
Page 285: ......
Page 286: ......
Page 287: ......
Page 288: ......
Page 289: ......
Page 290: ......
Page 291: ......
Page 292: ......
Page 293: ......
Page 294: ......
Page 295: ......
Page 296: ......
Page 297: ......
Page 298: ......
Page 299: ......
Page 300: ......
Page 301: ......
Page 302: ......