Operation of the preloader image tool, Operation of the preloader image tool -17 – Altera SoC Embedded Design Suite User Manual
Page 182

The preloader image tool makes the following assumptions:
1. The input file format is raw binary. You must use the
objcopy
utility provided with the GNU
Compiler Collection (GCC) tool chain from the Mentor Graphics website to convert other file formats,
such as Executable and Linking Format File (
.elf
), Hexadecimal (Intel-Format) File (
.hex
), or S-Record
File (
.srec
), to a binary format. The output file format is binary.
2. The preloader image tool always creates the output image at the beginning of the binary file. If the
image must be programmed at a specific base address, you must supply the address information to the
flash programming tool.
3. The output file contains only preloader images. Other images such as Linux, SRAM Object File (
.sof
)
and user data are programmed separately using a flash programming tool or related utilities in the U-
boot on the target system.
Related Information
For more information about the GNU Compiler Collection (GCC) toolchain, refer to the Mentor
Graphics website.
Operation of the Preloader Image Tool
The preloader image tool runs on a host machine. The tool generates the header and CRC checksum and
inserts them into the final preloader image with the preloader program image and preloader exception
vector.
For certain flash memory tools, the position of the preloader images must be aligned to a specific block
size; the preloader image tool generates any padding data that may be required.
The preloader image tool optionally decodes and validates header information when given a pre-
generated preloader image.
Figure 7-4: Basic Operation of the Preloader Image Tool
Preloader Program
(Empty)
Preloader Exception Vector
CRC Checksum
Header
Preloader Program
Header
Preloader Exception Vector
Padding
CRC Checksum
0x0000
+
As illustrated, the binary preloader image is an input to the preloader image tool. The compiler leaves an
empty space between the preloader exception vector and the program. The preloader image tool
overwrites this empty region with header information and calculates a checksum for the whole image.
When necessary, the preloader image tool appends the padding data to the output image.
The header includes:
• Validation word
• Version field (set to 0x0)
• Flags field (set to 0x0)
• Program length measured by the number of 32 bit words in the preloader program
• 16-bit checksum of the header contents (0x40 – 0x49)
ug-1137
2013.05.03
Operation of the Preloader Image Tool
7-17
HPS Preloader User Guide
Altera Corporation