Skip to content

Commit 838f4b3

Browse files
Start upconverting linker scripts and target definitions
1 parent 22a4f41 commit 838f4b3

File tree

40 files changed

+539
-650
lines changed

40 files changed

+539
-650
lines changed

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CPROTO_062_4343W/COMPONENT_CM4/TOOLCHAIN_GCC_ARM/cy8c6xxa_cm4_dual.ld

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,36 +47,20 @@ ENTRY(Reset_Handler)
4747
/* The size of the Cortex-M0+ application image at the start of FLASH */
4848
FLASH_CM0P_SIZE = 0x2000;
4949

50-
#if !defined(MBED_ROM_START)
51-
#define MBED_ROM_START 0x10000000
52-
#endif
53-
5450
/* MBED_APP_START is being used by the bootloader build script and
5551
* will be calculate by the system. In case if MBED_APP_START address is
5652
* customized by the bootloader config, the application image should not
5753
* include CM0p prebuilt image.
5854
*/
5955
#if !defined(MBED_APP_START)
60-
#define MBED_APP_START (MBED_ROM_START + FLASH_CM0P_SIZE)
61-
#endif
62-
63-
#if !defined(MBED_ROM_SIZE)
64-
#define MBED_ROM_SIZE 0x00200000
56+
#define MBED_APP_START (MBED_CONFIGURED_ROM_BANK_IROM1_START + FLASH_CM0P_SIZE)
6557
#endif
6658

6759
/* MBED_APP_SIZE is being used by the bootloader build script and
6860
* will be calculate by the system.
6961
*/
7062
#if !defined(MBED_APP_SIZE)
71-
#define MBED_APP_SIZE (MBED_ROM_SIZE - FLASH_CM0P_SIZE)
72-
#endif
73-
74-
#if !defined(MBED_RAM_START)
75-
#define MBED_RAM_START 0x08002000
76-
#endif
77-
78-
#if !defined(MBED_RAM_SIZE)
79-
#define MBED_RAM_SIZE 0x000FD800
63+
#define MBED_APP_SIZE (MBED_CONFIGURED_ROM_BANK_IROM1_SIZE - FLASH_CM0P_SIZE)
8064
#endif
8165

8266
#if !defined(MBED_BOOT_STACK_SIZE)
@@ -106,8 +90,8 @@ MEMORY
10690
* Your changes must be aligned with the corresponding memory regions for CM0+ core in 'xx_cm0plus.ld',
10791
* where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.ld'.
10892
*/
109-
ram (rwx) : ORIGIN = MBED_RAM_START, LENGTH = MBED_RAM_SIZE
110-
cm0p_image (rx) : ORIGIN = MBED_ROM_START, LENGTH = FLASH_CM0P_SIZE
93+
ram (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_IRAM1_START, LENGTH = MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE
94+
cm0p_image (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START, LENGTH = FLASH_CM0P_SIZE
11195
flash (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
11296

11397
/* This is a 32K flash region used for EEPROM emulation. This region can also be used as the general purpose flash.
@@ -440,8 +424,8 @@ SECTIONS
440424

441425
/* The following symbols used by the cymcuelftool. */
442426
/* Flash */
443-
__cy_memory_0_start = 0x10000000;
444-
__cy_memory_0_length = 0x00200000;
427+
__cy_memory_0_start = MBED_ROM_BANK_IROM1_START;
428+
__cy_memory_0_length = MBED_ROM_BANK_IROM1_SIZE;
445429
__cy_memory_0_row_size = 0x200;
446430

447431
/* Emulated EEPROM Flash area */

targets/TARGET_STM/TARGET_STM32H7/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,7 @@ elseif("STM32H7_550MHZ" IN_LIST MBED_TARGET_LABELS)
4242
target_sources(mbed-stm32h7 INTERFACE clock_cfg/TARGET_STM32H7_550MHZ/system_clock.c)
4343
elseif("STM32H7_280MHZ" IN_LIST MBED_TARGET_LABELS)
4444
target_sources(mbed-stm32h7 INTERFACE clock_cfg/TARGET_STM32H7_280MHZ/system_clock.c)
45-
endif()
45+
endif()
46+
47+
# Add linker scripts
48+
add_subdirectory(linker_scripts)

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H745xI/TARGET_STM32H745xI_CM4/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
55
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32h745xx.S)
6-
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32H745xI_CM4.ld)
76
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
87
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32h745xx.S)
9-
set(LINKER_FILE TOOLCHAIN_ARM/stm32h745xI_CM4.sct)
108
endif()
119

