cc2530-sb.xcl 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /**************************************************************************************************
  2. Filename: cc2530-sb.xcl
  3. Revised: $Date: 2012-03-29 12:09:02 -0700 (Thu, 29 Mar 2012) $
  4. Revision: $Revision: 29943 $
  5. Description: This is a linker command line file for the IAR XLINK tool for the
  6. CC2530 SoC and Z-Stack sample applications where the General Options
  7. for location for constants and strings is "ROM mapped as data".
  8. This mapping is for applications that are to be loaded onto the
  9. TI CC2530/31 via the embedded serial boot loader.
  10. Copyright 2009-2010 Texas Instruments Incorporated. All rights reserved.
  11. IMPORTANT: Your use of this Software is limited to those specific rights
  12. granted under the terms of a software license agreement between the user
  13. who downloaded the software, his/her employer (which must be your employer)
  14. and Texas Instruments Incorporated (the "License"). You may not use this
  15. Software unless you agree to abide by the terms of the License. The License
  16. limits your use, and you acknowledge, that the Software may not be modified,
  17. copied or distributed unless embedded on a Texas Instruments microcontroller
  18. or used solely and exclusively in conjunction with a Texas Instruments radio
  19. frequency transceiver, which is integrated into your product. Other than for
  20. the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  21. works of, modify, distribute, perform, display or sell this Software and/or
  22. its documentation for any purpose.
  23. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  24. PROVIDED “AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  25. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  26. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  27. TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  28. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  29. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  30. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  31. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  32. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  33. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  34. Should you have any questions regarding your right to use this Software,
  35. contact Texas Instruments Incorporated at www.TI.com.
  36. **************************************************************************************************/
  37. ////////////////////////////////////////////////////////////////////////////////
  38. //
  39. //
  40. // Segment limits
  41. // --------------
  42. //
  43. //
  44. // XDATA available to the program.
  45. //
  46. // Reserving address 0x0 for NULL.
  47. -D_XDATA_START=0x0001 // The boot loader code depends on stack setting this byte to 0xCD,
  48. // which happens because it is the last byte of the XSTACK.
  49. -D_XDATA_END=0x1EFF
  50. //
  51. //
  52. // The 8052 IDATA is overlayed on the SoC XDATA space from 0x1F00-0x1FFF.
  53. //
  54. -D_IDATA_END=0xFF // Last address of Idata memory.
  55. //
  56. //
  57. // CODE
  58. //
  59. -D_CODE_START=0x2000
  60. -D_CODE_END=0x7FFF // Last address for ROOT bank.
  61. //
  62. -D_FIRST_BANK_ADDR=0x10000
  63. //
  64. //
  65. //
  66. // Special SFRs
  67. // ------------
  68. //
  69. // Register bank setup
  70. //
  71. -D?REGISTER_BANK=0 // Default register bank (0,1,2,3).
  72. -D_REGISTER_BANK_START=0 // Start address for default register bank (00,08,10,18).
  73. //
  74. //
  75. // PDATA page setup
  76. //
  77. -D?PBANK_NUMBER=00 // High byte of 16-bit address to the PDATA area.
  78. //
  79. //
  80. // Virtual register setup
  81. // ----------------------
  82. //
  83. -D_BREG_START=0x00 // The bit address where the BREG segments starts.
  84. // Must be placed on: _BREG_START%8=0 where _BREG_START <= 0x78.
  85. -D?VB=0x20 // ?VB is used when referencing BREG as whole byte.
  86. // Must be placed on: ?VB=0x20+_BREG_START/8.
  87. //
  88. ////////////////////////////////////////////////////////////////////////////////
  89. ////////////////////////////////////////////////////////////////////////////////
  90. //
  91. // IDATA memory
  92. //
  93. // Setup "bit" segments (only for '__no_init bool' variables).
  94. -Z(BIT)BREG=_BREG_START
  95. -Z(BIT)BIT_N=0-7F
  96. -Z(DATA)REGISTERS+8=_REGISTER_BANK_START
  97. -Z(DATA)BDATA_Z,BDATA_N,BDATA_I=20-2F
  98. -Z(DATA)VREG+_NR_OF_VIRTUAL_REGISTERS=08-7F
  99. -Z(DATA)PSP,XSP=08-7F
  100. -Z(DATA)DOVERLAY=08-7F
  101. -Z(DATA)DATA_I,DATA_Z,DATA_N=08-7F
  102. -U(IDATA)0-7F=(DATA)0-7F
  103. -Z(IDATA)IDATA_I,IDATA_Z,IDATA_N=08-_IDATA_END
  104. -Z(IDATA)ISTACK+_IDATA_STACK_SIZE#08-_IDATA_END
  105. -Z(IDATA)IOVERLAY=08-FF
  106. ////////////////////////////////////////////////////////////////////////////////
  107. //
  108. // ROM memory
  109. //
  110. //
  111. // The following segments *must* be placed in the root bank. The order of
  112. // placement also matters for these segments, which is why we use the -Z
  113. // placement directive.
  114. //
  115. -Z(CODE)INTVEC=_CODE_START
  116. -Z(CODE)CHECKSUM=0x2090-0x2091
  117. -Z(CODE)CRC_SHDW=0x2092-0x2093
  118. -Z(CODE)BIT_ID,BDATA_ID,DATA_ID,IDATA_ID,IXDATA_ID,PDATA_ID,PDATA_Z,XDATA_ID=_CODE_START-_CODE_END
  119. //
  120. // Sleep PCON instruction must be 4-byte aligned.
  121. //
  122. -D_SLEEP_CODE_SPACE_START=(_CODE_END-7)
  123. -D_SLEEP_CODE_SPACE_END=(_CODE_END)
  124. -Z(CODE)SLEEP_CODE=_SLEEP_CODE_SPACE_START-_SLEEP_CODE_SPACE_END
  125. //
  126. // The following segments *must* be placed in the root bank, but the order
  127. // of placement within the root bank is not important, which is why we use the
  128. // -P directive here.
  129. //
  130. -P(CODE)CSTART,BANK_RELAYS,RCODE,DIFUNCT,NEAR_CODE=_CODE_START-_CODE_END
  131. //
  132. // Setup for constants located in code memory:
  133. //
  134. -P(CODE)CODE_C=_CODE_START-_CODE_END
  135. //
  136. // Define segments for const data in flash.
  137. // First the segment with addresses as used by the program (flash mapped as XDATA)
  138. -P(CONST)XDATA_ROM_C=0x8000-0xFFFF
  139. //
  140. // Then the segment with addresses as put in the hex file (flash bank 1)
  141. -P(CODE)XDATA_ROM_C_FLASH=0x18000-0x1FFFF
  142. //
  143. // Finally link these segments (XDATA_ROM_C_FLASH is the initializer segment for XDATA_ROM_C,
  144. // we map the flash in the XDATA address range instead of copying the data to RAM)
  145. -QXDATA_ROM_C=XDATA_ROM_C_FLASH
  146. //
  147. // The directive below ensures that the remaining space in the root bank gets
  148. // filled, then starts filling the banks.
  149. //
  150. -P(CODE)BANKED_CODE=_CODE_START-_CODE_END,0x18000-0x1FFFF,0x28000-0x2FFFF,0x38000-0x3FFFF,\
  151. 0x48000-0x4FFFF,0x58000-0x5FFFF,0x68000-0x6FFFF,0x78000-0x7C7FF
  152. ////////////////////////////////////////////////////////////////////////////////
  153. //
  154. // XDATA memory
  155. //
  156. -Z(XDATA)XSTACK+_XDATA_STACK_SIZE=_XDATA_START-_XDATA_END
  157. -Z(XDATA)XDATA_Z,XDATA_I=_XDATA_START-_XDATA_END
  158. -P(XDATA)XDATA_N=_XDATA_START-_XDATA_END
  159. -cx51
  160. ////////////////////////////////////////////////////////////////////////////////
  161. //
  162. // Texas Instruments device specific
  163. // =================================
  164. //
  165. //
  166. // Layout of CODE banks
  167. // -------------------
  168. //
  169. //-D_BANK0_START=0x08000
  170. //-D_BANK0_END=0x0FFFF
  171. //
  172. //-D_BANK1_START=0x18000
  173. //-D_BANK1_END=0x1FFFF
  174. //
  175. //-D_BANK2_START=0x28000
  176. //-D_BANK2_END=0x2FFFF
  177. //
  178. //-D_BANK3_START=0x38000
  179. //-D_BANK3_END=0x3FFFF
  180. //
  181. //-D_BANK4_START=0x48000
  182. //-D_BANK4_END=0x4FFFF
  183. //
  184. //-D_BANK5_START=0x58000
  185. //-D_BANK5_END=0x5FFFF
  186. //
  187. //-D_BANK6_START=0x68000
  188. //-D_BANK6_END=0x6FFFF
  189. //
  190. //-D_BANK7_START=0x78000
  191. //-D_BANK7_END=0x7FFFF
  192. //
  193. //
  194. // Include these two lines when generating a .hex file for banked code model:
  195. //-M(CODE)[(_CODEBANK_START+_FIRST_BANK_ADDR)-(_CODEBANK_END+_FIRST_BANK_ADDR)]*\
  196. //_NR_OF_BANKS+_FIRST_BANK_ADDR=0x8000
  197. //
  198. //
  199. // Internal flash used for NV address space: reserving 6 pages.
  200. // NV memory segment size must coincide with page declarations in "hal_board_cfg.h" file.
  201. //
  202. -D_ZIGNV_ADDRESS_SPACE_START=(((_NR_OF_BANKS+1)*_FIRST_BANK_ADDR)-0x3800)
  203. -D_ZIGNV_ADDRESS_SPACE_END=(_ZIGNV_ADDRESS_SPACE_START+0x2FFF)
  204. -Z(CODE)ZIGNV_ADDRESS_SPACE=_ZIGNV_ADDRESS_SPACE_START-_ZIGNV_ADDRESS_SPACE_END
  205. //
  206. ////////////////////////////////////////////////////////////////////////////////
  207. ////////////////////////////////////////////////////////////////////////////////
  208. //
  209. //
  210. // Skip boot code, CRC/shadow & NV pages when calculating the CRC.
  211. //
  212. -J2,crc16,=2000-208F,2094-7C7FF
  213. //
  214. // Fill code gaps with 0xFFFF so that the CRC can be verified programatically.
  215. -HFFFF
  216. //
  217. ////////////////////////////////////////////////////////////////////////////////