3.1.1.2 Using Linker to Fill Unused Flash Addresses
3.1.1.3 Using the Hex Converter to Fill Unused Flash Addresses
Procedure
Figure 7 illustrates the build process used by the AppCode to go from source code to a single binary file.
The linking stage can fill unused Flash addresses. The linker uses a command file to define the memory
range to the target processor. It then directs the program and data sections from the AppCode into these
defined memory ranges. If these ranges are not completely used, a fill value can be used to make sure
that all addresses have been loaded. Example 1 shows how the fill value of 0 × FFFF is being used to fill
any unused addresses in the memory ranges named: FLASHE, FLASHD, and FLASHC. Note that
FLASHB does not have a fill value. That is discussed in the next section when the hex converter fills this
Flash section with the same 0 × FFFF fill value.
Example 1. Linker Command File for Filling Unused Addresses With 0xFFFF
MEMORY
{
PAGE 0: /* Program Memory */
RAML0 : origin = 0x008000, length = 0x001000 /* on-chip RAM block
L0 */
FLASHE : origin = 0x3E8000, length = 0x004000, fill =0xFFFF /* on-chip FLASH */
FLASHD : origin = 0x3EC000, length = 0x004000, fill =0xFFFF /* on-chip FLASH */
FLASHC : origin = 0x3F0000, length = 0x004000, fill =0xFFFF /* on-chip FLASH */
FLASHB : origin = 0x3F4000, length = 0x002000 /* on-chip FLASH */
Example 2 shows the MAP file output from linking the AppCode. Note that the fill value of 0 × FFFF is
shown in the right-most column, and this fill value is associated with the memory ranges defined in the
linker command file.
The FLASHB range does not have a fill value assigned to it, and this range is shown as having 0 × 2000
addresses that are unused. These are filled in the next section using the hex converter.
Example 2. Linker MAP File With 0xFFFF Fill Values
******************************************************************************
TMS320C2000 COFF Linker PC v4.1.0
******************************************************************************
OUTPUT FILE NAME: <./Debug/AppCode.out>
ENTRY POINT SYMBOL: "_c_int00" address: 003ec000
MEMORY CONFIGURATION
name origin length used attr fill
---------------------- -------- --------- -------- ---- --------
PAGE 0: RAML0 00008000 00001000 00000086 RWIX
FLASHE 003e8000 00004000 00004000 RWIX ffff
FLASHD 003ec000 00004000 00004000 RWIX ffff
FLASHC 003f0000 00004000 00004000 RWIX ffff
FLASHB 003f4000 00002000 00000000 RWIX
FLASHA 003f6000 00001f80 00001f80 RWIX ffff
CSM_RSVD 003f7f80 00000076 00000076 RWIX
BEGIN 003f7ff6 00000002 00000002 RWIX
CSM_PWL 003f7ff8 00000008 00000008 RWIX
ROM 003ff000 00000fc0 00000000 RWIX
RESET 003fffc0 00000002 00000000 RWIX
VECTORS 003fffc2 0000003e 00000000 RWIX
The hex converter (HEX2000 utility) is used to convert the COFF formatted output from the linker to an
ASCII hex file. The format of this ASCII hex file can be controlled from a command file, similar to the
linker. Example 3 shows the F2810 HEX2000 command file used for the AppCode. HEX2000 is
documented in the TMS320C28x Assembly Language Tools User’s Guide (SPRU513 ).
SPRAAQ2 – October 2007 TMS320F281x Boot ROM Serial Flash Programming 9
Submit Documentation Feedback