1210
add_library(mbed-stm32h745xi-cm4 INTERFACE)
@@ -21,6 +19,4 @@ target_include_directories(mbed-stm32h745xi-cm4
2119
.
2220
)
2321

24-
mbed_set_linker_script(mbed-stm32h745xi-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
25-
2622
target_link_libraries(mbed-stm32h745xi-cm4 INTERFACE mbed-stm32h745xi)

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H745xI/TARGET_STM32H745xI_CM4/cmsis_nvic.h

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +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 0x8100000
22-
#endif
23-
24-
#if !defined(MBED_ROM_SIZE)
25-
#define MBED_ROM_SIZE 0x100000 // 1.0 MB
26-
#endif
27-
28-
#if !defined(MBED_RAM_START)
29-
#define MBED_RAM_START 0x10000000
30-
#endif
31-
32-
#if !defined(MBED_RAM_SIZE)
33-
#define MBED_RAM_SIZE 0x48000 // 288 KB
34-
#endif
35-
36-
3720
#define NVIC_NUM_VECTORS 166
38-
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_START
21+
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_BANK_SRAM_DTC_START
3922

4023
#endif

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H745xI/TARGET_STM32H745xI_CM7/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
55
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32h745xx.S)
6-
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32H745xI_CM7.ld)
76
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
87
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32h745xx.S)
9-
set(LINKER_FILE TOOLCHAIN_ARM/stm32h745xI_CM7.sct)
108
endif()
119

1210
add_library(mbed-stm32h745xi-cm7 INTERFACE)
@@ -21,6 +19,4 @@ target_include_directories(mbed-stm32h745xi-cm7
2119
.
2220
)
2321

24-
mbed_set_linker_script(mbed-stm32h745xi-cm7 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
25-
2622
target_link_libraries(mbed-stm32h745xi-cm7 INTERFACE mbed-stm32h745xi)

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H745xI/TARGET_STM32H745xI_CM7/cmsis_nvic.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,6 @@
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 0x100000 // 1.0 MB
26-
#endif
27-
28-
#if !defined(MBED_RAM_START)
29-
#define MBED_RAM_START 0x24000000
30-
#endif
31-
32-
#if !defined(MBED_RAM_SIZE)
33-
#define MBED_RAM_SIZE 0x80000 // 512 KB
34-
#endif
35-
36-
3720
#define NVIC_NUM_VECTORS 166
3821
#define NVIC_RAM_VECTOR_ADDRESS 0x20000000
3922

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_STM32H747xI_CM4/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
55
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32h747xx.S)
6-
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32h747xI_CM4.ld)
76
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
87
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32h747xx.S)
9-
set(LINKER_FILE TOOLCHAIN_ARM/stm32h747xI_CM4.sct)
108
endif()
119

1210
add_library(mbed-stm32h747xi-cm4 INTERFACE)
@@ -21,6 +19,4 @@ target_include_directories(mbed-stm32h747xi-cm4
2119
.
2220
)
2321

24-
mbed_set_linker_script(mbed-stm32h747xi-cm4 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
25-
2622
target_link_libraries(mbed-stm32h747xi-cm4 INTERFACE mbed-stm32h747xi)

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_STM32H747xI_CM4/TOOLCHAIN_GCC_ARM/stm32h747xI_CM4.ld

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

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_STM32H747xI_CM7/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
55
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32h747xx.S)
6-
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32H747xI_CM7.ld)
76
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
87
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32h747xx.S)
9-
set(LINKER_FILE TOOLCHAIN_ARM/stm32h747xI_CM7.sct)
108
endif()
119

1210
add_library(mbed-stm32h747xi-cm7 INTERFACE)
@@ -21,6 +19,4 @@ target_include_directories(mbed-stm32h747xi-cm7
2119
.
2220
)
2321

24-
mbed_set_linker_script(mbed-stm32h747xi-cm7 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
25-
2622
target_link_libraries(mbed-stm32h747xi-cm7 INTERFACE mbed-stm32h747xi)

0 commit comments

Comments
 (0)