Skip to content

Commit c99dc34

Browse files
committed
Nuvoton: Support dynamic heap configuration on IAR
On IAR, configure heap to 1KiB at a minimum and expandable, dependent on available SRAM. This requires IAR 8.x. Support targets: - NUMAKER_PFM_NUC472 w/ and w/o XRAM - NUMAKER_PFM_M453 - NUMAKER_PFM_M487/NUMAKER_IOT_M487 - NUMAKER_IOT_M263A - NUMAKER_M252KG
1 parent 06734e0 commit c99dc34

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

targets/TARGET_NUVOTON/TARGET_M251/device/TOOLCHAIN_IAR/M251.icf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ define symbol __ICFEDIT_region_IRAM_end__ = MBED_RAM_APP_START + MBED_RAM_
5151

5252
/*-Sizes-*/
5353
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
54-
define symbol __ICFEDIT_size_heap__ = 0x4000;
54+
define symbol __ICFEDIT_size_heap__ = 0x400;
5555

5656

5757
/**** End of ICF editor section. ###ICF###*/
@@ -62,7 +62,7 @@ define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFE
6262
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM_start__ to __ICFEDIT_region_IRAM_end__];
6363

6464
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
65-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
65+
define block HEAP with expanding size, alignment = 8, minimum size = __ICFEDIT_size_heap__ { };
6666
/* NOTE: Vector table base address is required to be 128-byte aligned at a minimum.
6767
* A PE might impose further restrictions on it. */
6868
define block IRAMVEC with alignment = 1024, size = 4 * (16 + 64) { };

targets/TARGET_NUVOTON/TARGET_M261/device/TOOLCHAIN_IAR/M261.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ define symbol __region_CRASH_DATA_RAM_end__ = 0x20018000 - 1;
3434
/*-Sizes-*/
3535
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
3636
define symbol __ICFEDIT_size_intvec__ = (4 * (16 + 102));
37-
define symbol __ICFEDIT_size_heap__ = 0x8000;
37+
define symbol __ICFEDIT_size_heap__ = 0x400;
3838
/**** End of ICF editor section. ###ICF###*/
3939

4040

@@ -43,8 +43,8 @@ define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFED
4343
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM_start__ to __ICFEDIT_region_IRAM_end__];
4444
define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__ to __region_CRASH_DATA_RAM_end__];
4545

46-
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
47-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
46+
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
47+
define block HEAP with expanding size, alignment = 8, minimum size = __ICFEDIT_size_heap__ { };
4848
/* NOTE: Vector table base requires to be aligned to the power of vector table size. Give a safe value here. */
4949
define block IRAMVEC with alignment = 1024, size = __ICFEDIT_size_intvec__ { };
5050

targets/TARGET_NUVOTON/TARGET_M451/device/TOOLCHAIN_IAR/M453.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ define symbol __ICFEDIT_region_IRAM_start__ = 0x20000000;
1313
define symbol __ICFEDIT_region_IRAM_end__ = 0x20008000 - 1;
1414
/*-Sizes-*/
1515
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
16-
define symbol __ICFEDIT_size_heap__ = 0x4000;
16+
define symbol __ICFEDIT_size_heap__ = 0x400;
1717
/**** End of ICF editor section. ###ICF###*/
1818

1919

2020
define memory mem with size = 4G;
2121
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
2222
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM_start__ to __ICFEDIT_region_IRAM_end__];
2323

24-
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
25-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
24+
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
25+
define block HEAP with expanding size, alignment = 8, minimum size = __ICFEDIT_size_heap__ { };
2626
/* NOTE: Vector table base requires to be aligned to the power of vector table size. Give a safe value here. */
2727
define block IRAMVEC with alignment = 1024, size = 4 * (16 + 64) { };
2828

targets/TARGET_NUVOTON/TARGET_M480/device/TOOLCHAIN_IAR/M487.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ define symbol __region_CRASH_DATA_RAM_end__ = 0x20028000 - 1;
1616
/*-Sizes-*/
1717
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
1818
define symbol __ICFEDIT_size_intvec__ = (4 * (16 + 96));
19-
define symbol __ICFEDIT_size_heap__ = 0x10000;
19+
define symbol __ICFEDIT_size_heap__ = 0x400;
2020
/**** End of ICF editor section. ###ICF###*/
2121

2222

@@ -25,8 +25,8 @@ define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFED
2525
define region IRAM_region = mem:[from __ICFEDIT_region_IRAM_start__ to __ICFEDIT_region_IRAM_end__];
2626
define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__ to __region_CRASH_DATA_RAM_end__];
2727

28-
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
29-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
28+
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
29+
define block HEAP with expanding size, alignment = 8, minimum size = __ICFEDIT_size_heap__ { };
3030
/* NOTE: Vector table base requires to be aligned to the power of vector table size. Give a safe value here. */
3131
define block IRAMVEC with alignment = 1024, size = __ICFEDIT_size_intvec__ { };
3232

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_IAR/TARGET_NU_XRAM_SUPPORTED/NUC472_442.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ define symbol __ICFEDIT_region_XRAM_start__ = 0x60000000;
1717
define symbol __ICFEDIT_region_XRAM_end__ = 0x60100000 - 1;
1818
/*-Sizes-*/
1919
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
20-
define symbol __ICFEDIT_size_heap__ = 0xC0000;
20+
define symbol __ICFEDIT_size_heap__ = 0x400;
2121
/**** End of ICF editor section. ###ICF###*/
2222

2323

@@ -31,8 +31,8 @@ define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__
3131
define exported symbol __CRASH_DATA_RAM_START__ = __region_CRASH_DATA_RAM_start__;
3232
define exported symbol __CRASH_DATA_RAM_END__ = __region_CRASH_DATA_RAM_end__;
3333

34-
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
35-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
34+
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
35+
define block HEAP with expanding size, alignment = 8, minimum size = __ICFEDIT_size_heap__ { };
3636
/* NOTE: Vector table base requires to be aligned to the power of vector table size. Give a safe value here. */
3737
define block IRAMVEC with alignment = 1024, size = 4 * (16 + 142) { };
3838
/* Move non-critical libraries to external SRAM while internal SRAM is insufficient. */

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_IAR/TARGET_NU_XRAM_UNSUPPORTED/NUC472_442.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ define symbol __region_CRASH_DATA_RAM_start__ = 0x2000FF00;
1515
define symbol __region_CRASH_DATA_RAM_end__ = 0x20010000 - 1;
1616
/*-Sizes-*/
1717
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
18-
define symbol __ICFEDIT_size_heap__ = 0x8000;
18+
define symbol __ICFEDIT_size_heap__ = 0x400;
1919
/**** End of ICF editor section. ###ICF###*/
2020

2121

@@ -28,8 +28,8 @@ define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__
2828
define exported symbol __CRASH_DATA_RAM_START__ = __region_CRASH_DATA_RAM_start__;
2929
define exported symbol __CRASH_DATA_RAM_END__ = __region_CRASH_DATA_RAM_end__;
3030

31-
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
32-
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
31+
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
32+
define block HEAP with expanding size, alignment = 8, minimum size = __ICFEDIT_size_heap__ { };
3333
/* NOTE: Vector table base requires to be aligned to the power of vector table size. Give a safe value here. */
3434
define block IRAMVEC with alignment = 1024, size = 4 * (16 + 142) { };
3535

0 commit comments

Comments
 (0)