oad-boot.xcl 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // File: Modeled upon lnk51ew_cc2530b_PG2_0.xcl
  4. //
  5. // Description:
  6. // This is a extended command line file for XLINK tool to be used to build boot code
  7. // for applications written for OAD on the TI CC2530.
  8. //
  9. // Works with CC2530 PG2.0
  10. //
  11. // Important:
  12. // Data cannot be located at address zero, this address is reserved for the null pointer.
  13. //
  14. ////////////////////////////////////////////////////////////////////////////////
  15. ////////////////////////////////////////////////////////////////////////////////
  16. //
  17. // Variables (used by lnk_base.xcl)
  18. // ================================
  19. //
  20. // Segment limits
  21. // --------------
  22. //
  23. //
  24. // IDATA
  25. //
  26. -D_IDATA_END=0xFF // Last address of Idata memory
  27. //
  28. //
  29. // PDATA
  30. //
  31. -D_PDATA_START=0x1E00 // First address for PDATA memory.
  32. -D_PDATA_END=0x1EFF // Last address for PDATA memory.
  33. //
  34. //
  35. //
  36. // IXDATA
  37. //
  38. -D_IXDATA_START=0x0100
  39. -D_IXDATA_END=0x1DFF
  40. //
  41. //
  42. // XDATA
  43. //
  44. // The internal XDATA is used as XDATA.
  45. -D_XDATA_START=_IXDATA_START
  46. -D_XDATA_END=_IXDATA_END
  47. //
  48. //
  49. // CODE
  50. //
  51. -D_CODE_START=0x0000
  52. -D_CODE_END=0x07FF
  53. //
  54. //
  55. //
  56. // Special SFRs
  57. // ------------
  58. //
  59. // Register bank setup
  60. //
  61. -D?REGISTER_BANK=0 // Default register bank (0,1,2,3).
  62. -D_REGISTER_BANK_START=0 // Start address for default register bank (00,08,10,18).
  63. //
  64. //
  65. // PDATA page setup
  66. //
  67. -D?PBANK_NUMBER=1E // High byte of 16-bit address to the PDATA area.
  68. -D?PBANK=93 // Most significant byte in MOVX A,@R0. (0x93 is sfr MPAGE).
  69. //
  70. //
  71. // Virtual register setup
  72. // ----------------------
  73. //
  74. -D_BREG_START=0x00 // The bit address where the BREG segments starts.
  75. // Must be placed on: _BREG_START%8=0 where _BREG_START <= 0x78.
  76. -D?VB=0x20 // ?VB is used when referencing BREG as whole byte.
  77. // Must be placed on: ?VB=0x20+_BREG_START/8.
  78. //
  79. ////////////////////////////////////////////////////////////////////////////////
  80. ////////////////////////////////////////////////////////////////////////////////
  81. //
  82. // IDATA memory
  83. //
  84. // Setup "bit" segments (only for '__no_init bool' variables).
  85. -Z(BIT)BREG=_BREG_START
  86. -Z(BIT)BIT_N=0-7F
  87. -Z(DATA)REGISTERS+8=_REGISTER_BANK_START
  88. -Z(DATA)BDATA_Z,BDATA_N,BDATA_I=20-2F
  89. -Z(DATA)VREG+_NR_OF_VIRTUAL_REGISTERS=08-7F
  90. -Z(DATA)PSP,XSP=08-7F
  91. -Z(DATA)DOVERLAY=08-7F
  92. -Z(DATA)DATA_I,DATA_Z,DATA_N=08-7F
  93. -U(IDATA)0-7F=(DATA)0-7F
  94. -Z(IDATA)IDATA_I,IDATA_Z,IDATA_N=08-_IDATA_END
  95. -Z(IDATA)ISTACK+_IDATA_STACK_SIZE#08-_IDATA_END
  96. -Z(IDATA)IOVERLAY=08-FF
  97. ////////////////////////////////////////////////////////////////////////////////
  98. //
  99. // ROM memory
  100. //
  101. //
  102. // The following segments *must* be placed in the root bank. The order of
  103. // placement also matters for these segments, which is why we use the -Z
  104. // placement directive.
  105. //
  106. -Z(CODE)INTVEC=_CODE_START
  107. -Z(CODE)BIT_ID,BDATA_ID,DATA_ID,IDATA_ID,IXDATA_ID,PDATA_ID,XDATA_ID=_CODE_START-_CODE_END
  108. -Z(CODE)RAM_CODE_FLASH=_RAM_CODE_FLASH_START-_RAM_CODE_FLASH_END
  109. //
  110. //
  111. // The following segments *must* be placed in the root bank, but the order
  112. // of placement within the root bank is not important, which is why we use the
  113. // -P directive here.
  114. //
  115. -P(CODE)CSTART,BANK_RELAYS,RCODE,DIFUNCT,NEAR_CODE=_CODE_START-_CODE_END
  116. ////////////////////////////////////////////////////////////////////////////////
  117. //
  118. // XDATA memory
  119. //
  120. //
  121. // Stacks located in XDATA
  122. //
  123. -Z(XDATA)PSTACK+_PDATA_STACK_SIZE=_PDATA_START-_PDATA_END
  124. -Z(XDATA)XSTACK+_XDATA_STACK_SIZE=_XDATA_START-_XDATA_END
  125. //
  126. // XDATA - data memory
  127. //
  128. -Z(XDATA)IXDATA_N,IXDATA_Z,IXDATA_I=_IXDATA_START-_IXDATA_END
  129. -Z(XDATA)XDATA_N,XDATA_Z,XDATA_I=_XDATA_START-_XDATA_END
  130. -cx51
  131. ////////////////////////////////////////////////////////////////////////////////
  132. //
  133. //
  134. //
  135. // Any code that will be run from RAM by setting XMAP of MEMCTL must have the same bank-relative
  136. // address as the address in RAM to which the CODE will be copied to run.
  137. // Thus, any part of the first 8k of any bank can be dedicated to code that will run from RAM as
  138. // long as the corresponding relative address range is reserved in RAM by RAM_CODE_XDATA.
  139. //
  140. -D_RAM_CODE_XDATA_START=0x07E5
  141. -D_RAM_CODE_XDATA_END=(_RAM_CODE_XDATA_START+0x1A)
  142. -Z(XDATA)RAM_CODE_XDATA=_RAM_CODE_XDATA_START-_RAM_CODE_XDATA_END
  143. //
  144. -D_RAM_CODE_FLASH_START=0x07E5
  145. -D_RAM_CODE_FLASH_END=(_RAM_CODE_FLASH_START+0x1A)
  146. //
  147. // Fill code gaps with 0xFFFF so that the .hex image produced is full.
  148. -HFFFF
  149. //
  150. //
  151. //
  152. ////////////////////////////////////////////////////////////////////////////////