Skip to content

Commit 1e2aacd

Browse files
committed
STM32H7: create MCU_STM32H7A3xIQ
1 parent d418667 commit 1e2aacd

File tree

9 files changed

+2834
-0
lines changed

9 files changed

+2834
-0
lines changed

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H7A3xIQ/TOOLCHAIN_ARM/startup_stm32h7a3xxq.S

Lines changed: 559 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#! armcc -E
2+
; Scatter-Loading Description File
3+
;
4+
; SPDX-License-Identifier: BSD-3-Clause
5+
;******************************************************************************
6+
;* @attention
7+
;*
8+
;* Copyright (c) 2016-2020 STMicroelectronics.
9+
;* All rights reserved.
10+
;*
11+
;* This software component is licensed by ST under BSD 3-Clause license,
12+
;* the "License"; You may not use this file except in compliance with the
13+
;* License. You may obtain a copy of the License at:
14+
;* opensource.org/licenses/BSD-3-Clause
15+
;*
16+
;******************************************************************************
17+
18+
#include "../cmsis_nvic.h"
19+
20+
#if !defined(MBED_APP_START)
21+
#define MBED_APP_START MBED_ROM_START
22+
#endif
23+
24+
#if !defined(MBED_APP_SIZE)
25+
#define MBED_APP_SIZE MBED_ROM_SIZE
26+
#endif
27+
28+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
29+
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
30+
#if defined(MBED_BOOT_STACK_SIZE)
31+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
32+
#else
33+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
34+
#endif
35+
#endif
36+
37+
/* Round up VECTORS_SIZE to 8 bytes */
38+
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
39+
40+
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
41+
42+
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
43+
*.o (RESET, +First)
44+
*(InRoot$$Sections)
45+
.ANY (+RO)
46+
}
47+
48+
RW_IRAM1 (MBED_RAM_START) { ; RW data
49+
.ANY (+RW +ZI)
50+
}
51+
52+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - MBED_CONF_TARGET_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
53+
}
54+
55+
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_CONF_TARGET_BOOT_STACK_SIZE { ; Stack region growing down
56+
}
57+
}

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H7A3xIQ/TOOLCHAIN_GCC_ARM/startup_stm32h7a3xxq.S

