STM32F746xG.ld 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /*
  14. * ST32F746xG generic setup.
  15. *
  16. * RAM0 - Data, Heap.
  17. * RAM3 - Main Stack, Process Stack, BSS, NOCACHE, ETH.
  18. *
  19. * Notes:
  20. * BSS is placed in DTCM RAM in order to simplify DMA buffers management.
  21. */
  22. MEMORY
  23. {
  24. flash0 : org = 0x08000000, len = 1M /* Flash as AXIM (writable) */
  25. flash1 : org = 0x00200000, len = 1M /* Flash as ITCM */
  26. flash2 : org = 0x00000000, len = 0
  27. flash3 : org = 0x00000000, len = 0
  28. flash4 : org = 0x00000000, len = 0
  29. flash5 : org = 0x00000000, len = 0
  30. flash6 : org = 0x00000000, len = 0
  31. flash7 : org = 0x00000000, len = 0
  32. ram0 : org = 0x20010000, len = 256k /* SRAM1 + SRAM2 */
  33. ram1 : org = 0x20010000, len = 240k /* SRAM1 */
  34. ram2 : org = 0x2004C000, len = 16k /* SRAM2 */
  35. ram3 : org = 0x20000000, len = 64k /* DTCM-RAM */
  36. ram4 : org = 0x00000000, len = 16k /* ITCM-RAM */
  37. ram5 : org = 0x40024000, len = 4k /* BCKP SRAM */
  38. ram6 : org = 0x00000000, len = 0
  39. ram7 : org = 0x00000000, len = 0
  40. }
  41. /* For each data/text section two region are defined, a virtual region
  42. and a load region (_LMA suffix).*/
  43. /* Flash region to be used for exception vectors.*/
  44. REGION_ALIAS("VECTORS_FLASH", flash1);
  45. REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
  46. /* Flash region to be used for constructors and destructors.*/
  47. REGION_ALIAS("XTORS_FLASH", flash1);
  48. REGION_ALIAS("XTORS_FLASH_LMA", flash0);
  49. /* Flash region to be used for code text.*/
  50. REGION_ALIAS("TEXT_FLASH", flash1);
  51. REGION_ALIAS("TEXT_FLASH_LMA", flash0);
  52. /* Flash region to be used for read only data.*/
  53. REGION_ALIAS("RODATA_FLASH", flash0);
  54. REGION_ALIAS("RODATA_FLASH_LMA", flash0);
  55. /* Flash region to be used for various.*/
  56. REGION_ALIAS("VARIOUS_FLASH", flash1);
  57. REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
  58. /* Flash region to be used for RAM(n) initialization data.*/
  59. REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
  60. /* RAM region to be used for Main stack. This stack accommodates the processing
  61. of all exceptions and interrupts.*/
  62. REGION_ALIAS("MAIN_STACK_RAM", ram3);
  63. /* RAM region to be used for the process stack. This is the stack used by
  64. the main() function.*/
  65. REGION_ALIAS("PROCESS_STACK_RAM", ram3);
  66. /* RAM region to be used for data segment.*/
  67. REGION_ALIAS("DATA_RAM", ram0);
  68. REGION_ALIAS("DATA_RAM_LMA", flash0);
  69. /* RAM region to be used for BSS segment.*/
  70. REGION_ALIAS("BSS_RAM", ram3);
  71. /* RAM region to be used for the default heap.*/
  72. REGION_ALIAS("HEAP_RAM", ram0);
  73. /* Stack rules inclusion.*/
  74. INCLUDE rules_stacks.ld
  75. /*===========================================================================*/
  76. /* Custom sections for STM32F7xx. */
  77. /*===========================================================================*/
  78. /* RAM region to be used for nocache segment.*/
  79. REGION_ALIAS("NOCACHE_RAM", ram3);
  80. /* RAM region to be used for eth segment.*/
  81. REGION_ALIAS("ETH_RAM", ram3);
  82. SECTIONS
  83. {
  84. /* Special section for non cache-able areas.*/
  85. .nocache (NOLOAD) : ALIGN(4)
  86. {
  87. __nocache_base__ = .;
  88. *(.nocache)
  89. *(.nocache.*)
  90. *(.bss.__nocache_*)
  91. . = ALIGN(4);
  92. __nocache_end__ = .;
  93. } > NOCACHE_RAM
  94. /* Special section for Ethernet DMA non cache-able areas.*/
  95. .eth (NOLOAD) : ALIGN(4)
  96. {
  97. __eth_base__ = .;
  98. *(.eth)
  99. *(.eth.*)
  100. *(.bss.__eth_*)
  101. . = ALIGN(4);
  102. __eth_end__ = .;
  103. } > ETH_RAM
  104. }
  105. /* Code rules inclusion.*/
  106. INCLUDE rules_code.ld
  107. /* Data rules inclusion.*/
  108. INCLUDE rules_data.ld
  109. /* Memory rules inclusion.*/
  110. INCLUDE rules_memory.ld