Skip to content

Commit 3c450f1

Browse files
committed
[EFM32] Update emlib to version 5.0.0 in preparation for new targets
* Updated cmsis headers to match emlib 5.0.0 * Updated GPIO handling to match new header guards in use * Updated linker scripts to match emlib 5.0.0
1 parent c60dacf commit 3c450f1

File tree

571 files changed

+465997
-24385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

571 files changed

+465997
-24385
lines changed

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/TARGET_1024K/TOOLCHAIN_GCC_ARM/efm32gg.ld

Lines changed: 22 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
/* Version 4.2.0 */
1010
/* */
1111

12-
STACK_SIZE = 0x400;
13-
HEAP_SIZE = 0xC00;
14-
1512
MEMORY
1613
{
1714
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1048576
@@ -56,11 +53,6 @@ __vector_size = 0xDC;
5653
*/
5754
ENTRY(Reset_Handler)
5855

59-
/* Note: The uVisor expects the text section at a fixed location, as specified
60-
by the porting process configuration parameter: FLASH_OFFSET. */
61-
__UVISOR_TEXT_OFFSET = 0x100;
62-
__UVISOR_TEXT_START = ORIGIN(FLASH) + __UVISOR_TEXT_OFFSET;
63-
6456
SECTIONS
6557
{
6658
.text :
@@ -70,13 +62,6 @@ SECTIONS
7062
__Vectors_Size = __Vectors_End - __Vectors;
7163
__end__ = .;
7264

73-
/* uVisor code and data */
74-
. = __UVISOR_TEXT_OFFSET;
75-
. = ALIGN(4);
76-
__uvisor_main_start = .;
77-
*(.uvisor.main)
78-
__uvisor_main_end = .;
79-
8065
*(.text*)
8166

8267
KEEP(*(.init))
@@ -147,51 +132,10 @@ SECTIONS
147132
} > FLASH
148133
*/
149134

150-
/* Ensure that the uVisor BSS section is put first in SRAM. */
151-
/* Note: The uVisor expects this section at a fixed location, as specified
152-
by the porting process configuration parameter: SRAM_OFFSET. */
153-
__UVISOR_SRAM_OFFSET = 0x0;
154-
__UVISOR_BSS_START = ORIGIN(RAM) + __UVISOR_SRAM_OFFSET;
155-
.uvisor.bss __UVISOR_BSS_START (NOLOAD):
156-
{
157-
. = ALIGN(32);
158-
__uvisor_bss_start = .;
159-
160-
/* uVisor main BSS section */
161-
. = ALIGN(32);
162-
__uvisor_bss_main_start = .;
163-
KEEP(*(.keep.uvisor.bss.main))
164-
. = ALIGN(32);
165-
__uvisor_bss_main_end = .;
135+
__etext = .;
166136

167-
/* Secure boxes BSS section */
168-
. = ALIGN(32);
169-
__uvisor_bss_boxes_start = .;
170-
KEEP(*(.keep.uvisor.bss.boxes))
171-
. = ALIGN(32);
172-
__uvisor_bss_boxes_end = .;
173-
174-
. = ALIGN(32);
175-
__uvisor_bss_end = .;
176-
} > RAM
177-
178-
/* Heap space for the page allocator */
179-
.page_heap (NOLOAD) :
137+
.data : AT (__etext)
180138
{
181-
. = ALIGN(32);
182-
__uvisor_page_start = .;
183-
KEEP(*(.keep.uvisor.page_heap))
184-
185-
. = ALIGN( (1 << LOG2CEIL(LENGTH(RAM))) / 8);
186-
187-
__uvisor_page_end = .;
188-
} > RAM
189-
190-
.data :
191-
{
192-
PROVIDE(__etext = LOADADDR(.data)); /* Define a global symbol at end of code, */
193-
PROVIDE(__DATA_ROM = LOADADDR(.data)); /* Symbol is used by startup for data initialization. */
194-
195139
__data_start__ = .;
196140
*("dma")
197141
PROVIDE( __start_vector_table__ = .);
@@ -227,51 +171,6 @@ SECTIONS
227171
/* All data end */
228172
__data_end__ = .;
229173

230-
} > RAM AT > FLASH
231-
232-
/* uVisor configuration section
233-
* This section must be located after all other flash regions. */
234-
.uvisor.secure :
235-
{
236-
. = ALIGN(32);
237-
__uvisor_secure_start = .;
238-
239-
/* uVisor secure boxes configuration tables */
240-
. = ALIGN(32);
241-
__uvisor_cfgtbl_start = .;
242-
KEEP(*(.keep.uvisor.cfgtbl))
243-
. = ALIGN(32);
244-
__uvisor_cfgtbl_end = .;
245-
246-
/* Pointers to the uVisor secure boxes configuration tables */
247-
/* Note: Do not add any further alignment here, as uVisor will need to
248-
have access to the exact list of pointers. */
249-
__uvisor_cfgtbl_ptr_start = .;
250-
KEEP(*(.keep.uvisor.cfgtbl_ptr_first))
251-
KEEP(*(.keep.uvisor.cfgtbl_ptr))
252-
__uvisor_cfgtbl_ptr_end = .;
253-
254-
/* Pointers to all boxes register gateways. These are grouped here to
255-
allow discoverability and firmware verification. */
256-
__uvisor_register_gateway_ptr_start = .;
257-
KEEP(*(.keep.uvisor.register_gateway_ptr))
258-
__uvisor_register_gateway_ptr_end = .;
259-
260-
. = ALIGN(32);
261-
__uvisor_secure_end = .;
262-
} > FLASH
263-
264-
/* Uninitialized data section
265-
* This region is not initialized by the C/C++ library and can be used to
266-
* store state across soft reboots. */
267-
.uninitialized (NOLOAD):
268-
{
269-
. = ALIGN(32);
270-
__uninitialized_start = .;
271-
*(.uninitialized)
272-
KEEP(*(.keep.uninitialized))
273-
. = ALIGN(32);
274-
__uninitialized_end = .;
275174
} > RAM
276175

277176
.bss :
@@ -284,29 +183,33 @@ SECTIONS
284183
__bss_end__ = .;
285184
} > RAM
286185

