Skip to content

Commit e54be4a

Browse files
Deepika0xc0170
authored andcommitted
Add Dynamic heap support to IAR
Two new block properties available in linker configuration files: "expanding size" and "minimum size" for IAR 8.11.2 and above Sample: define block HEAP with expanding size, minimum size = 16K, alignment = 8 {}; This block will expand to consume all remaining available space in the range where it is placed. If several such blocks end up in the same range, they will share the remaining space. Cannot place a block with expanding size inside another block with expanding size, inside a block with maximum size, or inside an overlay.
1 parent 5501947 commit e54be4a

File tree

35 files changed

+38
-35
lines changed

35 files changed

+38
-35
lines changed

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ initialize by copy { readwrite };
6363
do not initialize { section .noinit };
6464

6565
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
66-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
66+
define block HEAP with expanding size, minimum size = __ICFEDIT_size_heap__, alignment = 8 { };
6767

6868
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
6969
place in ROM_region { readonly };

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M0P/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ initialize by copy { readwrite };
6363
do not initialize { section .noinit };
6464

6565
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
66-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
66+
define block HEAP with expanding size, minimum size = __ICFEDIT_size_heap__, alignment = 8 { };
6767

6868
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
6969
place in ROM_region { readonly };

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M3/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ initialize by copy { readwrite };
6363
do not initialize { section .noinit };
6464

6565
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
66-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
66+
define block HEAP with expanding size, minimum size = __ICFEDIT_size_heap__, alignment = 8 { };
6767

6868
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
6969
place in ROM_region { readonly };

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M4/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ initialize by copy { readwrite };
6363
do not initialize { section .noinit };
6464

6565
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
66-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
66+
define block HEAP with expanding size, minimum size = __ICFEDIT_size_heap__, alignment = 8 { };
6767

6868
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
6969
place in ROM_region { readonly };

targets/TARGET_ARM_FM/TARGET_FVP_MPS2/TARGET_FVP_MPS2_M7/device/TOOLCHAIN_IAR/MPS2.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ initialize by copy { readwrite };
6363
do not initialize { section .noinit };
6464

6565
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
66-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
66+
define block HEAP with expanding size, minimum size = __ICFEDIT_size_heap__, alignment = 8 { };
6767

6868
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
6969
place in ROM_region { readonly };

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/TOOLCHAIN_IAR/ADuCM3029.icf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ define region RAM_bank1_region = mem:[from 0x20000200 size 0x00003E00
5454
define region RAM_bank2_region = mem:[from 0x20004000 size 0x00004000]
5555
| mem:[from 0x20040000 size 0x00007000];
5656
define block CSTACK with alignment = 16, size = MBED_BOOT_STACK_SIZE { };
57-
define block HEAP with alignment = 16, size = 0x2000 { };
57+
define block HEAP with expanding size, minimum size = 0x2000, alignment = 16 { };
58+
5859
do not initialize { section .noinit };
5960
initialize by copy { rw };
6061
place at start of ROM_PAGE0_INTVEC { ro section .vectors };

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/TOOLCHAIN_IAR/ADuCM4050.icf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ define region ROM_REGION = mem:[from MBED_APP_START+ADUCM_SECTO
5353
define region RAM_bank1_region = mem:[from 0x20040000 size 0x00008000];
5454
define region RAM_bank2_region = mem:[from 0x20000200 size 0x00006E00]
5555
| mem:[from 0x20048000 size 0x00010000];
56+
5657
define block CSTACK with alignment = 16, size = MBED_BOOT_STACK_SIZE { };
57-
define block HEAP with alignment = 16, size = 0x6000 { };
58+
define block HEAP with expanding size, minimum size = 0x6000, alignment = 16 { };
59+
5860
do not initialize { section .noinit };
5961
initialize by copy { rw };
6062
place at start of ROM_PAGE0_INTVEC { ro section .vectors };

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/TARGET_CY8C63XX/TARGET_MCU_PSOC6_M0/device/TOOLCHAIN_IAR/cy8c6xx7_cm0plus.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ define region IRAM1_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFED
148148

149149
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
150150
define block PROC_STACK with alignment = 8, size = __ICFEDIT_size_proc_stack__ { };
151-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
151+
define block HEAP with expanding size, minimum size = __ICFEDIT_size_heap__, alignment = 8 { };
152152
define block HSTACK {block HEAP, block PROC_STACK, last block CSTACK};
153153
define block RO {first section .intvec, readonly};
154154

targets/TARGET_Cypress/TARGET_PSOC6_FUTURE/TARGET_CY8C63XX/TARGET_MCU_PSOC6_M4/device/TOOLCHAIN_IAR/cy8c6xx7_cm4_dual.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ define region IRAM1_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFED
148148

149149
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
150150
define block PROC_STACK with alignment = 8, size = __ICFEDIT_size_proc_stack__ { };
151-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
151+
define block HEAP with expanding size, minimum size = __ICFEDIT_size_heap__, alignment = 8 { };
152152
define block HSTACK {block HEAP, block PROC_STACK, last block CSTACK};
153153
define block RO {first section .intvec, readonly};
154154

targets/TARGET_GigaDevice/TARGET_GD32F30X/TARGET_GD32F307VG/device/TOOLCHAIN_IAR/gd32f307vg.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFED
2727
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
2828

2929
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
30-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
30+
define block HEAP with expanding size, minimum size = __ICFEDIT_size_heap__, alignment = 8 { };
3131

3232
initialize by copy { readwrite };
3333
do not initialize { section .noinit };

0 commit comments

Comments
 (0)