znp-prod.xcl 10 KB

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