Atmel CAVR-4 ユーザーズマニュアル

ページ / 323
CAVR-4
Part 1. Using the compiler
Placing code and data
51
Normally, XLINK will not generate an output file if there are any errors, such as range 
errors, during the linking process. Use the option Always generate output in IAR 
Embedded Workbench, or the option 
-B
 on the command line, to generate an output file 
even if a range error was encountered.
For further information about the listing options and the linker listing, see the IAR Linker 
and Library Tools Reference Guide
, and the AVR® IAR Embedded Workbench™ IDE 
User Guide
.
MANAGING MULTIPLE MEMORY SPACES
Output formats that do not support more than one memory space—like 
MOTOROLA
 and 
INTEL-HEX
—may require up to one output file per memory space. This causes no 
problems if you are only producing output to one memory space (flash), but if you also 
are placing objects in EEPROM or an external ROM in the DATA memory space, the 
output format cannot represent this, and the linker issues the following error message: 
Error[e133]: The output format Format cannot handle multiple 
address spaces. Use format variants (-y -O) to specify which 
address space is wanted.
To limit the output to flash, make a copy of the linker command file for the derivative 
and memory model you are using, and put it in your project directory. Use this copy in 
your project and add the following line at the end of the file:
-y(CODE)
To produce output for the other memory space(s), you must generate one output file per 
memory space (because the output format you have chosen does not support more than 
one memory space). Use the XLINK option 
-O
 for this purpose.
For each additional output file, you have to specify format, XLINK segment type, and 
file name. For example:
-Omotorola,(DATA)=external_rom.a90
-Omotorola,(XDATA)=eeprom.a90
Note: As a general rule, an output file is only necessary if you use non-volatile 
memory. In other words, output from the data space is only necessary if the data space 
contains external ROM.