summaryrefslogtreecommitdiff
path: root/FreeRTOS/Demo/CORTEX_MPU_M33F_Simulator_Keil_GCC/NonSecure/FreeRTOSDemo_ns.sct
blob: 387a8745c504ccf17a3b749d4980c64d69d68c99 (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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m33 -xc
; command above MUST be in first line (no comment above!)

;Note: Add '-mcmse' to first line if your software model is "Secure Mode".
;      #! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m33 -xc -mcmse

; NOTE: ARMv8-M MPU requires that each region must start on a 32 byte aligned
; address and the size of a region must be a multiple of 32 bytes.
;
; Flash Layout
;
;  ---------------------
; |   Privileged Code   |
;  ---------------------
; |    System Calls     |
;  ---------------------
; |  Unprivileged Code  |
;  ---------------------
;
; RAM Layout
;
;  ---------------------
; |   Privileged Data   |
;  ---------------------
; |  Unprivileged Data  |
;  ---------------------

/*
;-------- <<< 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      0x00200000
#define __ROM_SIZE      0x00200000

/*--------------------- Embedded RAM Configuration ---------------------------
; <h> RAM Configuration
;   <o0> RAM Base Address    <0x0-0xFFFFFFFF:8>
;   <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
 *----------------------------------------------------------------------------*/
#define __RAM_BASE      0x20200000
#define __RAM_SIZE      0x00020000

/*--------------------- 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    0x00000200
#define __HEAP_SIZE     0x00000C00

/*
;------------- <<< end of configuration section >>> ---------------------------
*/


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

/* ----------------------------------------------------------------------------
  Stack seal size definition
 *----------------------------------------------------------------------------*/
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
#define __STACKSEAL_SIZE   ( 8 )
#else
#define __STACKSEAL_SIZE   ( 0 )
#endif

LR_APP __ROM_BASE __ROM_SIZE ; load region
{
    ER_IROM_NS_PRIVILEGED +0 ALIGN 32
    {
        *.o(RESET, +First)
        *(InRoot$$Sections) ; All sections that must be in a root region
        *(privileged_functions)
    }

    ER_IROM_NS_PRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0
    {
    }

    ER_IROM_NS_FREERTOS_SYSTEM_CALLS +0 ALIGN 32
    {
        *(freertos_system_calls)
    }

    ER_IROM_NS_FREERTOS_SYSTEM_CALLS_ALIGN +0 ALIGN 32 EMPTY 0x0
    {
    }

    ER_IROM_NS_UNPRIVILEGED +0 ALIGN 32
    {
        *(+RO)
    }

    ER_IROM_NS_UNPRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0
    {
    }

    ER_IRAM_NS_PRIVILEGED __RAM_BASE ALIGN 32
    {
        *(privileged_data)
    }

    ER_IRAM_NS_PRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0
    {
    }

    ER_IRAM_NS_UNPRIVILEGED +0 ALIGN 32
    {
        *(+RW, +ZI)
    }

    ER_IRAM_NS_UNPRIVILEGED_ALIGN +0 ALIGN 32 EMPTY 0x0
    {
    }

#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
	{
	}

#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
	STACKSEAL +0 EMPTY __STACKSEAL_SIZE ; Reserve empty region for stack seal immediately after stack
	{
	}
#endif
}