Skip to content

Commit 4ecbf93

Browse files
committed
STM32L4 : add MCU_STM32L4P5xG support
1 parent f75ff22 commit 4ecbf93

File tree

11 files changed

+2064
-0
lines changed

11 files changed

+2064
-0
lines changed

targets/TARGET_STM/TARGET_STM32L4/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ add_subdirectory(TARGET_STM32L475xG EXCLUDE_FROM_ALL)
1010
add_subdirectory(TARGET_STM32L476xG EXCLUDE_FROM_ALL)
1111
add_subdirectory(TARGET_STM32L486xG EXCLUDE_FROM_ALL)
1212
add_subdirectory(TARGET_STM32L496xG EXCLUDE_FROM_ALL)
13+
add_subdirectory(TARGET_STM32L4P5xG EXCLUDE_FROM_ALL)
1314
add_subdirectory(TARGET_STM32L4R5xI EXCLUDE_FROM_ALL)
1415
add_subdirectory(TARGET_STM32L4R9xI EXCLUDE_FROM_ALL)
1516
add_subdirectory(TARGET_STM32L4S5xI EXCLUDE_FROM_ALL)
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_stm32l4p5xx.S)
6+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32l4p5xg.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32l4p5xx.S)
9+
set(LINKER_FILE TOOLCHAIN_ARM/stm32l4p5xg.sct)
10+
endif()
11+
12+
add_library(mbed-stm32l4p5xg INTERFACE)
13+
14+
target_include_directories(mbed-stm32l4p5xg
15+
INTERFACE
16+
.
17+
)
18+
19+
target_sources(mbed-stm32l4p5xg
20+
INTERFACE
21+
${STARTUP_FILE}
22+
)
23+
24+
mbed_set_linker_script(mbed-stm32l4p5xg ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
25+
26+
target_link_libraries(mbed-stm32l4p5xg INTERFACE mbed-stm32l4)

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4P5xG/TOOLCHAIN_ARM/startup_stm32l4p5xx.S

Lines changed: 402 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-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)