Skip to content

Commit 518b594

Browse files
authored
Merge pull request #1 from jeromecoutant/REVIEW_13723
Review 13723
2 parents abb5b12 + 953b503 commit 518b594

File tree

5 files changed

+49
-39
lines changed

5 files changed

+49
-39
lines changed

platform/mbed_lib.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@
220220
"crash-capture-enabled": true,
221221
"fatal-error-auto-reboot-enabled": true
222222
},
223+
"NUCLEO_F412ZG": {
224+
"crash-capture-enabled": true,
225+
"fatal-error-auto-reboot-enabled": true
226+
},
223227
"DISCO_F413ZH": {
224228
"crash-capture-enabled": true,
225229
"fatal-error-auto-reboot-enabled": true

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
;******************************************************************************
66
;* @attention
77
;*
8-
;* Copyright (c) 2014-2020 STMicroelectronics.
8+
;* Copyright (c) 2016-2020 STMicroelectronics.
99
;* All rights reserved.
1010
;*
1111
;* This software component is licensed by ST under BSD 3-Clause license,
@@ -60,7 +60,7 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE {
6060
.ANY (+RW +ZI)
6161
}
6262

63-
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - RAM_FIXED_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
63+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - RAM_FIXED_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
6464
}
6565

6666
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_CONF_TARGET_BOOT_STACK_SIZE { ; Stack region growing down

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TOOLCHAIN_IAR/stm32f411xe.icf

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,46 +18,47 @@
1818

1919
/* Tools provide -DMBED_ROM_START=xxx -DMBED_ROM_SIZE=xxx -DMBED_RAM_START=xxx -DMBED_RAM_SIZE=xxx */
2020

21-
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = MBED_ROM_START; }
22-
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = MBED_ROM_SIZE; }
23-
24-
/* [ROM = 512kb = 0x80000] */
25-
define symbol __intvec_start__ = MBED_APP_START;
26-
define symbol __region_ROM_start__ = MBED_APP_START;
27-
define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
28-
29-
/* [RAM = 128kb = 0x20000] Vector table dynamic copy: 102 vectors = 408 bytes (0x198) to be reserved in RAM */
30-
define symbol __NVIC_start__ = 0x20000000;
31-
define symbol __NVIC_end__ = 0x20000197; /* Aligned on 8 bytes */
32-
define symbol __region_CRASH_DATA_RAM_start__ = 0x20000198;
33-
define symbol __region_CRASH_DATA_RAM_end__ = 0x20000297;
34-
define symbol __region_RAM_start__ = 0x20000298;
35-
define symbol __region_RAM_end__ = 0x2001FFFF;
36-
37-
/* Memory regions */
38-
define memory mem with size = 4G;
39-
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
40-
define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__ to __region_CRASH_DATA_RAM_end__];
41-
define region RAM_region = mem:[from __region_RAM_start__ to __region_RAM_end__];
21+
define symbol VECTORS = 102; /* This value must match NVIC_NUM_VECTORS in cmsis_nvic.h */
22+
define symbol HEAP_SIZE = 0xa000;
23+
24+
/* Common - Do not change */
25+
26+
if (!isdefinedsymbol(MBED_APP_START)) {
27+
define symbol MBED_APP_START = MBED_ROM_START;
28+
}
4229

43-
/* Define Crash Data Symbols */
44-
define exported symbol __CRASH_DATA_RAM_START__ = __region_CRASH_DATA_RAM_start__;
45-
define exported symbol __CRASH_DATA_RAM_END__ = __region_CRASH_DATA_RAM_end__;
30+
if (!isdefinedsymbol(MBED_APP_SIZE)) {
31+
define symbol MBED_APP_SIZE = MBED_ROM_SIZE;
32+
}
4633

