link.sct 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m7
  2. ; The first line specifies a preprocessor command that the linker invokes
  3. ; to pass a scatter file through a C preprocessor.
  4. ;*******************************************************************************
  5. ;* \file xmc7200_x8384_cm7.sct
  6. ;* \version 1.0
  7. ;*
  8. ;* Linker file for the ARMCC.
  9. ;*
  10. ;* The main purpose of the linker script is to describe how the sections in the
  11. ;* input files should be mapped into the output file, and to control the memory
  12. ;* layout of the output file.
  13. ;*
  14. ;* \note The entry point location is fixed and starts at 0x10000000. The valid
  15. ;* application image should be placed there.
  16. ;*
  17. ;* \note The linker files included with the PDL template projects must be
  18. ;* generic and handle all common use cases. Your project may not use every
  19. ;* section defined in the linker files. In that case you may see the warnings
  20. ;* during the build process: L6314W (no section matches pattern) and/or L6329W
  21. ;* (pattern only matches removed unused sections). In your project, you can
  22. ;* suppress the warning by passing the "--diag_suppress=L6314W,L6329W" option to
  23. ;* the linker, simply comment out or remove the relevant code in the linker
  24. ;* file.
  25. ;*
  26. ;*******************************************************************************
  27. ;* \copyright
  28. ;* Copyright 2016-2021 Cypress Semiconductor Corporation
  29. ;* SPDX-License-Identifier: Apache-2.0
  30. ;*
  31. ;* Licensed under the Apache License, Version 2.0 (the "License");
  32. ;* you may not use this file except in compliance with the License.
  33. ;* You may obtain a copy of the License at
  34. ;*
  35. ;* http://www.apache.org/licenses/LICENSE-2.0
  36. ;*
  37. ;* Unless required by applicable law or agreed to in writing, software
  38. ;* distributed under the License is distributed on an "AS IS" BASIS,
  39. ;* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  40. ;* See the License for the specific language governing permissions and
  41. ;* limitations under the License.
  42. ;******************************************************************************/
  43. ; The defines below describe the location and size of blocks of memory in the target.
  44. ; Use these defines to specify the memory regions available for allocation.
  45. ; The following defines control RAM and flash memory allocation for the CM0+ core.
  46. ; You can change the memory allocation by editing the RAM and Flash defines.
  47. ; Your changes must be aligned with the corresponding defines for the CM7 core in 'xxx_cm7.sct',
  48. ; where 'xx' is the device group; for example, 'xmc7200d_x8384_cm7.sct'.
  49. ; RAM
  50. #define SRAM_TOTAL_SIZE 0x00100000 /* 1024K : SRAM0 + SRAM1 */
  51. ; FLASH
  52. #define CODE_FLASH_TOTAL_SIZE 0x00830000 /* 8384K : TOTAL FLASH SIZE */
  53. #define SRAM_START_RESERVE 0
  54. #define SRAM_PRIVATE_FOR_SROM 0x800 /* 2K Private SRAM for SROM (e.g. API processing). Reserved at the beginning */
  55. #define STACK_SIZE 0x1000
  56. #define RAMVECTORS_ALIGNMENT 128
  57. ; RAM
  58. #define SRAM_BASE_ADDRESS 0x28000000 /* SRAM START */
  59. #define CM0PLUS_SRAM_RESERVE 0x00004000 /* 16K : cm0 sram size */
  60. #define CM7_0_SRAM_RESERVE 0x000FC000 /* 1008K: cm7_0 sram size */
  61. ; FLASH
  62. #define CODE_FLASH_BASE_ADDRESS 0x10000000 /* FLASH START */
  63. #define CM0PLUS_CODE_FLASH_RESERVE 0x00080000 /* 512K : cm0 flash size */
  64. #define CM7_0_CODE_FLASH_RESERVE 0x007B0000 /* 7872K: cm7_0 flash size */
  65. ; SRAM reservations
  66. #define BASE_SRAM_CM0P SRAM_BASE_ADDRESS + SRAM_START_RESERVE + SRAM_PRIVATE_FOR_SROM
  67. #define SIZE_SRAM_CM0P CM0PLUS_SRAM_RESERVE - SRAM_START_RESERVE - SRAM_PRIVATE_FOR_SROM
  68. #define BASE_SRAM_CM7_0 SRAM_BASE_ADDRESS + CM0PLUS_SRAM_RESERVE
  69. #define SIZE_SRAM_CM7_0 CM7_0_SRAM_RESERVE
  70. ; Code flash reservations
  71. #define BASE_CODE_FLASH_CM0P CODE_FLASH_BASE_ADDRESS
  72. #define SIZE_CODE_FLASH_CM0P CM0PLUS_CODE_FLASH_RESERVE
  73. #define BASE_CODE_FLASH_CM7_0 CODE_FLASH_BASE_ADDRESS + CM0PLUS_CODE_FLASH_RESERVE
  74. #define SIZE_CODE_FLASH_CM7_0 CM7_0_CODE_FLASH_RESERVE
  75. #define BASE_SRAM BASE_SRAM_CM7_0
  76. #define SIZE_SRAM SIZE_SRAM_CM7_0
  77. #define BASE_CODE_FLASH BASE_CODE_FLASH_CM7_0
  78. #define SIZE_CODE_FLASH SIZE_CODE_FLASH_CM7_0
  79. ; Cortex-M0+ application flash image area
  80. LR_IROM BASE_CODE_FLASH_CM0P SIZE_CODE_FLASH_CM0P
  81. {
  82. .cy_m0p_image +0
  83. {
  84. * (.cy_m0p_image)
  85. }
  86. }
  87. ; Cortex-M7 application flash area
  88. LR_IROM1 BASE_CODE_FLASH SIZE_CODE_FLASH
  89. {
  90. ER_FLASH_VECTORS +0
  91. {
  92. * (RESET, +FIRST)
  93. }
  94. ER_FLASH_CODE +0 FIXED
  95. {
  96. * (InRoot$$Sections)
  97. * (+RO)
  98. }
  99. ER_RAM_VECTORS BASE_SRAM UNINIT
  100. {
  101. * (.bss.noinit.RESET_RAM, +FIRST)
  102. }
  103. RW_RAM_DATA +0
  104. {
  105. * (+RW, +ZI)
  106. }
  107. RW_RAM_SHARED_DATA +0 ALIGN 32
  108. {
  109. * (.cy_sharedmem)
  110. }
  111. ; Place variables in the section that should not be initialized during the
  112. ; device startup.
  113. RW_IRAM1 +0 UNINIT
  114. {
  115. * (.noinit)
  116. * (.bss.noinit)
  117. }
  118. ; Application heap area (HEAP)
  119. ARM_LIB_HEAP +0 EMPTY BASE_SRAM+SIZE_SRAM-STACK_SIZE-AlignExpr(ImageLimit(RW_IRAM1), 8)
  120. {
  121. }
  122. ; Stack region growing down
  123. ARM_LIB_STACK (BASE_SRAM+SIZE_SRAM) EMPTY -STACK_SIZE
  124. {
  125. }
  126. }