Skip to content

Commit 2cd7aa1

Browse files
authored
Merge pull request #10303 from juhoeskeli/mem_changes
STM32L4xx: IAR memory maps updated
2 parents 39699d5 + 443974b commit 2cd7aa1

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/device/TOOLCHAIN_IAR/stm32l475xx.icf

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
1010
/* Vector table dynamic copy: Total: 98 vectors * 4 = 392 bytes (0x188) to be reserved in RAM */
1111
define symbol __NVIC_start__ = 0x10000000;
1212
define symbol __NVIC_end__ = 0x10000187;
13-
define symbol __region_SRAM2_start__ = 0x10000188;
13+
define symbol __region_CSTACK_start__ = 0x10000188;
14+
define symbol __region_CSTACK_end__ = __region_CSTACK_start__ + MBED_BOOT_STACK_SIZE;
15+
define symbol __region_SRAM2_start__ = __region_CSTACK_end__;
1416
define symbol __region_SRAM2_end__ = 0x10007FFF;
1517
define symbol __region_CRASH_DATA_RAM_start__ = 0x20000000;
1618
define symbol __region_CRASH_DATA_RAM_end__ = 0x200000FF;
@@ -20,9 +22,10 @@ define symbol __region_SRAM1_end__ = 0x20017FFF;
2022
/* Memory regions */
2123
define memory mem with size = 4G;
2224
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
23-
define region SRAM2_region = mem:[from __region_SRAM2_start__ to __region_SRAM2_end__];
25+
define region CSTACK_region = mem:[from __region_CSTACK_start__ to __region_CSTACK_end__];
2426
define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__ to __region_CRASH_DATA_RAM_end__];
25-
define region SRAM1_region = mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
27+
define region RAM_region = mem:[from __region_SRAM2_start__ to __region_SRAM2_end__]
28+
| mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
2629

2730
/* Define Crash Data Symbols */
2831
define exported symbol __CRASH_DATA_RAM_START__ = __region_CRASH_DATA_RAM_start__;
@@ -33,15 +36,15 @@ if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
3336
}
3437

3538
define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
36-
define symbol __size_heap__ = 0x17000;
39+
define symbol __size_heap__ = 0x10000;
3740
define block CSTACK with alignment = 8, size = __size_cstack__ { };
38-
define block HEAP with alignment = 8, size = __size_heap__ { };
41+
define block HEAP with expanding size, alignment = 8, minimum size = __size_heap__ { };
3942

4043
initialize by copy with packing = zeros { readwrite };
4144
do not initialize { section .noinit };
4245

4346
place at address mem:__intvec_start__ { readonly section .intvec };
4447

4548
place in ROM_region { readonly };
46-
place in SRAM1_region { readwrite, block HEAP };
47-
place in SRAM2_region { first block CSTACK, zeroinit };
49+
place in CSTACK_region { block CSTACK };
50+
place in RAM_region { block HEAP, readwrite, zeroinit };

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/device/TOOLCHAIN_IAR/stm32l476xx.icf

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
1010
/* Vector table dynamic copy: Total: 98 vectors * 4 = 392 bytes (0x188) to be reserved in RAM */
1111
define symbol __NVIC_start__ = 0x10000000;
1212
define symbol __NVIC_end__ = 0x10000187;
13-
define symbol __region_SRAM2_start__ = 0x10000188;
13+
define symbol __region_CSTACK_start__ = 0x10000188;
14+
define symbol __region_CSTACK_end__ = __region_CSTACK_start__ + MBED_BOOT_STACK_SIZE;
15+
define symbol __region_SRAM2_start__ = __region_CSTACK_end__;
1416
define symbol __region_SRAM2_end__ = 0x10007FFF;
1517
define symbol __region_CRASH_DATA_RAM_start__ = 0x20000000;
1618
define symbol __region_CRASH_DATA_RAM_end__ = 0x200000FF;
@@ -20,9 +22,10 @@ define symbol __region_SRAM1_end__ = 0x20017FFF;
2022
/* Memory regions */
2123
define memory mem with size = 4G;
2224
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
23-
define region SRAM2_region = mem:[from __region_SRAM2_start__ to __region_SRAM2_end__];
25+
define region CSTACK_region = mem:[from __region_CSTACK_start__ to __region_CSTACK_end__];
2426
define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__ to __region_CRASH_DATA_RAM_end__];
25-
define region SRAM1_region = mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
27+
define region RAM_region = mem:[from __region_SRAM2_start__ to __region_SRAM2_end__]
28+
| mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
2629