287-
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
288-
__stack = __StackTop;
289-
__StackLimit = __StackTop - STACK_SIZE;
290-
291-
.heap (NOLOAD):
186+
.heap (COPY):
292187
{
293-
__uvisor_heap_start = .;
294188
__HeapBase = .;
295189
__end__ = .;
296190
end = __end__;
297191
_end = __end__;
298-
. += HEAP_SIZE;
192+
KEEP(*(.heap*))
193+
__HeapLimit = .;
299194
} > RAM
300195

301-
__HeapLimit = __StackLimit;
302-
__uvisor_heap_end = __StackLimit;
196+
/* .stack_dummy section doesn't contains any symbols. It is only
197+
* used for linker to calculate size of stack sections, and assign
198+
* values to stack symbols later */
199+
.stack_dummy (COPY):
200+
{
201+
KEEP(*(.stack*))
202+
} > RAM
203+
204+
/* Set stack top to end of RAM, and stack limit move down by
205+
* size of stack_dummy section */
206+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
207+
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
208+
PROVIDE(__stack = __StackTop);
303209

304-
/* Provide physical memory boundaries for uVisor. */
305-
__uvisor_flash_start = ORIGIN(FLASH);
306-
__uvisor_flash_end = ORIGIN(FLASH) + LENGTH(FLASH);
307-
__uvisor_sram_start = ORIGIN(RAM);
308-
__uvisor_sram_end = ORIGIN(RAM) + LENGTH(RAM);
210+
/* Check if data + heap + stack exceeds RAM limit */
211+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
309212

310-
/* Check if FLASH usage exceeds FLASH size. */
311-
ASSERT(LENGTH(FLASH) >= __uvisor_secure_end, "FLASH memory overflowed!")
213+
/* Check if FLASH usage exceeds FLASH size */
214+
ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !")
312215
}

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/TARGET_1024K/TOOLCHAIN_GCC_ARM/startup_efm32gg.S

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,23 @@ __StackLimit:
4949
__StackTop:
5050
.size __StackTop, . - __StackTop
5151

52+
.section .heap
53+
.align 3
54+
#ifdef __HEAP_SIZE
55+
.equ Heap_Size, __HEAP_SIZE
56+
#else
57+
.equ Heap_Size, 0x00000C00
58+
#endif
59+
.globl __HeapBase
60+
.globl __HeapLimit
61+
__HeapBase:
62+
.if Heap_Size
63+
.space Heap_Size
64+
.endif
65+
.size __HeapBase, . - __HeapBase
66+
__HeapLimit:
67+
.size __HeapLimit, . - __HeapLimit
68+
5269
.section .vectors
5370
.align 2
5471
.globl __Vectors
@@ -127,11 +144,6 @@ Reset_Handler:
127144
blx r0
128145
#endif
129146

130-
#if defined(FEATURE_UVISOR) && defined(TARGET_UVISOR_SUPPORTED)
131-
ldr r0, =uvisor_init
132-
blx r0
133-
#endif /* defined(FEATURE_UVISOR) && defined(UVISOR_SUPPORTED) */
134-
135147
/* Firstly it copies data from read only memory to RAM. There are two schemes
136148
* to copy. One can copy more than one sections. Another can only copy
137149
* one section. The former scheme needs more instructions and read-only

0 commit comments

Comments
 (0)