ram.ld 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. ENTRY(_start)
  2. /* Define the flash max size */
  3. __max_flash_size = 256k;
  4. __base = 0x10000000;
  5. /* Define the area */
  6. __comm_vma = 0x64000;
  7. __max_comm_size = 0x1200;
  8. __bcomm_vma = 0x18C00;
  9. __max_bcomm_size = 0x1400;
  10. __raminit_vma = 0x17000;
  11. __aram_vma = 0x50000;
  12. __cram_vma = 0x18000;
  13. __dram_vma = 0x58000;
  14. __nram_vma = 0x40000;
  15. /* 专用overlap area */
  16. __acomm_vma = 0x50000;
  17. __max_acomm_size = 0x6e00;
  18. __sleep_comm_vma = 0x52000;
  19. __max_sleep_comm_size = 0x1000;
  20. __pwrdwn_comm_vma = 0x52000;
  21. __max_pwrdwn_comm_size = 0x1000;
  22. __dbb_comm_vma = 0x41400;
  23. __max_dbb_comm_size = 0x400;
  24. MEMORY
  25. {
  26. init : org = __base, len = 512
  27. flash(rx) : org = __base + 512, len = __max_flash_size
  28. comm(rx) : org = __comm_vma, len = __max_comm_size
  29. bcomm(rx) : org = __bcomm_vma, len = __max_bcomm_size
  30. acomm(rx) : org = __acomm_vma, len = __max_acomm_size
  31. sleep_comm(rx) : org = __sleep_comm_vma, len = __max_sleep_comm_size
  32. pwrdwn_comm(rx) : org = __pwrdwn_comm_vma, len = __max_pwrdwn_comm_size
  33. dbb_comm(rx) : org = __dbb_comm_vma, len = __max_dbb_comm_size
  34. raminit(rx) : org = __raminit_vma, len = 512
  35. data : org = 0x18500, len = 0x700
  36. stack : org = 0x63C00, len = 1k
  37. aram : org = __aram_vma, len = 27k + 0x200
  38. cram : org = __cram_vma, len = 0x500
  39. dram : org = __dram_vma, len = 0x4500
  40. nram : org = __nram_vma, len = 6k
  41. }
  42. SECTIONS
  43. {
  44. .init : {
  45. *(.reset)
  46. *(.init_text)
  47. . = ALIGN(512);
  48. } > init
  49. .bcomm : {
  50. *(.bt_voice*)
  51. *(.text.sleep.rf)
  52. *(.com_text.led_disp)
  53. *(.com_text.ret.bt21.isr*)
  54. *(.com_text.rf*)
  55. *(.com_text.mav)
  56. *(.com_text.mute)
  57. *(.com_text.mictrim)
  58. *(.com_text.sbccode)
  59. *(.com_text.aec*)
  60. *(.com_text.tkey*)
  61. *(.com_text.bsp.tkey*)
  62. *(.com_text.bsp.key*)
  63. *(.com_text.bb.*)
  64. *(.com_text.bt.*)
  65. *(.com_text.btmem.pbap)
  66. *(.com_text.ble)
  67. . = ALIGN(512);
  68. } > bcomm AT > flash
  69. .comm : {
  70. KEEP(*(.vector))
  71. *(.plt)
  72. *(.com_text*)
  73. *(.com_rodata*)
  74. *(.srodata*)
  75. *debug.o(.rodata*)
  76. *(.data*)
  77. *(.sdata*)
  78. . = ALIGN(512);
  79. } > comm AT > flash
  80. .raminit : {
  81. *(.ramint.text*)
  82. . = ALIGN(512);
  83. } > raminit AT > flash
  84. /* 专用overlap area, 请勿修改 */
  85. .acomm : {
  86. *(.text.opus.asm)
  87. *(.text.opus.proc)
  88. *(.text.opus.ec_tell)
  89. *(.text.opus.entenc)
  90. *(.text.opus.mathops)
  91. *(.text.opus.metric)
  92. *(.text.opus.compute_mdcts)
  93. *(.text.opus.mdct)
  94. *(.text.opus.bands)
  95. *(.text.opus.kissfft)
  96. *(.text.opus.comb)
  97. *(.text.opus.vq)
  98. *(.rodata.opus*)
  99. . = ALIGN(512);
  100. } > acomm AT > flash
  101. .sleep_comm : {
  102. *(.text.sleep_com*)
  103. *(.sleep_text*)
  104. . = ALIGN(512);
  105. } > sleep_comm AT > flash
  106. .pwrdwn_comm : {
  107. *(.text.pwrdwn*)
  108. . = ALIGN(512);
  109. } > pwrdwn_comm AT > flash
  110. .dbb_comm : {
  111. *(.text.dbb*)
  112. . = ALIGN(512);
  113. } > dbb_comm AT > flash
  114. .flash : {
  115. *(.text.bb.tws.sw_nanos)
  116. . = ALIGN(512);
  117. *(.text.bfunc.bt)
  118. *(.text.bfunc.sleep)
  119. *(.text.bfunc.process)
  120. *(.text.bfunc.warning)
  121. *(.text.bfunc.vhouse)
  122. *(.text.bfunc*)
  123. *(.text.opus*)
  124. *(.text.ains3*)
  125. *(.rodata.ains3*)
  126. *(.text.dongle)
  127. *(.text.ble*)
  128. *(.text*)
  129. *(.rodata*)
  130. *(.rela*)
  131. . = ALIGN(512);
  132. } > flash
  133. .bss (NOLOAD):
  134. {
  135. __bss_start = .;
  136. *(.bss*)
  137. *(.sbss*)
  138. *(COMMON)
  139. *(.buf*)
  140. *(.wavres.buf)
  141. *(.anc.*)
  142. *(.anc_buf*)
  143. *(.ble_buf*)
  144. *(.ble_cache*)
  145. __bss_end = .;
  146. } > data
  147. __bss_size = __bss_end - __bss_start;
  148. .stack (NOLOAD) : {
  149. __irq_stack_start = .;
  150. . = 0x400;
  151. __irq_stack = .;
  152. } > stack
  153. __irq_stack_size = __irq_stack - __irq_stack_start;
  154. .aram_fcc __aram_vma (NOLOAD) : {
  155. . = 0x3350;
  156. *(.fcc_buf)
  157. } > aram
  158. /* 复用硬件DNN降噪的ram */
  159. .ains3_ram __aram_vma (NOLOAD) : {
  160. . = 0x5830;
  161. *(.ains3_buf.*)
  162. . = 0x6990;
  163. } > aram
  164. /* fcc huart使用buf, 复用mrom buff*/
  165. .cram_fcc __cram_vma (NOLOAD) : {
  166. *(.huart_buf)
  167. } > cram
  168. /* 进入快测模式后使用的buf*/
  169. .cram_qtest __cram_vma (NOLOAD) : {
  170. *(.qtest_buf)
  171. } > cram
  172. /*没有用到,防止未使用时占用ram*/
  173. .cram_eq __cram_vma (NOLOAD) : {
  174. *(.eq_dec_buf)
  175. } > cram
  176. .cram_dbb __cram_vma (NOLOAD) : {
  177. *(.dbb_dec_buf)
  178. } > cram
  179. //加密狗buf,只在系统一启动时使用
  180. .cram_dongle __cram_vma (NOLOAD) : {
  181. *(.dongle_buf)
  182. } > cram
  183. nram_opus __nram_vma (NOLOAD) : {
  184. *(.siri*)
  185. *(.opus_buf.buf)
  186. *(.att_siri.buf)
  187. *(.mavsco_buf)
  188. . = 0x1714;
  189. . = 0x1800;
  190. } > nram
  191. nram_dbb __nram_vma (NOLOAD) : {
  192. *(.codecs_buf.pcm)
  193. *(.codecs_pcm*)
  194. . = 0x1400;
  195. } > nram
  196. .dram_opus __dram_vma (NOLOAD) : {
  197. *(.opus_buf*)
  198. . = 0x4500;
  199. } > dram
  200. }
  201. /* Calc the lma */
  202. __comm_lma = LOADADDR(.comm);
  203. __comm_size = SIZEOF(.comm);
  204. __bcomm_lma = LOADADDR(.bcomm);
  205. __bcomm_size = SIZEOF(.bcomm);
  206. __acomm_lma = LOADADDR(.acomm);
  207. __acomm_size = SIZEOF(.acomm);
  208. __sleep_comm_lma = LOADADDR(.sleep_comm);
  209. __sleep_comm_size = SIZEOF(.sleep_comm);
  210. __pwrdwn_comm_lma = LOADADDR(.pwrdwn_comm);
  211. __pwrdwn_comm_size = SIZEOF(.pwrdwn_comm);
  212. __raminit_lma = LOADADDR(.raminit);
  213. __raminit_size = SIZEOF(.raminit);
  214. __dbb_comm_lma = LOADADDR(.dbb_comm);
  215. __dbb_comm_size = SIZEOF(.dbb_comm);