Skip to content

Commit 5280282

Browse files
Andreas Larssonandreas.larsson
authored andcommitted
Added MBED_APP_START and MBED_APP_SIZE used by the app when a boot loader is present
1 parent b73c165 commit 5280282

File tree

4 files changed

+49
-15
lines changed

4 files changed

+49
-15
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device/TOOLCHAIN_ARM_MICRO/stm32f439xx.sct

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! armcc -E
12
; Scatter-Loading Description File
23
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34
; Copyright (c) 2015, STMicroelectronics
@@ -27,19 +28,30 @@
2728
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2829
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2930

30-
; 2 MB FLASH (0x200000) + 256 KB SRAM (0x40000)
31-
LR_IROM1 0x08000000 0x200000 { ; load region size_region
31+
#if !defined(MBED_APP_START)
32+
#define MBED_APP_START 0x08000000
33+
#endif
3234

33-
ER_IROM1 0x08000000 0x200000 { ; load address = execution address
35+
#if !defined(MBED_APP_SIZE)
36+
#define MBED_APP_SIZE 0x200000
37+
#endif
38+
39+
; STM32F439xI: 2048 KB FLASH (0x200000) + 256 KB SRAM (0x30000 + 0x10000)
40+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
41+
42+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
3443
*.o (RESET, +First)
3544
*(InRoot$$Sections)
3645
.ANY (+RO)
3746
}
3847

39-
; Total: 107 vectors = 428 bytes (0x1AC) to be reserved in RAM
40-
RW_IRAM1 (0x20000000+0x1AC) (0x20000-0x1AC) { ; RW data
48+
; Total: 107 vectors = 428 bytes (0x1AC) to be used
49+
; should match ER_IROM1::RESET/4 and cmsis_nvic.h::NVIC_NUM_VECTORS
50+
RW_IRAM1 (0x20000000 + (107*4)) (0x30000 - (107*4)) { ; RW data
4151
.ANY (+RW +ZI)
4252
}
43-
53+
RW_IRAM2 (0x10000000) 0x10000 {
54+
.ANY (+RW +ZI)
55+
}
4456
}
4557

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device/TOOLCHAIN_ARM_STD/stm32f439xx.sct

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! armcc -E
12
; Scatter-Loading Description File
23
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34
; Copyright (c) 2015, STMicroelectronics
@@ -27,10 +28,18 @@
2728
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2829
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2930

30-
; 2 MB FLASH (0x200000) + 192 KB SRAM (0x30000)
31-
LR_IROM1 0x08000000 0x200000 { ; load region size_region
31+
#if !defined(MBED_APP_START)
32+
#define MBED_APP_START 0x08000000
33+
#endif
3234

33-
ER_IROM1 0x08000000 0x200000 { ; load address = execution address
35+
#if !defined(MBED_APP_SIZE)
36+
#define MBED_APP_SIZE 0x200000
37+
#endif
38+
39+
; 2 MB FLASH (0x200000) + 256 KB SRAM (0x30000 + 0x10000)
40+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
41+
42+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
3443
*.o (RESET, +First)
3544
*(InRoot$$Sections)
3645
.ANY (+RO)
@@ -40,6 +49,9 @@ LR_IROM1 0x08000000 0x200000 { ; load region size_region
4049
RW_IRAM1 (0x20000000+0x1AC) (0x30000-0x1AC) { ; RW data
4150
.ANY (+RW +ZI)
4251
}
43-
52+
53+
RW_IRAM2 (0x10000000) (0x10000) { ; RW data
54+
.ANY (+RW +ZI)
55+
}
4456
}
4557

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device/TOOLCHAIN_GCC_ARM/STM32F439ZI.ld

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
#if !defined(MBED_APP_START)
2+
#define MBED_APP_START 0x08000000
3+
#endif
4+
5+
#if !defined(MBED_APP_SIZE)
6+
#define MBED_APP_SIZE 2048k
7+
#endif
8+
19
/* Linker script to configure memory regions. */
210
MEMORY
311
{
4-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048k
12+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
513
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
614
RAM (rwx) : ORIGIN = 0x200001AC, LENGTH = 192k - 0x1AC
715
}

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device/TOOLCHAIN_IAR/stm32f439xx_flash.icf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
/*###ICF### Section handled by ICF editor, don't touch! ****/
22
/*-Editor annotation file-*/
33
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4+
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
5+
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x200000; }
46
/*-Specials-*/
5-
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
7+
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
68
/*-Memory Regions-*/
7-
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
8-
define symbol __ICFEDIT_region_ROM_end__ = 0x081FFFFF;
9+
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
10+
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
911
define symbol __ICFEDIT_region_NVIC_start__ = 0x20000000;
1012
define symbol __ICFEDIT_region_NVIC_end__ = 0x200001AF;
1113
define symbol __ICFEDIT_region_RAM_start__ = 0x200001B0;
1214
define symbol __ICFEDIT_region_RAM_end__ = 0x2002FFFF;
1315
define symbol __ICFEDIT_region_CCMRAM_start__ = 0x10000000;
1416
define symbol __ICFEDIT_region_CCMRAM_end__ = 0x1000FFFF;
1517
/*-Sizes-*/
16-
/*Heap 1/3 of ram and stack 1/8*/
18+
/*Heap 64kB and stack 24kB */
1719
define symbol __ICFEDIT_size_cstack__ = 0x6000;
1820
define symbol __ICFEDIT_size_heap__ = 0x10000;
1921
/**** End of ICF editor section. ###ICF###*/

0 commit comments

Comments
 (0)