summaryrefslogtreecommitdiff
path: root/bsp/mm32f526x/drivers/linker_scripts/link.sct
blob: 59105a680373c40d817e430a71b6b7b8fda28fc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************

#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m33 -xc
; command above MUST be in first line (no comment above!)

/*
;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
*/

/*--------------------- Flash Configuration ----------------------------------
; <h> Flash Configuration
;   <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
;   <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
 *----------------------------------------------------------------------------*/
#define __ROM_BASE     0x008000000
#define __ROM_SIZE     0x000040000

/*---------------------------- ITCM Configuration -----------------------------
; <h> ITCM Configuration
;   <o0> ITCM Base Address    <0x0-0xFFFFFFFF:8>
;   <o1> ITCM Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
 *----------------------------------------------------------------------------*/
#define __ITCM_BASE     0x00000000
#define __ITCM_SIZE     0x00008000

/*---------------------------- DTCM Configuration -----------------------------
; <h> DTCM Configuration
;   <o0> DTCM Base Address    <0x0-0xFFFFFFFF:8>
;   <o1> DTCM Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
 *----------------------------------------------------------------------------*/
#define __DTCM_BASE     0x20000000
#define __DTCM_SIZE     0x00008000

/*--------------------- Embedded RAM1 Configuration ---------------------------
; <h> RAM Configuration
;   <o0> RAM1 Base Address    <0x0-0xFFFFFFFF:8>
;   <o1> RAM1 Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
 *----------------------------------------------------------------------------*/
#define __RAM1_BASE     0x30000000
#define __RAM1_SIZE     0x0001C000

/*--------------------- Embedded RAM2 Configuration ---------------------------
; <h> RAM Configuration
;   <o0> RAM2 Base Address    <0x0-0xFFFFFFFF:8>
;   <o1> RAM2 Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
 *----------------------------------------------------------------------------*/
#define __RAM2_BASE     0x3001C000
#define __RAM2_SIZE     0x00004000


/*--------------------- Stack / Heap Configuration ---------------------------
; <h> Stack / Heap Configuration
;   <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
;   <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
 *----------------------------------------------------------------------------*/
#define __STACK_SIZE       0x00000800
#define __HEAP_SIZE        0x00000C00


/*----------------------------------------------------------------------------
  User Stack & Heap boundary definition
 *----------------------------------------------------------------------------*/
#define __STACK_TOP        (__RAM1_BASE + __RAM1_SIZE)    /* starts at end of RAM */
#define __HEAP_BASE        (AlignExpr(+0, 8))             /* starts after RW_RAM section, 8 byte aligned */


/*----------------------------------------------------------------------------
  Scatter File Definitions definition
 *----------------------------------------------------------------------------*/
#define __RO_BASE         __ROM_BASE
#define __RO_SIZE         __ROM_SIZE

LR_ROM __RO_BASE __RO_SIZE  {                       ; load region size_region
  ER_ROM __RO_BASE __RO_SIZE  {                     ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
;   *(Veneer$$CMSE)                                 ; uncomment for secure applications
   .ANY (+RO)
   .ANY (+XO)
  }

  RW_ITCM __ITCM_BASE __ITCM_SIZE  {                ; RW data
   .ANY (+RW +ZI)
  }

  RW_DTCM __DTCM_BASE __DTCM_SIZE  {                ; RW data
   .ANY (+RW +ZI)
  }

  RW_RAM1 __RAM1_BASE (__RAM1_SIZE - __STACK_SIZE - __HEAP_SIZE)  {                     ; RW data
   .ANY (+RW +ZI)
  }

  RW_RAM2 __RAM2_BASE __RAM2_SIZE  {                ; RW data
   .ANY (+RW +ZI)
  }

#if __HEAP_SIZE > 0
  ARM_LIB_HEAP  __HEAP_BASE EMPTY  __HEAP_SIZE  {   ; Reserve empty region for heap
  }
#endif

  ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE {   ; Reserve empty region for stack
  }
}