Example 7. Linker Command File for Scenario 3

/****************************************************************************/ /* Scenario 3 Link Command */ /* */ /* Usage: armlnk <obj files...> -o <out file> -m <map file> lnk32.cmd */ /* armcl <src files...> -z -o <out file> -m <map file> lnk32.cmd */ /* */ /* Description: This file is a sample command file that can be used */ /* for linking programs built with the TMS470 C */ /* compiler. Use it as a guideline; you may want to change */ /* the allocation scheme according to the size of your */ /* program and the memory layout of your target system. */ /* */ /* Notes: (1) You must specify the directory in which rts32.lib is */ /* located. Either add a "-i<directory>" line to this */ /* file, or use the system environment variable C_DIR to */ /* specify a search path for libraries. */ /* */ /* (2) If the runtime-support library you are using is not */ /* named rts32.lib, be sure to use the correct name here. */ /****************************************************************************/ -m example3.map /* SPECIFY THE SYSTEM MEMORY MAP */ MEMORY { I_MEM : org = 0x00000000 len = 0x00000020 /* INTERRUPTS */ D_MEM : org = 0x00000020 len = 0x00010000 /* DATA MEMORY (RAM) */ P_MEM : org = 0x00010020 len = 0x00100000 /* PROGRAM MEMORY (ROM) */ } /* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */ SECTIONS { secA: load = 0x20 secB: load = D_MEM }

You must create a hex conversion command file to generate a hex output with the correct addresses and format for the EPROM programmer.

The EPROM programmer in this scenario has the following system requirements:

With a memwidth of 32 and a romwidth of 16, two output files are generated by the hex conversion utility (the number of files is determined by the ratio of memwidth to romwidth). In previous scenarios, the output filename was specified with the -o option. Another way to specify the output filename is to use the files keyword within a ROMS directive. When you use -o or the files keyword, the first output filename always contains the low-order bytes of the word.

The hex conversion command file for Scenario 3 is shown in Example 8. This command file uses the following options to select the requirements of the system:

Option Description
-i Create Intel format
-map example3.mxp Generate example3.mxp as the map file of the conversion
-memwidth 32 Set EPROM system memory width to 32
-romwidth 16 Set physical ROM width to 16

The files keyword is used within the ROMS directive to specify the output filenames.