Skip to content

Commit 3b86e1f

Browse files
authored
Merge pull request #15230 from jeromecoutant/PR_G4
STM32G4: corrections for STM32G491xE, STM32G4A1xE and STM32G471xE
2 parents 2d59c75 + 661c5c1 commit 3b86e1f

File tree

19 files changed

+4224
-98
lines changed

19 files changed

+4224
-98
lines changed

targets/TARGET_STM/TARGET_STM32G4/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ add_subdirectory(TARGET_STM32G473xE EXCLUDE_FROM_ALL)
88
add_subdirectory(TARGET_STM32G474xE EXCLUDE_FROM_ALL)
99
add_subdirectory(TARGET_STM32G483xE EXCLUDE_FROM_ALL)
1010
add_subdirectory(TARGET_STM32G484xE EXCLUDE_FROM_ALL)
11+
add_subdirectory(TARGET_STM32G491xE EXCLUDE_FROM_ALL)
12+
add_subdirectory(TARGET_STM32G4A1xE EXCLUDE_FROM_ALL)
1113
add_subdirectory(STM32Cube_FW EXCLUDE_FROM_ALL)
1214

1315
add_library(mbed-stm32g4 INTERFACE)

targets/TARGET_STM/TARGET_STM32G4/STM32Cube_FW/CMSIS/stm32g471xx.h

+130-98
Large diffs are not rendered by default.
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_stm32g491xx.S)
6+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32g491xe.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32g491xx.S)
9+
set(LINKER_FILE TOOLCHAIN_ARM/stm32g491xe.sct)
10+
endif()
11+
12+
add_library(mbed-stm32g491xe INTERFACE)
13+
14+
target_include_directories(mbed-stm32g491xe
15+
INTERFACE
16+
.
17+
)
18+
19+
target_sources(mbed-stm32g491xe
20+
INTERFACE
21+
${STARTUP_FILE}
22+
)
23+
24+
mbed_set_linker_script(mbed-stm32g491xe ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
25+
26+
target_link_libraries(mbed-stm32g491xe INTERFACE mbed-stm32g4)

targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G491xE/TOOLCHAIN_ARM/startup_stm32g491xx.S

+404
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
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+
}

0 commit comments

Comments
 (0)