ram.ld 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. . = ALIGN(512);
  66. } > bcomm AT > flash
  67. .comm : {
  68. KEEP(*(.vector))
  69. *(.plt)
  70. *(.com_text*)
  71. *(.com_rodata*)
  72. *(.srodata*)
  73. *debug.o(.rodata*)
  74. *(.data*)
  75. *(.sdata*)
  76. . = ALIGN(512);
  77. } > comm AT > flash
  78. .raminit : {
  79. *(.ramint.text*)
  80. . = ALIGN(512);
  81. } > raminit AT > flash
  82. /* 专用overlap area, 请勿修改 */
  83. .acomm : {
  84. *(.text.opus.asm)
  85. *(.text.opus.proc)
  86. *(.text.opus.ec_tell)
  87. *(.text.opus.entenc)
  88. *(.text.opus.mathops)
  89. *(.text.opus.metric)
  90. *(.text.opus.compute_mdcts)
  91. *(.text.opus.mdct)
  92. *(.text.opus.bands)
  93. *(.text.opus.kissfft)
  94. *(.text.opus.comb)
  95. *(.text.opus.vq)
  96. *(.rodata.opus*)
  97. . = ALIGN(512);
  98. } > acomm AT > flash
  99. .sleep_comm : {
  100. *(.text.sleep_com*)
  101. *(.sleep_text*)
  102. . = ALIGN(512);
  103. } > sleep_comm AT > flash
  104. .pwrdwn_comm : {
  105. *(.text.pwrdwn*)
  106. . = ALIGN(512);
  107. } > pwrdwn_comm AT > flash
  108. .dbb_comm : {
  109. *(.text.dbb*)
  110. . = ALIGN(512);
  111. } > dbb_comm AT > flash
  112. .flash : {
  113. *(.text.bb.tws.sw_nanos)
  114. . = ALIGN(512);
  115. *(.text.bfunc.bt)
  116. *(.text.bfunc.sleep)
  117. *(.text.bfunc.process)
  118. *(.text.bfunc.warning)
  119. *(.text.bfunc.vhouse)
  120. *(.text.bfunc*)
  121. *(.text.opus*)
  122. *(.text.ains3*)
  123. *(.rodata.ains3*)
  124. *(.text*)
  125. *(.rodata*)
  126. *(.rela*)
  127. . = ALIGN(512);
  128. } > flash
  129. .bss (NOLOAD):
  130. {
  131. __bss_start = .;
  132. *(.bss*)
  133. *(.sbss*)
  134. *(COMMON)
  135. *(.buf*)
  136. *(.wavres.buf)
  137. *(.anc.*)
  138. *(.anc_buf*)
  139. *(.ble_buf*)
  140. *(.ble_cache*)
  141. __bss_end = .;
  142. } > data
  143. __bss_size = __bss_end - __bss_start;
  144. .stack (NOLOAD) : {
  145. __irq_stack_start = .;
  146. . = 0x400;
  147. __irq_stack = .;
  148. } > stack
  149. __irq_stack_size = __irq_stack - __irq_stack_start;
  150. .aram_fcc __aram_vma (NOLOAD) : {
  151. . = 0x3350;
  152. *(.fcc_buf)
  153. } > aram
  154. /* 复用硬件DNN降噪的ram */
  155. .ains3_ram __aram_vma (NOLOAD) : {
  156. . = 0x5830;
  157. *(.ains3_buf.*)
  158. . = 0x6990;
  159. } > aram
  160. /* fcc huart使用buf, 复用mrom buff*/
  161. .cram_fcc __cram_vma (NOLOAD) : {
  162. *(.huart_buf)
  163. } > cram
  164. /* 进入快测模式后使用的buf*/
  165. .cram_qtest __cram_vma (NOLOAD) : {
  166. *(.qtest_buf)
  167. } > cram
  168. nram_opus __nram_vma (NOLOAD) : {
  169. *(.siri*)
  170. *(.opus_buf.buf)
  171. *(.att_siri.buf)
  172. *(.mavsco_buf)
  173. . = 0x1714;
  174. . = 0x1800;
  175. } > nram
  176. nram_dbb __nram_vma (NOLOAD) : {
  177. *(.codecs_buf.pcm)
  178. *(.codecs_pcm*)
  179. . = 0x1400;
  180. } > nram
  181. .dram_opus __dram_vma (NOLOAD) : {
  182. *(.opus_buf*)
  183. . = 0x4500;
  184. } > dram
  185. }
  186. /* Calc the lma */
  187. __comm_lma = LOADADDR(.comm);
  188. __comm_size = SIZEOF(.comm);
  189. __bcomm_lma = LOADADDR(.bcomm);
  190. __bcomm_size = SIZEOF(.bcomm);
  191. __acomm_lma = LOADADDR(.acomm);
  192. __acomm_size = SIZEOF(.acomm);
  193. __sleep_comm_lma = LOADADDR(.sleep_comm);
  194. __sleep_comm_size = SIZEOF(.sleep_comm);
  195. __pwrdwn_comm_lma = LOADADDR(.pwrdwn_comm);
  196. __pwrdwn_comm_size = SIZEOF(.pwrdwn_comm);
  197. __raminit_lma = LOADADDR(.raminit);
  198. __raminit_size = SIZEOF(.raminit);
  199. __dbb_comm_lma = LOADADDR(.dbb_comm);
  200. __dbb_comm_size = SIZEOF(.dbb_comm);