Skip to content

Commit b57fe3f

Browse files
authored
Merge pull request #15120 from jeromecoutant/PR_H735
STM32: enable STM32H735xG STM32H7B3xIQ for custom boards
2 parents 7f2b6d0 + 317079b commit b57fe3f

File tree

19 files changed

+5641
-0
lines changed

19 files changed

+5641
-0
lines changed

targets/TARGET_STM/TARGET_STM32H7/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
add_subdirectory(TARGET_STM32H723xG EXCLUDE_FROM_ALL)
55
add_subdirectory(TARGET_STM32H725xE EXCLUDE_FROM_ALL)
6+
add_subdirectory(TARGET_STM32H735xG EXCLUDE_FROM_ALL)
67
add_subdirectory(TARGET_STM32H743xI EXCLUDE_FROM_ALL)
78
add_subdirectory(TARGET_STM32H745xI EXCLUDE_FROM_ALL)
89
add_subdirectory(TARGET_STM32H747xI EXCLUDE_FROM_ALL)
910
add_subdirectory(TARGET_STM32H750xB EXCLUDE_FROM_ALL)
1011
add_subdirectory(TARGET_STM32H7A3xIQ EXCLUDE_FROM_ALL)
12+
add_subdirectory(TARGET_STM32H7B3xIQ EXCLUDE_FROM_ALL)
1113
add_subdirectory(STM32Cube_FW EXCLUDE_FROM_ALL)
1214

1315
add_library(mbed-stm32h7 INTERFACE)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5+
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32h735xx.S)
6+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32h735xg.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32h735xx.S)
9+
set(LINKER_FILE TOOLCHAIN_ARM/stm32h735xg.sct)
10+
endif()
11+
12+
add_library(mbed-stm32h735xg INTERFACE)
13+
14+
target_include_directories(mbed-stm32h735xg
15+
INTERFACE
16+
.
17+
)
18+
19+
target_sources(mbed-stm32h735xg
20+
INTERFACE
21+
${STARTUP_FILE}
22+
)
23+
24+
mbed_set_linker_script(mbed-stm32h735xg ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
25+
26+
target_link_libraries(mbed-stm32h735xg INTERFACE mbed-stm32h7)

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H735xG/TOOLCHAIN_ARM/startup_stm32h735xx.S

Lines changed: 579 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+
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m7
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 + VECTORS_SIZE) { ; 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_STM32H735xG/TOOLCHAIN_GCC_ARM/startup_stm32h735xx.S

Lines changed: 765 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
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+
RAM (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE - VECTORS_SIZE
42+
}
43+
44+
/* Linker script to place sections and symbol values. Should be used together
45+
* with other linker script that defines memory regions FLASH and RAM.
46+
* It references following symbols, which must be defined in code:
47+
* Reset_Handler : Entry of reset handler
48+
*
49+
* It defines following symbols, which code can use without definition:
50+
* __exidx_start
51+
* __exidx_end
52+
* __etext
53+
* __data_start__
54+
* __preinit_array_start
55+
* __preinit_array_end
56+
* __init_array_start
57+
* __init_array_end
58+
* __fini_array_start
59+
* __fini_array_end
60+
* __data_end__
61+
* __bss_start__
62+
* __bss_end__
63+
* __end__
64+
* end
65+
* __HeapLimit
66+
* __StackLimit
67+
* __StackTop
68+
* __stack
69+
* _estack
70+
*/
71+
ENTRY(Reset_Handler)
72+
73+
SECTIONS
74+
{
75+
.text :
76+
{
77+
KEEP(*(.isr_vector))
78+
*(.text*)
79+
80+
KEEP(*(.init))
81+
KEEP(*(.fini))
82+
83+
/* .ctors */
84+
*crtbegin.o(.ctors)
85+
*crtbegin?.o(.ctors)
86+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
87+
*(SORT(.ctors.*))
88+
*(.ctors)
89+
90+
/* .dtors */
91+
*crtbegin.o(.dtors)
92+
*crtbegin?.o(.dtors)
93+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
94+
*(SORT(.dtors.*))
95+
*(.dtors)
96+
97+
*(.rodata*)
98+
99+
KEEP(*(.eh_frame*))
100+
} > FLASH
101+
102+
.ARM.extab :
103+
{
104+
*(.ARM.extab* .gnu.linkonce.armextab.*)
105+
} > FLASH
106+
107+
__exidx_start = .;
108+
.ARM.exidx :
109+
{
110+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
111+
} > FLASH
112+
__exidx_end = .;
113+
114+
__etext = .;
115+
_sidata = .;
116+
117+
.data : AT (__etext)
118+
{
119+
__data_start__ = .;
120+
_sdata = .;
121+
*(vtable)
122+
*(.data*)
123+
124+
. = ALIGN(8);
125+
/* preinit data */
126+
PROVIDE_HIDDEN (__preinit_array_start = .);
127+
KEEP(*(.preinit_array))
128+
PROVIDE_HIDDEN (__preinit_array_end = .);
129+
130+
. = ALIGN(8);
131+
/* init data */
132+
PROVIDE_HIDDEN (__init_array_start = .);
133+
KEEP(*(SORT(.init_array.*)))
134+
KEEP(*(.init_array))
135+
PROVIDE_HIDDEN (__init_array_end = .);
136+
137+
. = ALIGN(8);
138+
/* finit data */
139+
PROVIDE_HIDDEN (__fini_array_start = .);
140+
KEEP(*(SORT(.fini_array.*)))
141+
KEEP(*(.fini_array))
142+
PROVIDE_HIDDEN (__fini_array_end = .);
143+
144+
KEEP(*(.jcr*))
145+
. = ALIGN(8);
146+
/* All data end */
147+
__data_end__ = .;
148+
_edata = .;
149+
150+
} > RAM
151+
152+
/* Uninitialized data section
153+
* This region is not initialized by the C/C++ library and can be used to
154+
* store state across soft reboots. */
155+
.uninitialized (NOLOAD):
156+
{
157+
. = ALIGN(32);
158+
__uninitialized_start = .;
159+
*(.uninitialized)
160+
KEEP(*(.keep.uninitialized))
161+
. = ALIGN(32);
162+
__uninitialized_end = .;
163+
} > RAM
164+
165+
.bss :
166+
{
167+
. = ALIGN(8);
168+
__bss_start__ = .;
169+
_sbss = .;
170+
*(.bss*)
171+
*(COMMON)
172+
. = ALIGN(8);
173+
__bss_end__ = .;
174+
_ebss = .;
175+
} > RAM
176+
177+
.heap (COPY):
178+
{
179+
__end__ = .;
180+
PROVIDE(end = .);
181+
*(.heap*)
182+
. = ORIGIN(RAM) + LENGTH(RAM) - MBED_CONF_TARGET_BOOT_STACK_SIZE;
183+
__HeapLimit = .;
184+
} > RAM
185+
186+
/* .stack_dummy section doesn't contains any symbols. It is only
187+
* used for linker to calculate size of stack sections, and assign
188+
* values to stack symbols later */
189+
.stack_dummy (COPY):
190+
{
191+
*(.stack*)
192+
} > RAM
193+
194+
/* Set stack top to end of RAM, and stack limit move down by
195+
* size of stack_dummy section */
196+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
197+
_estack = __StackTop;
198+
__StackLimit = __StackTop - MBED_CONF_TARGET_BOOT_STACK_SIZE;
199+
PROVIDE(__stack = __StackTop);
200+
201+
/* Check if data + heap + stack exceeds RAM limit */
202+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
203+
}

0 commit comments

Comments
 (0)