www.ti.com
3.2
Example: Preparing a COFF File For eCAN Bootloading
Example: Preparing a COFF File For eCAN Bootloading
Table 3-1. Boot-Loader Options
Option
Description
-boot
Convert all sections into bootable form (use instead of a SECTIONS directive)
-sci8
Specify the source of the bootloader table as the SCI-A port, 8-bit mode
-spi8
Specify the source of the bootloader table as the SPI-A port, 8-bit mode
-gpio8
Specify the source of the bootloader table as the GPIO port, 8-bit mode
-gpio16
Specify the source of the bootloader table as the GPIO port, 16-bit mode
-bootorg value
Specify the source address of the bootloader table
-lospcp value
Specify the initial value for the LOSPCP register. This value is used only for the spi8 boot table format
and ignored for all other formats. If the value is greater than 0x7F, the value is truncated to 0x7F.
-spibrr value
Specify the initial value for the SPIBRR register. This value is used only for the spi8 boot table format and
ignored for all other formats. If the value is greater than 0x7F, the value is truncated to 0x7F.
-e value
Specify the entry point at which to begin execution after boot loading. The value can be an address or a
global symbol. This value is optional. The entry point can be defined at compile time using the linker -e
option to assign the entry point to a global symbol. The entry point for a C program is normally _c_int00
unless defined otherwise by the -e linker option.
-i2c8
Specify the source of the bootloader table as the I
2
C-A port, 8-bit
-i2cpsc value
Specify the value for the I2CPSC register. This value will be loaded and take effect after all I
2
C options
are loaded, prior to reading data from the EEPROM. This value will be truncated to the least significant
eight bits and should be set to maintain an I
2
C module clock of 7-12 MHz.
-i2cclkh value
Specify the value for the I2CCLKH register. This value will be loaded and take effect after all I
2
C options
are loaded, prior to reading data from the EEPROM.
-i2cclkl value
Specify the value for the I2CCLKL register. This value will be loaded and take effect after all I
2
C options
are loaded, prior to reading data from the EEPROM.
This section shows how to convert a COFF file into a format suitable for CAN based bootloading. This
example assumes that the host sending the data stream is capable of reading an ASCII hex format file. An
example COFF file named GPIO34TOG.out has been used for the conversion.
Build the project and link using the -m linker option to generate a map file. Examine the .map file produced
by the linker. The information shown in
has been copied from the example map file
(GPIO34TOG.map). This shows the section allocation map for the code. The map file includes the
following information:
•
Output Section
This is the name of the output section specified with the SECTIONS directive in the linker command
file.
•
Origin
The first origin listed for each output section is the starting address of that entire output section. The
following origin values are the starting address of that portion of the output section.
•
Length
The first length listed for each output section is the length for that entire output section. The following
length values are the lengths associated with that portion of the output section.
•
Attributes/input sections
This lists the input files that are part of the section or any value associated with an output section.
See the TMS320C28x Assembly Language Tools User's Guide (SPRU513) for detailed information on
generating a linker command file and a memory map.
All sections shown in
that are initialized need to be loaded into the DSP in order for the code
to execute properly. In this case, the codestart, ramfuncs, .cinit, myreset and .text sections need to be
loaded. The other sections are uninitialized and will not be included in the loading process. The map file
also indicates the size of each section and the starting address. For example, the .text section has 0x155
words and starts at 0x3FA000.
SPRU722C – November 2004 – Revised October 2006
Building the Boot Table
51