2730
/* Define Crash Data Symbols */
2831
define exported symbol __CRASH_DATA_RAM_START__ = __region_CRASH_DATA_RAM_start__;
@@ -35,13 +38,13 @@ if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
3538
define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
3639
define symbol __size_heap__ = 0x10000;
3740
define block CSTACK with alignment = 8, size = __size_cstack__ { };
38-
define block HEAP with alignment = 8, size = __size_heap__ { };
41+
define block HEAP with expanding size, alignment = 8, minimum size = __size_heap__ { };
3942

4043
initialize by copy with packing = zeros { readwrite };
4144
do not initialize { section .noinit };
4245

4346
place at address mem:__intvec_start__ { readonly section .intvec };
4447

4548
place in ROM_region { readonly };
46-
place in SRAM1_region { readwrite, block HEAP };
47-
place in SRAM2_region { block CSTACK };
49+
place in CSTACK_region { block CSTACK };
50+
place in RAM_region { block HEAP, readwrite, zeroinit };

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/device/TOOLCHAIN_IAR/stm32l486xx.icf

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
1010
/* Vector table dynamic copy: Total: 98 vectors * 4 = 392 bytes (0x188) to be reserved in RAM */
1111
define symbol __NVIC_start__ = 0x10000000;
1212
define symbol __NVIC_end__ = 0x10000187;
13-
define symbol __region_SRAM2_start__ = 0x10000188;
13+
define symbol __region_CSTACK_start__ = 0x10000188;
14+
define symbol __region_CSTACK_end__ = __region_CSTACK_start__ + MBED_BOOT_STACK_SIZE;
15+
define symbol __region_SRAM2_start__ = __region_CSTACK_end__;
1416
define symbol __region_SRAM2_end__ = 0x10007FFF;
1517
define symbol __region_CRASH_DATA_RAM_start__ = 0x20000000;
1618
define symbol __region_CRASH_DATA_RAM_end__ = 0x200000FF;
@@ -20,9 +22,10 @@ define symbol __region_SRAM1_end__ = 0x20017FFF;
2022
/* Memory regions */
2123
define memory mem with size = 4G;
2224
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
23-
define region SRAM2_region = mem:[from __region_SRAM2_start__ to __region_SRAM2_end__];
25+
define region CSTACK_region = mem:[from __region_CSTACK_start__ to __region_CSTACK_end__];
2426
define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__ to __region_CRASH_DATA_RAM_end__];
25-
define region SRAM1_region = mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
27+
define region RAM_region = mem:[from __region_SRAM2_start__ to __region_SRAM2_end__]
28+
| mem:[from __region_SRAM1_start__ to __region_SRAM1_end__];
2629

2730
/* Define Crash Data Symbols */
2831
define exported symbol __CRASH_DATA_RAM_START__ = __region_CRASH_DATA_RAM_start__;
@@ -35,13 +38,13 @@ if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
3538
define symbol __size_cstack__ = MBED_BOOT_STACK_SIZE;
3639
define symbol __size_heap__ = 0x10000;
3740
define block CSTACK with alignment = 8, size = __size_cstack__ { };
38-
define block HEAP with alignment = 8, size = __size_heap__ { };
41+
define block HEAP with expanding size, alignment = 8, minimum size = __size_heap__ { };
3942

4043
initialize by copy with packing = zeros { readwrite };
4144
do not initialize { section .noinit };
4245

4346
place at address mem:__intvec_start__ { readonly section .intvec };
4447

4548
place in ROM_region { readonly };
46-
place in SRAM1_region { readwrite, block HEAP };
47-
place in SRAM2_region { block CSTACK };
49+
place in CSTACK_region { block CSTACK };
50+
place in RAM_region { block HEAP, readwrite, zeroinit };

0 commit comments

Comments
 (0)