ota.xcl 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. /**************************************************************************************************
  2. Filename: ota.xcl
  3. Revised: $Date: 2009-08-13 10:21:20 -0700 (Thu, 13 Aug 2009) $
  4. Revision: $Revision: 20561 $
  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". This
  8. mapping is for applications to be loaded onto the TI CC2530 via OTA.
  9. Copyright 2010 Texas Instruments Incorporated. All rights reserved.
  10. IMPORTANT: Your use of this Software is limited to those specific rights
  11. granted under the terms of a software license agreement between the user
  12. who downloaded the software, his/her employer (which must be your employer)
  13. and Texas Instruments Incorporated (the "License"). You may not use this
  14. Software unless you agree to abide by the terms of the License. The License
  15. limits your use, and you acknowledge, that the Software may not be modified,
  16. copied or distributed unless embedded on a Texas Instruments microcontroller
  17. or used solely and exclusively in conjunction with a Texas Instruments radio
  18. frequency transceiver, which is integrated into your product. Other than for
  19. the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  20. works of, modify, distribute, perform, display or sell this Software and/or
  21. its documentation for any purpose.
  22. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  23. PROVIDED “AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  24. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  25. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  26. TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  27. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  28. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  29. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  30. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  31. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  32. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  33. Should you have any questions regarding your right to use this Software,
  34. contact Texas Instruments Incorporated at www.TI.com.
  35. **************************************************************************************************/
  36. ////////////////////////////////////////////////////////////////////////////////
  37. //
  38. //
  39. // Segment limits
  40. // --------------
  41. //
  42. //
  43. // XDATA available to the program.
  44. //
  45. // Reserving address 0x0 for NULL.
  46. -D_XDATA_START=0x0001
  47. -D_XDATA_END=0x1EFF
  48. //
  49. //
  50. // The 8052 IDATA is overlayed on the SoC XDATA space from 0x1F00-0x1FFF.
  51. //
  52. -D_IDATA_END=0xFF // Last address of Idata memory.
  53. //
  54. //
  55. // CODE
  56. //
  57. -D_CODE_START=0x0800
  58. -D_CODE_END=0x7FFF // Last address for ROOT bank.
  59. //
  60. -D_FIRST_BANK_ADDR=0x10000
  61. //
  62. //
  63. //
  64. // Special SFRs
  65. // ------------
  66. //
  67. // Register bank setup
  68. //
  69. -D?REGISTER_BANK=0 // Default register bank (0,1,2,3).
  70. -D_REGISTER_BANK_START=0 // Start address for default register bank (00,08,10,18).
  71. //
  72. //
  73. // PDATA page setup
  74. //
  75. -D?PBANK_NUMBER=00 // High byte of 16-bit address to the PDATA area.
  76. //
  77. //
  78. // Virtual register setup
  79. // ----------------------
  80. //
  81. -D_BREG_START=0x00 // The bit address where the BREG segments starts.
  82. // Must be placed on: _BREG_START%8=0 where _BREG_START <= 0x78.
  83. -D?VB=0x20 // ?VB is used when referencing BREG as whole byte.
  84. // Must be placed on: ?VB=0x20+_BREG_START/8.
  85. //
  86. ////////////////////////////////////////////////////////////////////////////////
  87. ////////////////////////////////////////////////////////////////////////////////
  88. //
  89. // IDATA memory
  90. //
  91. // Setup "bit" segments (only for '__no_init bool' variables).
  92. -Z(BIT)BREG=_BREG_START
  93. -Z(BIT)BIT_N=0-7F
  94. -Z(DATA)REGISTERS+8=_REGISTER_BANK_START
  95. -Z(DATA)BDATA_Z,BDATA_N,BDATA_I=20-2F
  96. -Z(DATA)VREG+_NR_OF_VIRTUAL_REGISTERS=08-7F
  97. -Z(DATA)PSP,XSP=08-7F
  98. -Z(DATA)DOVERLAY=08-7F
  99. -Z(DATA)DATA_I,DATA_Z,DATA_N=08-7F
  100. -U(IDATA)0-7F=(DATA)0-7F
  101. -Z(IDATA)IDATA_I,IDATA_Z,IDATA_N=08-_IDATA_END
  102. -Z(IDATA)ISTACK+_IDATA_STACK_SIZE#08-_IDATA_END
  103. -Z(IDATA)IOVERLAY=08-FF
  104. ////////////////////////////////////////////////////////////////////////////////
  105. //
  106. // ROM memory
  107. //
  108. //
  109. // The following segments *must* be placed in the root bank. The order of
  110. // placement also matters for these segments, which is why we use the -Z
  111. // placement directive.
  112. //
  113. -Z(CODE)INTVEC=_CODE_START
  114. -Z(CODE)CRC=0x0888-0x088B
  115. -Z(CODE)PREAMBLE=0x088C-0x0897
  116. -Z(CODE)BIT_ID,BDATA_ID,DATA_ID,IDATA_ID,IXDATA_ID,PDATA_ID,XDATA_ID=_CODE_START-_CODE_END
  117. -Z(CODE)RAM_CODE_FLASH=_RAM_CODE_FLASH_START-_RAM_CODE_FLASH_END
  118. //
  119. // Sleep PCON instruction must be 4-byte aligned.
  120. //
  121. -D_SLEEP_CODE_SPACE_START=(_CODE_END-7)
  122. -D_SLEEP_CODE_SPACE_END=(_CODE_END)
  123. -Z(CODE)SLEEP_CODE=_SLEEP_CODE_SPACE_START-_SLEEP_CODE_SPACE_END
  124. //
  125. // The following segments *must* be placed in the root bank, but the order
  126. // of placement within the root bank is not important, which is why we use the
  127. // -P directive here.
  128. //
  129. -P(CODE)CSTART,BANK_RELAYS,RCODE,DIFUNCT,NEAR_CODE=_CODE_START-_CODE_END
  130. //
  131. // Setup for constants located in code memory:
  132. //
  133. -P(CODE)CODE_C=_CODE_START-_CODE_END
  134. //
  135. // Define segments for const data in flash.
  136. // First the segment with addresses as used by the program (flash mapped as XDATA)
  137. -P(CONST)XDATA_ROM_C=0x8000-0xFFFF
  138. //
  139. // Then the segment with addresses as put in the hex file (flash bank 1)
  140. -P(CODE)XDATA_ROM_C_FLASH=0x18000-0x1FFFF
  141. //
  142. // Finally link these segments (XDATA_ROM_C_FLASH is the initializer segment for XDATA_ROM_C,
  143. // we map the flash in the XDATA address range instead of copying the data to RAM)
  144. -QXDATA_ROM_C=XDATA_ROM_C_FLASH
  145. // Uncomment when implementing OAD NV by dividing internal flash in half.
  146. //-P(CODE)BANKED_CODE=0x0800-0x7FFF,0x18000-0x1FFFF,0x28000-0x2FFFF,0x38000-0x3E7FF
  147. // Uncomment when implementing OAD NV by external E2PROM AND external flash is 256 KB or bigger.
  148. // (e.g. when using SmartRF05 Rev. 1.7 or later.)
  149. -P(CODE)BANKED_CODE=0x0800-0x7FFF,0x18000-0x1FFFF,0x28000-0x2FFFF,0x38000-0x3FFFF,0x48000-0x4FFFF,\
  150. 0x58000-0x5FFFF,0x68000-0x6FFFF,0x78000-0x7C7FF
  151. ////////////////////////////////////////////////////////////////////////////////
  152. //
  153. // XDATA memory
  154. //
  155. -Z(XDATA)XSTACK+_XDATA_STACK_SIZE=_XDATA_START-_XDATA_END
  156. -Z(XDATA)XDATA_Z,XDATA_I=_XDATA_START-_XDATA_END
  157. -P(XDATA)XDATA_N=_XDATA_START-_XDATA_END
  158. -cx51
  159. ////////////////////////////////////////////////////////////////////////////////
  160. //
  161. // Texas Instruments device specific
  162. // =================================
  163. //
  164. //
  165. // Layout of CODE banks
  166. // -------------------
  167. //
  168. //-D_BANK0_START=0x08000
  169. //-D_BANK0_END=0x0FFFF
  170. //
  171. //-D_BANK1_START=0x18000
  172. //-D_BANK1_END=0x1FFFF
  173. //
  174. //-D_BANK2_START=0x28000
  175. //-D_BANK2_END=0x2FFFF
  176. //
  177. //-D_BANK3_START=0x38000
  178. //-D_BANK3_END=0x3FFFF
  179. //
  180. //-D_BANK4_START=0x48000
  181. //-D_BANK4_END=0x4FFFF
  182. //
  183. //-D_BANK5_START=0x58000
  184. //-D_BANK5_END=0x5FFFF
  185. //
  186. //-D_BANK6_START=0x68000
  187. //-D_BANK6_END=0x6FFFF
  188. //
  189. //-D_BANK7_START=0x78000
  190. //-D_BANK7_END=0x7FFFF
  191. //
  192. //
  193. // Include these two lines when generating a .hex file for banked code model:
  194. //-M(CODE)[(_CODEBANK_START+_FIRST_BANK_ADDR)-(_CODEBANK_END+_FIRST_BANK_ADDR)]*\
  195. //_NR_OF_BANKS+_FIRST_BANK_ADDR=0x8000
  196. //
  197. //
  198. // Any code that will be run from RAM by setting XMAP of MEMCTL must have the same bank-relative
  199. // address as the address in RAM to which the CODE will be copied to run.
  200. // Thus, any part of the first 8k of any bank can be dedicated to code that will run from RAM as
  201. // long as the corresponding relative address range is reserved in RAM by RAM_CODE_XDATA.
  202. //
  203. -D_RAM_CODE_XDATA_START=0x01EDD
  204. -D_RAM_CODE_XDATA_END=(_RAM_CODE_XDATA_START+0x22)
  205. -Z(XDATA)RAM_CODE_XDATA=_RAM_CODE_XDATA_START-_RAM_CODE_XDATA_END
  206. //
  207. -D_RAM_CODE_FLASH_START=0x39EDD
  208. -D_RAM_CODE_FLASH_END=(_RAM_CODE_FLASH_START+0x22)
  209. //
  210. //
  211. //
  212. // Internal flash used for NV address space: reserving 6 pages.
  213. //
  214. -D_ZIGNV_ADDRESS_SPACE_START=(((_NR_OF_BANKS+1)*_FIRST_BANK_ADDR)-0x3800)
  215. -D_ZIGNV_ADDRESS_SPACE_END=(_ZIGNV_ADDRESS_SPACE_START+0x2FFF)
  216. -Z(CODE)ZIGNV_ADDRESS_SPACE=_ZIGNV_ADDRESS_SPACE_START-_ZIGNV_ADDRESS_SPACE_END
  217. //
  218. //
  219. //
  220. // The last available page of flash is reserved for special use as follows
  221. // (addressing from the end of the page down):
  222. // 16 bytes Lock bits
  223. // 8 bytes IEEE address space (EUI-64)
  224. // 22 bytes Device Private Key (21 bytes + 1 byte pad to NV word size)
  225. // 22 bytes CA Public Key (22 bytes)
  226. // 48 bytes Implicit Certificate (48 bytes)
  227. // 1932 bytes Reserved for future Z-Stack use (1932 bytes)
  228. //
  229. -D_LOCK_BITS_ADDRESS_SPACE_START=(((_NR_OF_BANKS+1)*_FIRST_BANK_ADDR)-0x10)
  230. -D_LOCK_BITS_ADDRESS_SPACE_END=(_LOCK_BITS_ADDRESS_SPACE_START+0x0F)
  231. -Z(CODE)LOCK_BITS_ADDRESS_SPACE=_LOCK_BITS_ADDRESS_SPACE_START-_LOCK_BITS_ADDRESS_SPACE_END
  232. //
  233. -D_IEEE_ADDRESS_SPACE_START=(_LOCK_BITS_ADDRESS_SPACE_START-0x08)
  234. -D_IEEE_ADDRESS_SPACE_END=(_IEEE_ADDRESS_SPACE_START+0x07)
  235. -Z(CODE)IEEE_ADDRESS_SPACE=_IEEE_ADDRESS_SPACE_START-_IEEE_ADDRESS_SPACE_END
  236. //
  237. -D_DEV_PRIVATE_KEY_ADDRESS_SPACE_START=(_IEEE_ADDRESS_SPACE_START-0x16)
  238. -D_DEV_PRIVATE_KEY_ADDRESS_SPACE_END=(_DEV_PRIVATE_KEY_ADDRESS_SPACE_START+0x15)
  239. -Z(CODE)DEV_PRIVATE_KEY_ADDRESS_SPACE=_DEV_PRIVATE_KEY_ADDRESS_SPACE_START-_DEV_PRIVATE_KEY_ADDRESS_SPACE_END
  240. //
  241. -D_CA_PUBLIC_KEY_ADDRESS_SPACE_START=(_DEV_PRIVATE_KEY_ADDRESS_SPACE_START-0x16)
  242. -D_CA_PUBLIC_KEY_ADDRESS_SPACE_END=(_CA_PUBLIC_KEY_ADDRESS_SPACE_START+0x15)
  243. -Z(CODE)CA_PUBLIC_KEY_ADDRESS_SPACE=_CA_PUBLIC_KEY_ADDRESS_SPACE_START-_CA_PUBLIC_KEY_ADDRESS_SPACE_END
  244. //
  245. -D_IMPLICIT_CERTIFICATE_ADDRESS_SPACE_START=(_CA_PUBLIC_KEY_ADDRESS_SPACE_START-0x30)
  246. -D_IMPLICIT_CERTIFICATE_ADDRESS_SPACE_END=(_IMPLICIT_CERTIFICATE_ADDRESS_SPACE_START+0x2F)
  247. -Z(CODE)IMPLICIT_CERTIFICATE_ADDRESS_SPACE=_IMPLICIT_CERTIFICATE_ADDRESS_SPACE_START-_IMPLICIT_CERTIFICATE_ADDRESS_SPACE_END
  248. //
  249. -D_RESERVED_ADDRESS_SPACE_START=(_IMPLICIT_CERTIFICATE_ADDRESS_SPACE_START-0x78C)
  250. -D_RESERVED_ADDRESS_SPACE_END=(_RESERVED_ADDRESS_SPACE_START+0x78B)
  251. -Z(CODE)RESERVED_ADDRESS_SPACE=_RESERVED_ADDRESS_SPACE_START-_RESERVED_ADDRESS_SPACE_END
  252. //
  253. ////////////////////////////////////////////////////////////////////////////////
  254. //
  255. // Fill code gaps with 0xFFFF so that the CRC can be verified programatically.
  256. -HFFFF
  257. //
  258. ////////////////////////////////////////////////////////////////////////////////