lnkm30627fhp.xcl 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. //================================================================
  2. //
  3. // IAR XLINK command file for the IAR C/C++ Compiler for
  4. // Renesas M16C/R8C
  5. //
  6. // This is an example XLINK command file for use with the
  7. // M30627FHP derivative.
  8. //
  9. // Derivative group: m16c 62p
  10. //
  11. //
  12. // Usage: xlink your_file(s) -f this_file clm16c*.r48
  13. //
  14. // Copyright 2001-2008 IAR Systems AB.
  15. //
  16. // $Revision: 2144 $
  17. //
  18. //================================================================
  19. //================================================================
  20. // The M16C IAR C/EC++ Compiler places code and data into named
  21. // segments which are referred to by the IAR XLINK Linker. The
  22. // table below shows the available segments.
  23. //
  24. // SEGMENT REFERENCE
  25. // =================
  26. //
  27. // Segment Description
  28. // ------- -----------
  29. // BITVARS Bit variables.
  30. // CODE The program code.
  31. // CSTACK The stack used by C or Embedded C++ programs.
  32. // CSTART The startup code.
  33. // DATA16_HEAP Heap data used by malloc and free. Used by CLib and DLib
  34. // FAR_HEAP Heap used by malloc and free in DLib
  35. // DATA20_HEAP Heap used by malloc and free in DLib
  36. //
  37. // x_AC Non-initialized located const objects.
  38. // x_AN Non-initialized located non-const objects.
  39. // x_C Constant data, including string literals.
  40. // x_I Initialized data.
  41. // x_ID Data that is copied to x_I by cstartup.
  42. // x_N Uninitialized data.
  43. // x_Z zero initialized data.
  44. //
  45. // Where x can be one of:
  46. // DATA13 (Range: 0-0x1FFF)
  47. // DATA16 (Range: 0-0xFFFF, except DATA16_ID)
  48. // DATA20 (Range: 0-0xFFFFF)
  49. // FAR (Range: 0-0xFFFFF)
  50. //
  51. // DIFUNCT Pointers to code, typically EC++ constructors
  52. // FLIST Jump table for __tiny_func functions.
  53. // INTVEC Contains reset and interrupt vectors.
  54. // INTVEC1 Contains the fixed reset and interrupt vectors.
  55. // ISTACK The stack used by interrupts and exceptions.
  56. //================================================================
  57. // Define CPU
  58. -cm16c
  59. //================================================================
  60. // USER DEFINITIONS
  61. // Please customize according to your preferences.
  62. //================================================================
  63. // Size of the user stack
  64. // Uncomment for command line use
  65. //-D_CSTACK_SIZE=100
  66. // Size of the interrupt stack
  67. // Uncomment for command line use
  68. //-D_ISTACK_SIZE=40
  69. // Size of the heap
  70. // Uncomment for command line use
  71. //-D_DATA16_HEAP_SIZE=400
  72. //-D_FAR_HEAP_SIZE=400
  73. //-D_DATA20_HEAP_SIZE=400
  74. // Reserved memory
  75. // Reservation of RAM and ROM memory not to be used by the application.
  76. // Preset for use with the E8 emulator.
  77. // NOTE! Set these values to zero to utilize the whole RAM and ROM memory.
  78. -D_RESERVED_RAM_SIZE=80
  79. -D_RESERVED_ROM_SIZE=800
  80. //================================================================
  81. // Memory Definitions
  82. //================================================================
  83. // Memory areas available for the application
  84. -D_USER_RAM_BEGIN=(00400+_RESERVED_RAM_SIZE)
  85. -D_USER_RAM_END=07FFF
  86. -D_DATA_FLASH_BEGIN=0F000
  87. -D_DATA_FLASH_END=0FFFF
  88. -D_USER_ROM_BEGIN=(A0000+_RESERVED_ROM_SIZE)
  89. -D_USER_ROM_END=FFFFF
  90. // Relocatable "bit" segment (must be in near area).
  91. // As BITVARS contains bit addresses, the address has to be recalculated.
  92. // Byte address 400 --> 400 * 8 = bit address 2000
  93. -D_BITVAR_BEGIN=2000 // address 400
  94. -D_BITVAR_END=FFFF // address 1FFF
  95. // ID code and OFS value written to ROM memory
  96. -D_ID_CODE_1=FF
  97. -D_ID_CODE_2=FF
  98. -D_ID_CODE_3=FF
  99. -D_ID_CODE_4=FF
  100. -D_ID_CODE_5=FF
  101. -D_ID_CODE_6=FF
  102. -D_ID_CODE_7=FF
  103. -D_OFS_VALUE=FF
  104. // _OFS2_VALUE has to be defined. It is only used in some R8C devices and will
  105. // not result in any additional code or data for any other device.
  106. -D_OFS2_VALUE=FF
  107. // =======================
  108. // DATA13 RAM
  109. // =======================
  110. -Z(NEAR)DATA13_AN=0-01FFF
  111. -Z(NEAR)DATA13_I=_USER_RAM_BEGIN-01FFF
  112. -Z(NEAR)DATA13_Z,DATA13_N=_USER_RAM_BEGIN-01FFF
  113. // Relocatable "bit" segment. As BITVARS contains bit addresses,
  114. // the desired (byte) address has to be multiplied by 8.
  115. -Z(BIT)BITVARS=_BITVAR_BEGIN-_BITVAR_END
  116. // =======================
  117. // DATA16 RAM
  118. // =======================
  119. // Set up interrupt stack
  120. -Z(NEAR)ISTACK+_ISTACK_SIZE#_USER_RAM_BEGIN-_USER_RAM_END
  121. // Set up user stack
  122. -Z(NEAR)CSTACK+_CSTACK_SIZE#_USER_RAM_BEGIN-_USER_RAM_END
  123. // Set up near heap
  124. -Z(NEAR)DATA16_HEAP+_DATA16_HEAP_SIZE=_USER_RAM_BEGIN-_USER_RAM_END
  125. // Near variables
  126. -Z(NEAR)DATA16_I,DATA16_Z,DATA16_N,DATA16_AN=_USER_RAM_BEGIN-_USER_RAM_END
  127. // User defined near DATA segments
  128. // =======================
  129. // DATA16 ROM
  130. // =======================
  131. // Data flash
  132. -Z(CONST)DATA_FLASH=_DATA_FLASH_BEGIN-_DATA_FLASH_END
  133. // Constant segments (in ROM), reachable for near pointers
  134. // (Use declaration -Z(CONST)DATA16_C if near ROM exists)
  135. // User defined near CONST segments
  136. // =======================
  137. // FAR/DATA20 RAM
  138. // =======================
  139. // Far and huge data segments
  140. -Z(FAR)FAR_I,FAR_Z,FAR_N,FAR_AN=_USER_RAM_BEGIN-_USER_RAM_END
  141. -Z(FAR)FAR_HEAP+_FAR_HEAP_SIZE=_USER_RAM_BEGIN-_USER_RAM_END
  142. -Z(HUGE)DATA20_I,DATA20_Z,DATA20_N,DATA20_AN=_USER_RAM_BEGIN-_USER_RAM_END
  143. -Z(HUGE)DATA20_HEAP+_DATA20_HEAP_SIZE=_USER_RAM_BEGIN-_USER_RAM_END
  144. // User defined far & huge DATA segments
  145. // =======================
  146. // FAR/DATA20 ROM
  147. // =======================
  148. // Fixed interrupt vector table
  149. -Z(CONST)INTVEC1=FFFDC-FFFFF
  150. // Special page table
  151. -Z(CONST)FLIST=FFE00-FFFDB
  152. // Variable vector table (growing downwards from _USER_ROM_END)
  153. // The added -1 is too assure that all vectors start at even
  154. // addresses.
  155. -Z(CONST)INTVEC=D0000-(_USER_ROM_END-1)
  156. // Constant and initializer segments (in ROM)
  157. -Z(FARCONST)FAR_ID=_USER_ROM_BEGIN-_USER_ROM_END
  158. -Z(FARCONST)FAR_C=_USER_ROM_BEGIN-_USER_ROM_END
  159. -Z(HUGECONST)DATA20_C,DATA20_ID,CHECKSUM=_USER_ROM_BEGIN-_USER_ROM_END
  160. -Z(FARCONST)DATA16_ID,DATA13_ID,DIFUNCT=_USER_ROM_BEGIN-_USER_ROM_END
  161. // User defined far & huge CONST segments
  162. // CODE segments
  163. // TINYFUNC code must be located above 0xF0000
  164. -P(CODE)TINYFUNC=F0000-_USER_ROM_END
  165. // Startup code
  166. -P(CODE)CSTART=D0000-_USER_ROM_END
  167. // "Regular" code
  168. -P(CODE)CODE=_USER_ROM_BEGIN-_USER_ROM_END
  169. // User defined CODE segments
  170. // ========================
  171. // IAR C library formatting
  172. // ========================
  173. // Uncomment for command line use
  174. //-e_small_write=_formatted_write
  175. //-e_medium_read=_formatted_read
  176. // ========================
  177. // Output files
  178. // ========================
  179. // Use the -O option to create one or more output files
  180. // at the same link session. Formats flags, file name and
  181. // extension is optional. Please un-comment the wanted
  182. // output formats below.
  183. //
  184. // CAUTION: Do not combine other output formats with -rt (special
  185. // UBROF for Terminal I/O in C-SPY). Output files are valid but
  186. // contain code that expects to be run under C-SPY.
  187. // Motorola output
  188. //-Omotorola=.mot
  189. // IEEE-695 output with format flags for the Renesas debugger
  190. //-Oieee695,lbm=.x30
  191. // ELF/DWARF output with format flags for the Renesas debugger
  192. //-Oelf,spc=.elf