47-
/* Stack and Heap */
4834
if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
35+
/* This value is normally defined by the tools
36+
to 0x1000 for bare metal and 0x400 for RTOS */
4937
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
5038
}
51-
define symbol __size_cstack__ = MBED_CONF_TARGET_BOOT_STACK_SIZE;
52-
define symbol __size_heap__ = 0x15000;
53-
define block CSTACK with alignment = 8, size = __size_cstack__ { };
54-
define block HEAP with alignment = 8, size = __size_heap__ { };
55-
define block STACKHEAP with fixed order { block HEAP, block CSTACK };
5639

57-
initialize by copy with packing = zeros { readwrite };
40+
/* Round up VECTORS_SIZE to 8 bytes */
41+
define symbol VECTORS_SIZE = ((VECTORS * 4) + 7) & ~7;
42+
43+
define symbol CRASH_DATA_START = MBED_RAM_START + VECTORS_SIZE;
44+
define symbol CRASH_DATA_SIZE = 0x100;
45+
define exported symbol __CRASH_DATA_RAM_START__ = CRASH_DATA_START;
46+
47+
define symbol RAM_REGION_START = CRASH_DATA_START + CRASH_DATA_SIZE;
48+
define symbol RAM_REGION_SIZE = MBED_RAM_SIZE - VECTORS_SIZE - CRASH_DATA_SIZE;
49+
50+
define memory mem with size = 4G;
51+
define region ROM_region = mem:[from MBED_APP_START size MBED_APP_SIZE];
52+
define region RAM_region = mem:[from RAM_REGION_START size RAM_REGION_SIZE];
53+
54+
define block CSTACK with alignment = 8, size = MBED_CONF_TARGET_BOOT_STACK_SIZE { };
55+
define block HEAP with alignment = 8, size = HEAP_SIZE { };
56+
57+
initialize by copy { readwrite };
5858
do not initialize { section .noinit };
5959

60-
place at address mem:__intvec_start__ { readonly section .intvec };
60+
place at address mem: MBED_APP_START { readonly section .intvec };
6161

6262
place in ROM_region { readonly };
63-
place in RAM_region { readwrite, block STACKHEAP };
63+
place in RAM_region { readwrite,
64+
block CSTACK, block HEAP };

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F412xG/TOOLCHAIN_ARM/stm32f412xg.sct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#define MBED_IRAM1_SIZE (MBED_RAM_SIZE - VECTORS_SIZE - MBED_CRASH_REPORT_RAM_SIZE)
4444

4545

46-
#define RAM_FIXED_SIZE (MBED_BOOT_STACK_SIZE + VECTORS_SIZE + MBED_CRASH_REPORT_RAM_SIZE)
46+
#define RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE + VECTORS_SIZE + MBED_CRASH_REPORT_RAM_SIZE)
4747

4848
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
4949

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F412xG/TOOLCHAIN_IAR/stm32f412xx.icf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,20 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
3232
}
3333

3434
if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
35-
/* This value is normally defined by the tools
35+
/* This value is normally defined by the tools
3636
to 0x1000 for bare metal and 0x400 for RTOS */
3737
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
3838
}
3939

4040
/* Round up VECTORS_SIZE to 8 bytes */
4141
define symbol VECTORS_SIZE = ((VECTORS * 4) + 7) & ~7;
42-
define symbol RAM_REGION_START = MBED_RAM_START + VECTORS_SIZE;
43-
define symbol RAM_REGION_SIZE = MBED_RAM_SIZE - VECTORS_SIZE;
42+
43+
define symbol CRASH_DATA_START = MBED_RAM_START + VECTORS_SIZE;
44+
define symbol CRASH_DATA_SIZE = 0x100;
45+
define exported symbol __CRASH_DATA_RAM_START__ = CRASH_DATA_START;
46+
47+
define symbol RAM_REGION_START = CRASH_DATA_START + CRASH_DATA_SIZE;
48+
define symbol RAM_REGION_SIZE = MBED_RAM_SIZE - VECTORS_SIZE - CRASH_DATA_SIZE;
4449

4550
define memory mem with size = 4G;
4651
define region ROM_region = mem:[from MBED_APP_START size MBED_APP_SIZE];

0 commit comments

Comments
 (0)