Lines changed: 740 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
/* Linker script to configure memory regions. */
2+
/*
3+
* SPDX-License-Identifier: BSD-3-Clause
4+
******************************************************************************
5+
* @attention
6+
*
7+
* Copyright (c) 2016-2020 STMicroelectronics.
8+
* All rights reserved.
9+
*
10+
* This software component is licensed by ST under BSD 3-Clause license,
11+
* the "License"; You may not use this file except in compliance with the
12+
* License. You may obtain a copy of the License at:
13+
* opensource.org/licenses/BSD-3-Clause
14+
*
15+
******************************************************************************
16+
*/
17+
18+
#include "../cmsis_nvic.h"
19+
20+
21+
#if !defined(MBED_APP_START)
22+
#define MBED_APP_START MBED_ROM_START
23+
#endif
24+
25+
#if !defined(MBED_APP_SIZE)
26+
#define MBED_APP_SIZE MBED_ROM_SIZE
27+
#endif
28+
29+
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
30+
/* This value is normally defined by the tools
31+
to 0x1000 for bare metal and 0x400 for RTOS */
32+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
33+
#endif
34+
35+
/* Round up VECTORS_SIZE to 8 bytes */
36+
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) & 0xFFFFFFF8)
37+
38+
MEMORY
39+
{
40+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
41+
DTCMRAM (rwx) : ORIGIN = NVIC_RAM_VECTOR_ADDRESS + VECTORS_SIZE, LENGTH = 128K - VECTORS_SIZE
42+
RAM (xrw) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
43+
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
44+
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
45+
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
46+
}
47+
48+
/* Linker script to place sections and symbol values. Should be used together
49+
* with other linker script that defines memory regions FLASH and RAM.
50+
* It references following symbols, which must be defined in code:
51+
* Reset_Handler : Entry of reset handler
52+
*
53+
* It defines following symbols, which code can use without definition:
54+
* __exidx_start
55+
* __exidx_end
56+
* __etext
57+
* __data_start__
58+
* __preinit_array_start
59+
* __preinit_array_end
60+
* __init_array_start
61+
* __init_array_end
62+
* __fini_array_start
63+
* __fini_array_end
64+
* __data_end__
65+
* __bss_start__
66+
* __bss_end__
67+
* __end__
68+
* end
69+
* __HeapLimit
70+
* __StackLimit
71+
* __StackTop
72+
* __stack
73+
* _estack
74+
*/
75+
ENTRY(Reset_Handler)
76+
77+
SECTIONS
78+
{
79+
.text :
80+
{
81+
KEEP(*(.isr_vector))
82+
*(.text*)
83+
84+
KEEP(*(.init))
85+
KEEP(*(.fini))
86+
87+
/* .ctors */
88+
*crtbegin.o(.ctors)
89+
*crtbegin?.o(.ctors)
90+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
91+
*(SORT(.ctors.*))
92+
*(.ctors)
93+
94+
/* .dtors */
95+
*crtbegin.o(.dtors)
96+
*crtbegin?.o(.dtors)
97+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
98+
*(SORT(.dtors.*))
99+
*(.dtors)
100+
101+
*(.rodata*)
102+
103+
KEEP(*(.eh_frame*))
104+
} > FLASH
105+
106+
.ARM.extab :
107+
{
108+
*(.ARM.extab* .gnu.linkonce.armextab.*)
109+
} > FLASH
110+
111+
__exidx_start = .;
112+
.ARM.exidx :
113+
{
114+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
115+
} > FLASH
116+
__exidx_end = .;
117+
118+
__etext = .;
119+
_sidata = .;
120+
121+
.data : AT (__etext)
122+
{
123+
__data_start__ = .;
124+
_sdata = .;
125+
*(vtable)
126+
*(.data*)
127+
128+
. = ALIGN(8);
129+
/* preinit data */
130+
PROVIDE_HIDDEN (__preinit_array_start = .);
131+
KEEP(*(.preinit_array))
132+
PROVIDE_HIDDEN (__preinit_array_end = .);
133+
134+
. = ALIGN(8);
135+
/* init data */
136+
PROVIDE_HIDDEN (__init_array_start = .);
137+
KEEP(*(SORT(.init_array.*)))
138+
KEEP(*(.init_array))
139+
PROVIDE_HIDDEN (__init_array_end = .);
140+
141+
. = ALIGN(8);
142+
/* finit data */
143+
PROVIDE_HIDDEN (__fini_array_start = .);
144+
KEEP(*(SORT(.fini_array.*)))
145+
KEEP(*(.fini_array))
146+
PROVIDE_HIDDEN (__fini_array_end = .);
147+
148+
KEEP(*(.jcr*))
149+
. = ALIGN(8);
150+
/* All data end */
151+
__data_end__ = .;
152+
_edata = .;
153+
154+
} > RAM
155+
156+
/* Uninitialized data section
157+
* This region is not initialized by the C/C++ library and can be used to
158+
* store state across soft reboots. */
159+
.uninitialized (NOLOAD):
160+
{
161+
. = ALIGN(32);
162+
__uninitialized_start = .;
163+
*(.uninitialized)
164+
KEEP(*(.keep.uninitialized))
165+
. = ALIGN(32);
166+
__uninitialized_end = .;
167+
} > RAM
168+
169+
.bss :
170+
{
171+
. = ALIGN(8);
172+
__bss_start__ = .;
173+
_sbss = .;
174+
*(.bss*)
175+
*(COMMON)
176+
. = ALIGN(8);
177+
__bss_end__ = .;
178+
_ebss = .;
179+
} > RAM
180+
181+
.heap (COPY):
182+
{
183+
__end__ = .;
184+
PROVIDE(end = .);
185+
*(.heap*)
186+
. = ORIGIN(RAM) + LENGTH(RAM) - MBED_CONF_TARGET_BOOT_STACK_SIZE;
187+
__HeapLimit = .;
188+
} > RAM
189+
190+
/* .stack_dummy section doesn't contains any symbols. It is only
191+
* used for linker to calculate size of stack sections, and assign
192+
* values to stack symbols later */
193+
.stack_dummy (COPY):
194+
{
195+
*(.stack*)
196+
} > RAM
197+
198+
/* Set stack top to end of RAM, and stack limit move down by
199+
* size of stack_dummy section */
200+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
201+
_estack = __StackTop;
202+
__StackLimit = __StackTop - MBED_CONF_TARGET_BOOT_STACK_SIZE;
203+
PROVIDE(__stack = __StackTop);
204+
205+
/* Check if data + heap + stack exceeds RAM limit */
206+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
207+
}

0 commit comments

Comments
 (0)