Skip to content

Commit 622b7cf

Browse files
committed
Add MBED_APP_START & MBED_APP_SIZE check/set to MTS_MDOT_F411RE arm linker
1 parent aa2c80f commit 622b7cf

File tree

1 file changed

+21
-7
lines changed
  • targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/TOOLCHAIN_ARM

1 file changed

+21
-7
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/TOOLCHAIN_ARM/stm32f411re.sct

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,43 @@
2828
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3030

31+
#if !defined(MBED_APP_START)
32+
#define MBED_APP_START 0x08000000
33+
#endif
34+
35+
#if !defined(MBED_APP_SIZE)
36+
#define MBED_APP_SIZE 0x80000
37+
#endif
38+
3139
#if !defined(MBED_BOOT_STACK_SIZE)
3240
#define MBED_BOOT_STACK_SIZE 0x400
3341
#endif
3442

3543
#define Stack_Size MBED_BOOT_STACK_SIZE
3644

37-
; STM32F411RE: 512 KB FLASH (0x80000) + 128 KB SRAM (0x20000)
38-
; FIRST 64 KB FLASH FOR BOOTLOADER
39-
; REST 448 KB FLASH FOR APPLICATION
40-
LR_IROM1 0x08010000 0x70000 { ; load region size_region
45+
#define MBED_RAM_START 0x20000000
46+
#define MBED_RAM_SIZE 0x20000
47+
#define MBED_VECTTABLE_RAM_START (MBED_RAM_START)
48+
#define MBED_VECTTABLE_RAM_SIZE 0x198
49+
#define MBED_RAM0_START (MBED_RAM_START + MBED_VECTTABLE_RAM_SIZE)
50+
#define MBED_RAM0_SIZE (MBED_RAM_SIZE - MBED_VECTTABLE_RAM_SIZE)
51+
52+
; STM32F411RE: 512 KB FLASH (0x80000) + 128 KB SRAM (0x20000) if not using MTS bootloader
53+
; If using MTS bootloader, FIRST 64 KB FLASH FOR BOOTLOADER, REST 448 KB FLASH FOR APPLICATION
54+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
4155

42-
ER_IROM1 0x08010000 0x70000 { ; load address = execution address
56+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
4357
*.o (RESET, +First)
4458
*(InRoot$$Sections)
4559
.ANY (+RO)
4660
}
4761

4862
; Total: 102 vectors = 408 bytes (0x198) to be reserved in RAM
49-
RW_IRAM1 (0x20000000+0x198) (0x20000-0x198-Stack_Size) { ; RW data
63+
RW_IRAM1 (MBED_RAM0_START) (MBED_RAM0_SIZE-Stack_Size) { ; RW data
5064
.ANY (+RW +ZI)
5165
}
5266

53-
ARM_LIB_STACK (0x20000000+0x20000) EMPTY -Stack_Size { ; stack
67+
ARM_LIB_STACK (MBED_RAM0_START+MBED_RAM0_SIZE) EMPTY -Stack_Size { ; stack
5468
}
5569
}
5670

0 commit comments

Comments
 (0)