|
| 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 | + |
| 39 | + <!-- External SRAM --> |
| 40 | + <Set Name="Heap_BaseAddress" Value="%EXTRAM_BaseAddress%"/> |
| 41 | + |
| 42 | + <!-- External NOR FLASH --> |
| 43 | + <!-- Configuration section is at base of external NOR flash |
| 44 | + This needs to be in the same block storage device as the |
| 45 | + deployment region to enable the MFDeploy to access it. |
| 46 | + ( Due to device side library implementation limit ) |
| 47 | + --> |
| 48 | + <Set Name="Config_BaseAddress" Value="%NOR_BaseAddress%"/> |
| 49 | + <Set Name="Config_Size" Value="0x00010000"/><!-- 64KB --> |
| 50 | + |
| 51 | + <!-- DAT region goes into external NOR Flash --> |
| 52 | + <Set Name="Data_BaseAddress" Value="%Config_BaseAddress% + %Config_Size%"/> |
| 53 | + <Set Name="Data_Size" Value="0x00020000"/><!-- 128KB --> |
| 54 | + <!-- Deployment fills the rest of external NOR flash... --> |
| 55 | + |
| 56 | + <!-- Internal FLASH --> |
| 57 | + <!-- TinyBooter sits at power on Reset vector--> |
| 58 | + <Set Name="BooterCode_BaseAddress" Value="%IFLASH_BaseAddress%"/> |
| 59 | + <Set Name="BooterCode_Size" Value="0x00010000"/><!-- 64KB --> |
| 60 | + |
| 61 | + <If Name="TARGETLOCATION" Value="FLASH"> |
| 62 | + <!-- Internal FLASH --> |
| 63 | + |
| 64 | + <!-- Native Code section --> |
| 65 | + <Set Name="Code_BaseAddress" Value="%BooterCode_BaseAddress%"/> |
| 66 | + <Set Name="Code_Size" Value="%BooterCode_Size%"/> |
| 67 | + |
| 68 | + <!-- =========================================================== --> |
| 69 | + <If Name="TARGETTYPE" Value="Release"> |
| 70 | + <!-- ALL of external RAM is enabled for the CLR HEAP --> |
| 71 | + <Set Name="Heap_Size" Value="0x00080000"/><!-- 512K --> |
| 72 | + <Set Name="CustomHeap_Size" Value="0x00080000"/><!-- 512K --> |
| 73 | + |
| 74 | + <Set Name="Valid" Value="true"/> |
| 75 | + </If> |
| 76 | + <If Name="TARGETTYPE" Value="Debug"> |
| 77 | + <!-- Use only 1MB of external RAM for Debug builds. |
| 78 | + Can't use all of external RAM as the address pins overlap |
| 79 | + with the SWD pins used for ETM tracing in Debug builds. |
| 80 | + --> |
| 81 | + <Set Name="Heap_Size" Value="0x00100000"/><!--1MB--> |
| 82 | + <Set Name="CustomHeap_Size" Value="0x00100000"/><!--1MB--> |
| 83 | + |
| 84 | + <Set Name="Valid" Value="true"/> |
| 85 | + </If> |
| 86 | + </If> |
| 87 | + |
| 88 | + <!-- ################################################################################ --> |
| 89 | + |
| 90 | + <If Name="Valid" Value="false"> |
| 91 | + <Error Message="Configuration not recognized"/> |
| 92 | + </If> |
| 93 | + |
| 94 | + <LoadRegion Name="LR_%TARGETLOCATION%" Base="%Code_BaseAddress%" Options="ABSOLUTE" Size="%Code_Size%"> |
| 95 | + |
| 96 | + <!-- ========= INTERNAL FLASH ============================================ --> |
| 97 | + <ExecRegion Name="ER_%TARGETLOCATION%" Base="%Code_BaseAddress%" Options="FIXED" Size=""> |
| 98 | + <FileMapping Name="*" Options="(SectionForPowerOnReset, +FIRST)" /> |
| 99 | + <FileMapping Name="*" Options="(SectionForBootstrapOperations)" /> |
| 100 | + <FileMapping Name="*" Options="(+RO-CODE)" /> |
| 101 | + <FileMapping Name="*" Options="(+RO-DATA)" /> |
| 102 | + </ExecRegion> |
| 103 | + |
| 104 | + <!-- ========= INTERNAL RAM ============================================= --> |
| 105 | + <!-- Writeable Vector table --> |
| 106 | + <!-- NOTE: |
| 107 | + Despite what you might hope for, this CANNOT go into the CCM area as the NVIC does not |
| 108 | + have access to that space (it sees the AHB layer and below, rather than the core's D-Bus) |
| 109 | + --> |
| 110 | + <!-- Alignment for the vector table is important to allow the NVIC to decode the proper locations |
| 111 | + (See Section 4.4.4 of the ARM Cortex-M4 Generic User Guide [ ARM DUI 0553A (ID121610) ] ) |
| 112 | + Since this starts the SRAM block, it's aligned just fine for any size table. |
| 113 | + --> |
| 114 | + <ExecRegion Name="ER_RAM_RW" Base="%IRAM_BaseAddress%" Options="ABSOLUTE" Size=""> |
| 115 | + <FileMapping Name="*" Options="(VectorTable)"/> |
| 116 | + <FileMapping Name="*" Options="(+RW-DATA, +ZI)" /> |
| 117 | + </ExecRegion> |
| 118 | + |
| 119 | + <ExecRegion Name="ER_RAM_RO" Base="+0" Options="ABSOLUTE" Size=""> |
| 120 | + <!-- Flash programming from Flash is safe on STM32 --> |
| 121 | + <!-- No need to place Flash programming code in RAM --> |
| 122 | + <!-- <FileMapping Name="*" Options="(SectionForFlashOperations)" /> --> |
| 123 | + </ExecRegion> |
| 124 | + |
| 125 | + <!-- ========= EXTERNAL RAM ============================================= --> |
| 126 | + <ExecRegion Name="ER_HEAP_BEGIN" Base="%Heap_BaseAddress%" Options="ABSOLUTE UNINIT" Size=""> |
| 127 | + <FileMapping Name="*" Options="(SectionForHeapBegin)" /> |
| 128 | + </ExecRegion> |
| 129 | + |
| 130 | + <!-- everything between heapbegin and heapend will be allocated for a heap --> |
| 131 | + |
| 132 | + <ExecRegion Name="ER_HEAP_END" Base="+%Heap_Size%" Options="ABSOLUTE UNINIT" Size=""> |
| 133 | + <FileMapping Name="*" Options="(SectionForHeapEnd)" /> |
| 134 | + </ExecRegion> |
| 135 | + |
| 136 | + <ExecRegion Name="ER_CUSTOM_HEAP_BEGIN" Base="+0" Options="ABSOLUTE UNINIT" Size=""> |
| 137 | + <FileMapping Name="*" Options="(SectionForCustomHeapBegin)" /> |
| 138 | + </ExecRegion> |
| 139 | + |
| 140 | + <!-- everything between heapbegin and heapend will be allocated for the unmanaged SimpleHeap --> |
| 141 | + |
| 142 | + <ExecRegion Name="ER_CUSTOM_HEAP_END" Base="+%CustomHeap_Size%" Options="ABSOLUTE UNINIT" Size=""> |
| 143 | + <FileMapping Name="*" Options="(SectionForCustomHeapEnd)" /> |
| 144 | + </ExecRegion> |
| 145 | + |
| 146 | + <!-- ========= Internal CCM ============================================ --> |
| 147 | + <ExecRegion Name="ER_STACK_BOTTOM" Base="%Stack_Bottom%" Options="ABSOLUTE UNINIT" Size=""> |
| 148 | + <FileMapping Name="*" Options="(SectionForStackBottom)" /> |
| 149 | + </ExecRegion> |
| 150 | + |
| 151 | + <!-- -8 for the two 32bit values in the SectionForStack* sections, This keeps the region |
| 152 | + limit from exceeding the size of physical memory. |
| 153 | + --> |
| 154 | + <ExecRegion Name="ER_STACK_TOP" Base="AlignExpr(+%CCM_Size% -8, 8 )" Options="ABSOLUTE UNINIT" Size=""> |
| 155 | + <FileMapping Name="*" Options="(SectionForStackTop +LAST)" /> |
| 156 | + </ExecRegion> |
| 157 | + </LoadRegion> |
| 158 | +</ScatterFile> |
0 commit comments