ELF2XX Utility. NXP CodeWarrior Development Studio
Iklan
Iklan
ELF2XX Utility
sh_type : SHT_STARCORE_OVERLAY
sh_flags : 0x3 SHF_WRITE SHF_ALLOC
sh_addr : 0x40000000
sh_offset : 0x190
sh_size : 12
sh_link : 0
sh_info : 0
sh_addralign : 4
sh_entsize : 0
.
.
.
14.4 ELF2XX Utility
Use the ELF2XX utility to write the information within the executable ELF file in user specific format such as srec, lod, or bin.
To invoke the ELF2XX utility from the command prompt, type: sc100-elf2xx [option ...] <input-file>
NOTE
The ELF to S-Record utility is in this directory:
<CWinstallDir>\SC\StarCore_Support\compiler\bin
Parameters
option
Table 14-4 defines the purpose and effect of each command-line option.
input-file
The filename of the ELF object file.
Listing: LOD File-Format
_START Module_ID Version Rev# Device# Asm_Version Comment
_END Entry_point_address
_DATA Memory_space Address Code_or_Data
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
348 Freescale Semiconductor, Inc.
Chapter 14 StarCore DSP Utilities
_BLOCKDATA Memory_space Address Count Value
_SYMBOL Memory_space Symbol_Address ...
_COMMENT Comment
Listing: BIN File-Format
ENDIANNESS_BYTE (1Byte)
<ADDRESS - 8Bytes><SIZE_IN_BYTES - 8Bytes><data_payload>
<ADDRESS - 8Bytes><SIZE_IN_BYTES - 8Bytes><data_payload>
....
<ADDRESS -8Bytes><SIZE_IN_BYTES - 8Bytes><data_payload>
<ADDRESS = 0x00000000C007B010><SIZE = 8><value_of_entrypoint>
ENDIANNESS_BYTE
NOTE
has the value 2 for
MSB
and 1 for
LSB
. This feature can be used to dump the executable
.elf
file into a fast download format. The file can be parsed and loaded into target's memory.
Table 14-4. elf2xx Utility-Command-Line Options
Option
-t <output-type>
-DumpUninitializedData= Off
-DumpUninitializedData= On
-DumpNewLine=Off
-DumpNewLine=On
-entry_address HEX_VALUE
Description
Sets the output type format <outputtype> is one of: srec, lod , eld, , or bin
Inhibits to dump the information about the Uninitialized Data <BSS sections>
Enables to dump the information about the Uninitialized Data <BSS sections>
Inhibits dumping new line for the srec format
Enables dumping new line for the srec format.
Enables the user to change the default value of the address, where the entry point is written, to the specified
HEX_VALUE. The HEX_VALUE must be written as "0xNUMBER" (for example:
0xC007B010)
-m <arch> -#<value> <list_eld>
{ #<value> <list_eld> ...}
NOTE: This option is valid only for the bin format.
Enables us to merge one or more applications. The result of merger can be specified by the output-type argument from -t option. <arch> is one of b4420, b4860 <value> is the index of core. For example, -#0 means core
Table continues on the next page...
Mandatory
Optional
Optional
Type
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
349
ELF2XX Utility
-merge-with-symbolinformation=On
-merge-with-symbolinformation=Off
-split <arch>
-o <output-file>
-removeAllBss
-V
Table 14-4. elf2xx Utility-Command-Line Options (continued)
Option
-ccsr_address HEX_VAL
Description
zero. <list_eld> is the list of executable ELF file that are delimited by space.
Enables dumping in merged .eld file symbol information.
Disables dumping in merged .eld file symbol information. This is default behaviour.
Enables us to split an executable ELD file into multiple core specific ELD files.
<arch> is one of: b4420, b4860
Redirects the output to the specified file; standard output is used in case the file/ output is missing
Generates a srec file that does not contain records for the bss sections.
The tool will read the bss table from the input .eld file.
Displays the current version of the sc100-elf2xx utility.
Defines the CCSR start address of the first StarCore core. This information will be used by the tool to generate the .bin
files entries that will be used by the loader to program the MMU descriptors.
For B4860 the value is 0xffec40000.
Optional
Type
Valid only for bin format.
When using the output file, after loading the information into memory, the host has to write
0xa5a5a5a5
to
0xC007B000
in order to finalize the download process.
NOTE
Even if the user program uses only one core, private data for the other cores must also be included in the output file for proper boot operation.
For example, the user program generates the following output files for each of the cores:
• Core 0, project.eld
• Core 1, c1_project.eld
• Core 2, c2_project.eld
• Core 3, c3_project.eld
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
350 Freescale Semiconductor, Inc.
Chapter 14 StarCore DSP Utilities
To create an S-record output called led_output.s
from the combined object files, the sc100elf2xx
utility is called, as the code in the following listing shows. The
-t srec
selects an Srecord output format. The
-o led_output.s specifies the name of the output file. The
-m b4860
selects the device. Finally, all four input
.eld files specify the object code to combine.
Listing: Running ELF2XX Utility for Multiple Input Files
installDir\SC\StarCore_Support\compiler\bin >sc100-elf2xx -t srec -o led_output.s -m b4860 -#0 project.eld -#1 c1_project.eld
-#2 c2_project.eld -#3 c3_project.eld
To create an S-record output without any
.bss
section records, the sc100-elf2xx
utility is called as shown in the following listing.
Listing: Running ELF2XX Utility for Multiple Input Files
installDir\SC\StarCore_Support\compiler\bin >sc100-elf2xx -t srec
-DumpUninitializedData=Off -removeAllBss bss_table_file.txt -m b4860 -
#0 project.eld -#1 c1_project.eld -#2 c2_project.eld -#3 c3_project.eld
-removeAllBss bss_table_file.txt option ensures that all the bss sections are eliminated, no mater where they are placed, based on the information in the bss_table_file.txt
file.
This section contains the following topic:
•
•
Extract core specific images from multicore image
14.4.1 L1 Defense Support
This section describes the L1 defense support in the elf2xx utility for StarCore 3900FP
DSPs.
When reloading a core’s image, the loader must know what it should load without interfering with the running state of the other cores. In order to be able to do this, the loader (debugger or boot loader) must know which parts of the image are private and which are shared. It loads only the private parts or, in case multiple cores are restarted, also the image parts shared between the restarted and reloaded cores.
Based on the information in the segment header, the sc100-elf2xx
tool generates multiple images for each core: one containing the private code, and some other – one for each sharing space (cluster, multiple clusters, whole platform). Based on the output name, you will know to which cores each file corresponds.
You can use the following command:
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
Freescale Semiconductor, Inc.
351
ELF2XX Utility
sc100-elf2xx -t bin -o binary_image.bin -SeparateBinFiles=On -DumpUninitializedData=Off -m b4860 -entry_address 0xFFFFFFFFFFFFFFFF -ccsr_address 0xffec40000 -#0 test.eld -#1 c1_test.eld -#2 test.eld -#3 test.eld -#4 c4_test.eld -#5 c5_test.eld
The generated files name appears as:
<visible_cores>_binary_image.bin
Where visible_cores represents the cores that the image is visible on. Syntax is:
<visible_cores> =
-cX_ if the segment is private
-cX_c(X+1) if the segment is shared on one cluster
Example,
If one segment is private on core c0, the image will be emitted in file: c0_binrary_image.bin
if one segment is shared on cluster 0, the image name will be: c0_c1_binary_image.bin
if the segment is shared on the whole platform, the image name will be: c0_c1_c2_c3_c4_c5_binary_image.bin
if the segment is shared among cluster 0 and 2, the image name will be: c0_c1_c4_c5_binary_image.bin
This behavior is available only for the
.bin
output format.
Each image will contain the necessary information for the loader to program the MMU descriptors.
14.4.2 Extract core specific images from multicore image
This feature allows you to extract the core specific ELD images from a multicore ELD image which must be generated by using sc100-elf2xx. The listing below shows how to create multicore image from the core specific images.
Listing: Creating multicore image from core specific images
installDir\SC\StarCore_Support\compiler\bin >sc100-elf2xx -t eld -m b4860
-#0 project.eld -#1 c1_project.eld -#2 c2_project.eld -#3 c3_project.eld
-#4 c4_project.eld -#5 c5_project.eld -merge-with-symbol-information=On -o project.elf
The core specific images are extracted from the multicore image by using sc100-elf2xx, as shown by the listing below.
Listing: Extract core specific images
CodeWarrior Development Studio for StarCore 3900FP DSP Architectures Targeting Manual, Rev. 10.9.0,
11/2015
352 Freescale Semiconductor, Inc.
Unduh
Iklan