Skip to content

Commit 1fdce7d

Browse files
author
Jamie Smith
authored
Unify some STM32L4 linker scripts into one (#440)
* Unify some STM32L4 linker scripts into one * Standardize all the cmsis_nvic.h defines * Fix an annoyance * Fix totally broken stack configuration on STM32L4
1 parent 0553c11 commit 1fdce7d

File tree

30 files changed

+44
-2018
lines changed

30 files changed

+44
-2018
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ if("MBED_CONF_TARGET_APPLICATION_PROFILE=full" IN_LIST MBED_CONFIG_DEFINITIONS O
132132
elseif("MBED_CONF_TARGET_APPLICATION_PROFILE=bare-metal" IN_LIST MBED_CONFIG_DEFINITIONS)
133133
set(APPLICATION_PROFILE_CONFIG_BAREMETAL TRUE)
134134
else()
135-
message(FATAL_ERROR "target.application-profile must be set to either 'full' or 'bare-metal'!")
135+
message(FATAL_ERROR "target.application-profile must be set to either 'full' or 'bare-metal'! If you are getting this after upgrading mbed-os then you likely need to clear your CMake cache.")
136136
endif()
137137

138138
# mbed-core-flags/mbed-core-sources link mbed-rtos-flags/mbed-rtos-sources or not depending on

targets/TARGET_STM/TARGET_STM32L4/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ add_subdirectory(TARGET_STM32L4R5xI EXCLUDE_FROM_ALL)
1616
add_subdirectory(TARGET_STM32L4R9xI EXCLUDE_FROM_ALL)
1717
add_subdirectory(TARGET_STM32L4S5xI EXCLUDE_FROM_ALL)
1818
add_subdirectory(STM32Cube_FW EXCLUDE_FROM_ALL)
19+
add_subdirectory(linker_scripts)
1920

2021
add_library(mbed-stm32l4 INTERFACE)
2122

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ add_subdirectory(TARGET_NUCLEO_L432KC EXCLUDE_FROM_ALL)
55

66
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
77
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32l432xx.S)
8-
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32l432xc.ld)
98
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
109
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32l432xx.S)
11-
set(LINKER_FILE TOOLCHAIN_ARM/stm32l432xc.sct)
1210
endif()
1311

1412
add_library(mbed-stm32l432xc INTERFACE)
@@ -23,5 +21,5 @@ target_include_directories(mbed-stm32l432xc
2321
INTERFACE
2422
.
2523
)
26-
mbed_set_linker_script(mbed-stm32l432xc ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
24+
2725
target_link_libraries(mbed-stm32l432xc INTERFACE mbed-stm32l4)

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/TOOLCHAIN_GCC_ARM/stm32l432xc.ld

Lines changed: 0 additions & 203 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/cmsis_nvic.h

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,7 @@
1717
#ifndef MBED_CMSIS_NVIC_H
1818
#define MBED_CMSIS_NVIC_H
1919

20-
#if !defined(MBED_ROM_START)
21-
#define MBED_ROM_START 0x8000000
22-
#endif
23-
24-
#if !defined(MBED_ROM_SIZE)
25-
#define MBED_ROM_SIZE 0x40000 // 256 KB
26-
#endif
27-
28-
#if !defined(MBED_RAM_START)
29-
#define MBED_RAM_START 0x20000000
30-
#endif
31-
32-
#if !defined(MBED_RAM_SIZE)
33-
#define MBED_RAM_SIZE 0xc000 // 48 KB
34-
#endif
35-
36-
#if !defined(MBED_RAM1_START)
37-
#define MBED_RAM1_START 0x10000000
38-
#endif
39-
40-
#if !defined(MBED_RAM1_SIZE)
41-
#define MBED_RAM1_SIZE 0x4000 // 16 KB
42-
#endif
43-
4420
#define NVIC_NUM_VECTORS 99
45-
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_START
21+
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_BANK_IRAM2_START
4622

4723
#endif

0 commit comments

Comments
 (0)