Cm3RealView.scat 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. #! armcc -E
  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 Name: Cm3RealView.scat
  6. ;* Version 4.0
  7. ;*
  8. ;* Description:
  9. ;* This Linker Descriptor file describes the memory layout of the PSoC5
  10. ;* device. The memory layout of the final binary and hex images as well as
  11. ;* the placement in PSoC5 memory is described.
  12. ;*
  13. ;*
  14. ;* Note:
  15. ;*
  16. ;* romvectors: Cypress default Interrupt sevice routine vector table.
  17. ;*
  18. ;* This is the ISR vector table at bootup. Used only for the reset vector.
  19. ;*
  20. ;*
  21. ;* ramvectors: Cypress ram interrupt service routine vector table.
  22. ;*
  23. ;* This is the ISR vector table used by the application.
  24. ;*
  25. ;*
  26. ;********************************************************************************
  27. ;* Copyright 2008-2013, Cypress Semiconductor Corporation. All rights reserved.
  28. ;* You may use this file only in accordance with the license, terms, conditions,
  29. ;* disclaimers, and limitations in the end user license agreement accompanying
  30. ;* the software package with which this file was provided.
  31. ;********************************************************************************/
  32. #include "cyfitter.h"
  33. #define CY_FLASH_SIZE 131072
  34. #define CY_APPL_ORIGIN 0
  35. #define CY_FLASH_ROW_SIZE 256
  36. #define CY_ECC_ROW_SIZE 32
  37. #define CY_EE_SIZE 2048
  38. #define CY_METADATA_SIZE 64
  39. ; Define application base address
  40. #if (CYDEV_PROJ_TYPE == CYDEV_PROJ_TYPE_LOADABLE)
  41. #define CY_APPL_NUM 1
  42. #define CY_APPL_MAX 1
  43. #define CY_EE_IN_BTLDR 0
  44. #if CY_APPL_ORIGIN
  45. #define APPL1_START CY_APPL_ORIGIN
  46. #else
  47. #define APPL1_START AlignExpr(ImageLimit(CYBOOTLOADER), CY_FLASH_ROW_SIZE)
  48. #endif
  49. #define APPL_START (APPL1_START + AlignExpr(((CY_FLASH_SIZE - APPL1_START - 2 * CY_FLASH_ROW_SIZE) / 2 ) * (CY_APPL_NUM - 1), CY_FLASH_ROW_SIZE))
  50. #define ECC_OFFSET ((APPL_START / CY_FLASH_ROW_SIZE) * CY_ECC_ROW_SIZE)
  51. #define EE_OFFSET (CY_EE_IN_BTLDR ? 0 : (CY_EE_SIZE / CY_APPL_MAX) * (CY_APPL_NUM - 1))
  52. #define EE_SIZE (CY_EE_IN_BTLDR ? CY_EE_SIZE : (CY_EE_SIZE / CY_APPL_MAX))
  53. #else
  54. #define APPL_START 0
  55. #define ECC_OFFSET 0
  56. #define EE_OFFSET 0
  57. #define EE_SIZE CY_EE_SIZE
  58. #endif
  59. ; Place Bootloader at the beginning of Flash
  60. #if (CYDEV_PROJ_TYPE == CYDEV_PROJ_TYPE_LOADABLE)
  61. CYBOOTLOADER 0
  62. {
  63. .cybootloader +0
  64. {
  65. * (.cybootloader)
  66. }
  67. }
  68. #if CY_APPL_ORIGIN
  69. ScatterAssert(APPL_START > LoadLimit(CYBOOTLOADER))
  70. #endif
  71. #endif
  72. APPLICATION APPL_START (CY_FLASH_SIZE - APPL_START)
  73. {
  74. VECTORS +0
  75. {
  76. * (.romvectors)
  77. }
  78. CODE +0
  79. {
  80. * (+RO)
  81. }
  82. ISRVECTORS (0x20000000 - (32768 / 2)) UNINIT
  83. {
  84. * (.ramvectors)
  85. }
  86. NOINIT_DATA +0 UNINIT
  87. {
  88. * (.noinit)
  89. }
  90. DATA +0
  91. {
  92. .ANY (+RW, +ZI)
  93. }
  94. ARM_LIB_HEAP (0x20000000 + (32768 / 2) - 0x0256 - 0x2000) EMPTY 0x0256
  95. {
  96. }
  97. ARM_LIB_STACK (0x20000000 + (32768 / 2)) EMPTY -0x2000
  98. {
  99. }
  100. }
  101. #if (CYDEV_PROJ_TYPE == CYDEV_PROJ_TYPE_BOOTLOADER || CYDEV_PROJ_TYPE == CYDEV_PROJ_TYPE_MULTIAPPBOOTLOADER)
  102. CYLOADERMETA (CY_FLASH_SIZE - CY_METADATA_SIZE)
  103. {
  104. .cyloadermeta +0 { * (.cyloadermeta) }
  105. }
  106. #else
  107. #if (CYDEV_PROJ_TYPE == CYDEV_PROJ_TYPE_LOADABLE)
  108. CYLOADABLEMETA (CY_FLASH_SIZE - CY_FLASH_ROW_SIZE * (CY_APPL_NUM - 1) - CY_METADATA_SIZE)
  109. {
  110. .cyloadablemeta +0 { * (.cyloadablemeta) }
  111. }
  112. #endif
  113. #endif
  114. #if (CYDEV_ECC_ENABLE == 0)
  115. CYCONFIGECC (0x80000000 + ECC_OFFSET)
  116. {
  117. .cyconfigecc +0 { * (.cyconfigecc) }
  118. }
  119. #endif
  120. CYCUSTNVL 0x90000000
  121. {
  122. .cycustnvl +0 { * (.cycustnvl) }
  123. }
  124. CYWOLATCH 0x90100000
  125. {
  126. .cywolatch +0 { * (.cywolatch) }
  127. }
  128. #if defined(CYDEV_ALLOCATE_EEPROM)
  129. CYEEPROM 0x90200000 + EE_OFFSET (EE_SIZE)
  130. {
  131. .cyeeprom +0 { * (.cyeeprom) }
  132. }
  133. #endif
  134. CYFLASHPROTECT 0x90400000
  135. {
  136. .cyflashprotect +0 { * (.cyflashprotect) }
  137. }
  138. CYMETA 0x90500000
  139. {
  140. .cymeta +0 { * (.cymeta) }
  141. }
  142. #if (CYDEV_PROJ_TYPE == CYDEV_PROJ_TYPE_LOADABLE)
  143. CYLOADERMETA +0
  144. {
  145. .cyloadermeta +0 { * (.cyloadermeta) }
  146. }
  147. #endif