|
| 1 | +<?xml version="1.0"?> |
| 2 | +<ScatterFile xmlns="http://schemas.microsoft.com/netmf/ScatterfileSchema.xsd"> |
| 3 | + |
| 4 | + <!-- STM32F4 with 1M Flash, 128k SRAM, and 64k DATA CCM --> |
| 5 | + |
| 6 | + <Set Name="Valid" Value="false"/> |
| 7 | + |
| 8 | + <!-- ################################################################################ --> |
| 9 | + |
| 10 | + <!-- Memory Region base and size values for physical hardware to help clarify the mapping |
| 11 | + by making Symbolic names available instead of a bunch of numbers. These values are |
| 12 | + fixed in hardware and therefore, don't change. |
| 13 | + --> |
| 14 | + <!-- Internal FLASH --> |
| 15 | + <Set Name="IFLASH_BaseAddress" Value="0x08000000"/> |
| 16 | + <Set Name="IFLASH_Size" Value="0x00100000"/><!-- 1MB --> |
| 17 | + |
| 18 | + <!-- Core Coupled Memory (CCM) [D-Bus] --> |
| 19 | + <Set Name="CCM_BaseAddress" Value="0x10000000"/> |
| 20 | + <Set Name="CCM_Size" Value="0x00010000"/><!-- 64KB --> |
| 21 | + |
| 22 | + <!-- Internal SRAM --> |
| 23 | + <Set Name="IRAM_BaseAddress" Value="0x20000000"/> |
| 24 | + <Set Name="IRAM_Size" Value="0x00020000"/><!-- 128KB --> |
| 25 | + |
| 26 | + <!-- External NOR Flash--> |
| 27 | + <Set Name="NOR_BaseAddress" Value="0x60000000"/> |
| 28 | + <Set Name="NOR_Size" Value="0x00800000"/><!-- 8MB --> |
| 29 | + |
| 30 | + <!-- External SRAM --> |
| 31 | + <Set Name="EXTRAM_BaseAddress" Value="0x68000000"/> |
| 32 | + <Set Name="EXTRAM_Size" Value="0x00200000"/><!-- 2MB --> |
| 33 | + |
| 34 | + <!-- Solution specific usage settings --> |
| 35 | + <!-- Internal CCM (D-Bus) --> |
| 36 | + <!-- Put Stack in CCM for high speed access, reducing overhead of stack usage --> |
| 37 | + <Set Name="Stack_Bottom" Value="%CCM_BaseAddress%"/> |
| 38 | + <Set Name="Stack_Size" Value="%CCM_Size%" /> |
| 39 | + |
| 40 | + <!-- External SRAM --> |
| 41 | + <Set Name="Heap_BaseAddress" Value="%EXTRAM_BaseAddress%"/> |
| 42 | + |
| 43 | + <!-- External NOR FLASH --> |
| 44 | + <!-- Configuration section is at base of external NOR flash |
| 45 | + This needs to be in the same block storage device as the |
| 46 | + deployment region to enable the MFDeploy to access it. |
| 47 | + ( Due to device side library implementation limitation ) |
| 48 | + --> |
| 49 | + <Set Name="Config_BaseAddress" Value="%NOR_BaseAddress%"/> |
| 50 | + <Set Name="Config_Size" Value="0x00010000"/><!-- 64KB --> |
| 51 | + |
| 52 | + <!-- DAT region goes into external NOR Flash --> |
| 53 | + <Set Name="Data_BaseAddress" Value="%Config_BaseAddress% + %Config_Size%"/> |
| 54 | + <Set Name="Data_Size" Value="0x00020000"/><!-- 128KB --> |
| 55 | + |
| 56 | + <!-- [Deployment fills the rest of external NOR flash...] --> |
| 57 | + |
| 58 | + <!-- Internal FLASH --> |
| 59 | + <!-- TinyBooter sits at power on Reset vector --> |
| 60 | + <Set Name="BooterCode_BaseAddress" Value="%IFLASH_BaseAddress%"/> |
| 61 | + <Set Name="BooterCode_Size" Value="0x00010000"/><!-- 64KB --> |
| 62 | + |
| 63 | + <If Name="TARGETLOCATION" Value="FLASH"> |
| 64 | + <!-- Internal FLASH --> |
| 65 | + |
| 66 | + <!-- Native Code section --> |
| 67 | + <Set Name="Code_BaseAddress" Value="%BooterCode_BaseAddress% + %BooterCode_Size%"/> |
| 68 | + <Set Name="Code_Size" Value="%IFLASH_Size%-%BooterCode_Size%"/> |
| 69 | + |
| 70 | + <!-- =========================================================== --> |
| 71 | + <If Name="TARGETTYPE" Value="Release"> |
| 72 | + <!-- ALL of external RAM is enabled for the CLR HEAP --> |
| 73 | + <Set Name="Heap_Size" Value="%EXTRAM_Size%"/> |
| 74 | + <Set Name="CustomHeap_Size" Value="0"/> |
| 75 | + |
| 76 | + <Set Name="Valid" Value="true"/> |
| 77 | + </If> |
| 78 | + <If Name="TARGETTYPE" Value="Debug"> |
| 79 | + <!-- Use only 1MB of external RAM for Debug builds. |
| 80 | + Can't use all of external RAM as the address pins overlap |
| 81 | + with the SWD pins used for ETM tracing in Debug builds. |
| 82 | + --> |
| 83 | + <Set Name="Heap_Size" Value="0x00100000"/><!--1MB--> |
| 84 | + <Set Name="CustomHeap_Size" Value="0"/> |
| 85 | + |
| 86 | + <Set Name="Valid" Value="true"/> |
| 87 | + </If> |
| 88 | + </If> |
| 89 | + |
| 90 | + <!-- ################################################################################ --> |
| 91 | + |
| 92 | + <If Name="Valid" Value="false"> |
| 93 | + <Error Message="Configuration not recognized"/> |
| 94 | + </If> |
| 95 | + |
| 96 | + <EntryPoint Name="EntryPoint" /> |
| 97 | + |
| 98 | + <NamedGroup Name="MEMORY"> |
| 99 | + <LoadRegion Name="D_CCM" Base="%CCM_BaseAddress%" Size="%CCM_Size%" /> |
| 100 | + <LoadRegion Name="IRAM" Base="%IRAM_BaseAddress%" Size="%IRAM_Size%" /> |
| 101 | + <LoadRegion Name="LR_%TARGETLOCATION%" Base="%Code_BaseAddress%" Size="%Code_Size%" /> |
| 102 | + <LoadRegion Name="EXTRAM" Base="%EXTRAM_BaseAddress%" Size="%EXTRAM_Size%" /> |
| 103 | + <LoadRegion Name="LR_CONFIG" Base="%Config_BaseAddress%" Size="%Config_Size%"/> |
| 104 | + <LoadRegion Name="LR_DAT" Base="%Data_BaseAddress%" Size="%Data_Size%"/> |
| 105 | + </NamedGroup> |
| 106 | + |
| 107 | + <NamedGroup Name="SECTIONS"> |
| 108 | + <!-- ========= INTERNAL FLASH ============================================ --> |
| 109 | + <ExecRegion Name="ER_%TARGETLOCATION%" Options=">LR_%TARGETLOCATION%"> |
| 110 | + <FileMapping Name="*" Options="(i.EntryPoint)" /> |
| 111 | + <FileMapping Name="*" Options="(SectionForBootstrapOperations)" /> |
| 112 | + <FileMapping Name="*" Options="(SectionForFlashOperations)"/> |
| 113 | + <FileMapping Name="*" Options="(.text*)" /> |
| 114 | + <FileMapping Name="*" Options="(i.*)" /> |
| 115 | + <FileMapping Name="*" Options="(.rodata*)" /> |
| 116 | + <FileMapping Name="*" Options="(rodata)" /> |
| 117 | + <FileMapping Name="*" Options="(.constdata*)" /> |
| 118 | + <FileMapping Name="*" Options="(.conststring*)" /> |
| 119 | + <FileMapping Name="*" Options="(.glue*)" /> |
| 120 | + <Include File="%SPOCLIENT%\Solutions\MCBSTM32F400\scatterfile_gcc_missing_symbols.xml"/> |
| 121 | + </ExecRegion> |
| 122 | + |
| 123 | + <!-- ========= INTERNAL RAM ============================================= --> |
| 124 | + <!-- Writeable Vector table --> |
| 125 | + <!-- NOTE: |
| 126 | + Despite what you might hope for, this CANNOT go into the CCM area as the NVIC does not |
| 127 | + have access to that space (it sees the AHB layer and below, rather than the core's D-Bus) |
| 128 | + --> |
| 129 | + <!-- Alignment for the vector table is important to allow the NVIC to decode the proper locations |
| 130 | + (See Section 4.4.4 of the ARM Cortex-M4 Generic User Guide [ ARM DUI 0553A (ID121610) ] ) |
| 131 | + Since this starts the SRAM block, it's aligned just fine for any size table. |
| 132 | + --> |
| 133 | + <ExecRegion Name="ER_VECTORS" Options=">IRAM"> |
| 134 | + <FileMapping Name="*" Options="(VectorTable)" /> |
| 135 | + </ExecRegion> |
| 136 | + |
| 137 | + <ExecRegion Name="ER_RAM_RW" Align="0x10" Options=">IRAM AT>LR_FLASH "> |
| 138 | + <FileMapping Name="*" Options="(rwdata)" /> |
| 139 | + <FileMapping Name="*" Options="(.data*)" /> |
| 140 | + </ExecRegion> |
| 141 | + |
| 142 | + <ExecRegion Name="ER_RAM_RO" Align="0x10" Options=">IRAM"> |
| 143 | + <!-- Flash programming from Flash is safe on STM32 --> |
| 144 | + <!-- No need to place Flash programming code in RAM --> |
| 145 | + <!-- <FileMapping Name="*" Options="(SectionForFlashOperations)" /> --> |
| 146 | + </ExecRegion> |
| 147 | + |
| 148 | + <ExecRegion Name=".bss" Align="0x10" Base="(NOLOAD)" Options=">IRAM"> |
| 149 | + <FileMapping Name="*" Options="(.bss*)" /> |
| 150 | + <FileMapping Name="*" Options="(.zidata*)" /> |
| 151 | + <FileMapping Name="PROVIDE(__exidx_start = .);" /> |
| 152 | + <FileMapping Name="PROVIDE(__exidx_end = .);" /> |
| 153 | + <FileMapping Name="*" Options="(COMMON)" /> |
| 154 | + </ExecRegion> |
| 155 | + |
| 156 | + <ExecRegion Name="/DISCARD/"> |
| 157 | + <FileMapping Name="*" Options="(.ARM.exidx*)" /> |
| 158 | + <FileMapping Name="*" Options="(.ARM.extab*)" /> |
| 159 | + </ExecRegion> |
| 160 | + |
| 161 | + <!--========= EXTERNAL RAM =============================================--> |
| 162 | + <ExecRegion Name="ER_HEAP_BEGIN" Options=">EXTRAM"> |
| 163 | + <FileMapping Name="*" Options="(SectionForHeapBegin)" /> |
| 164 | + </ExecRegion> |
| 165 | + |
| 166 | + <!-- everything between heapbegin and heapend will be allocated for a heap --> |
| 167 | + |
| 168 | + <ExecRegion Name="ER_HEAP_END" Base="ADDR(ER_HEAP_BEGIN) + %Heap_Size%" Options=">EXTRAM" > |
| 169 | + <FileMapping Name="*" Options="(SectionForHeapEnd)" /> |
| 170 | + </ExecRegion> |
| 171 | + |
| 172 | + <ExecRegion Name="ER_CUSTOM_HEAP_BEGIN" Options=">EXTRAM" > |
| 173 | + <FileMapping Name="*" Options="(SectionForCustomHeapBegin)" /> |
| 174 | + </ExecRegion> |
| 175 | + |
| 176 | + <!-- everything between heapbegin and heapend will be allocated for the unmanaged SimpleHeap --> |
| 177 | + |
| 178 | + <ExecRegion Name="ER_CUSTOM_HEAP_END" Base="ADDR(ER_CUSTOM_HEAP_BEGIN) + %CustomHeap_Size%" Options=">EXTRAM" > |
| 179 | + <FileMapping Name="*" Options="(SectionForCustomHeapEnd)" /> |
| 180 | + </ExecRegion> |
| 181 | + |
| 182 | + <!-- ========= Internal CCM ============================================ --> |
| 183 | + <ExecRegion Name="ER_STACK_BOTTOM" Options=">D_CCM"> |
| 184 | + <FileMapping Name="*" Options="(SectionForStackBottom)" /> |
| 185 | + </ExecRegion> |
| 186 | + |
| 187 | + <!--8 for the two 32bit values in the SectionForStack* sections, This keeps the region |
| 188 | + limit from exceeding the size of physical memory. --> |
| 189 | + <ExecRegion Name="ER_STACK_TOP" Base="%Stack_Bottom% + %Stack_Size% - 8" Options=">D_CCM"> |
| 190 | + <FileMapping Name="*" Options="(SectionForStackTop +LAST)" /> |
| 191 | + </ExecRegion> |
| 192 | + |
| 193 | + <ExecRegion Name="ER_DAT" Options=">LR_DAT"> |
| 194 | + <FileMapping Name="*" Options="(tinyclr_metadata)" /> |
| 195 | + </ExecRegion> |
| 196 | + |
| 197 | + <ExecRegion Name="ER_CONFIG" Options=">LR_CONFIG"> |
| 198 | + <FileMapping Name="*" Options="(SectionForConfig)" /> |
| 199 | + </ExecRegion> |
| 200 | + </NamedGroup> |
| 201 | + |
| 202 | + <!-- The following variables are used to simulate the ones autogenerated by ARMCC --> |
| 203 | + <GlobalVariable Name="Load$$ER_%TARGETLOCATION%$$Base" Value="LOADADDR(ER_%TARGETLOCATION%)"/> |
| 204 | + <GlobalVariable Name="Image$$ER_%TARGETLOCATION%$$Length" Value="SIZEOF(ER_%TARGETLOCATION%)"/> |
| 205 | + <GlobalVariable Name="Image$$ER_RAM_RO$$Base" Value="ADDR(ER_RAM_RO)"/> |
| 206 | + <GlobalVariable Name="Image$$ER_RAM_RO$$Length" Value="SIZEOF(ER_RAM_RO)"/> |
| 207 | + <GlobalVariable Name="Load$$ER_RAM_RO$$Base" Value="LOADADDR(ER_RAM_RO)"/> |
| 208 | + <GlobalVariable Name="Image$$ER_RAM_RW$$Base" Value="ADDR(ER_RAM_RW)"/> |
| 209 | + <GlobalVariable Name="Image$$ER_RAM_RW$$Length" Value="SIZEOF(ER_RAM_RW)"/> |
| 210 | + <GlobalVariable Name="Load$$ER_RAM_RW$$Base" Value="LOADADDR(ER_RAM_RW)"/> |
| 211 | + <GlobalVariable Name="Image$$ER_RAM_RW$$ZI$$Base" Value="ADDR(.bss)"/> |
| 212 | + <GlobalVariable Name="Image$$ER_RAM_RW$$ZI$$Length" Value="SIZEOF(.bss)"/> |
| 213 | + <GlobalVariable Name="__use_no_semihosting_swi" Value="0"/> |
| 214 | +</ScatterFile> |
| 215 | + |
0 commit comments