Skip to content

Commit 40b0fab

Browse files
committed
[WIZNET] Support boot stack size configuration option
1 parent 13da158 commit 40b0fab

File tree

9 files changed

+69
-12
lines changed

9 files changed

+69
-12
lines changed

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_ARM_STD/W7500.sct

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#! armcc -E
2+
3+
#if !defined(MBED_BOOT_STACK_SIZE)
4+
#define MBED_BOOT_STACK_SIZE 0x400
5+
#endif
6+
7+
#define Stack_Size MBED_BOOT_STACK_SIZE
8+
19
; *************************************************************
210
; *** Scatter-Loading Description File generated by uVision ***
311
; *************************************************************
@@ -8,8 +16,10 @@ LR_IROM1 0x00000000 0x00020000 { ; load region size_region
816
*(InRoot$$Sections)
917
.ANY (+RO)
1018
}
11-
RW_IRAM1 0x20000000 0x00004000 { ; RW data
19+
RW_IRAM1 0x20000000 0x00004000-Stack_Size { ; RW data
1220
.ANY (+RW +ZI)
1321
}
22+
ARM_LIB_STACK (0x20000000+0x00004000) EMPTY -Stack_Size { ; stack
23+
}
1424
}
1525

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_GCC_ARM/W7500.ld

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
/* Linker script to configure memory regions. */
2+
3+
#if !defined(MBED_BOOT_STACK_SIZE)
4+
#define MBED_BOOT_STACK_SIZE 0x400
5+
#endif
6+
7+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
8+
29
MEMORY
310
{
411
FLASH (rx) : ORIGIN = 0x0, LENGTH = 0x20000 /* 128K */
@@ -143,7 +150,7 @@ SECTIONS
143150
/* Set stack top to end of RAM, and stack limit move down by
144151
* size of stack_dummy section */
145152
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
146-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
153+
__StackLimit = __StackTop - STACK_SIZE;
147154
PROVIDE(__stack = __StackTop);
148155

149156
/* Check if data + heap + stack exceeds RAM limit */

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_IAR/W7500_Flash.icf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
88
define symbol __ICFEDIT_region_ROM_end__ = 0x00020000;
99
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
1010
define symbol __ICFEDIT_region_RAM_end__ = 0x20004000;
11-
/*-Heap 1/4 of ram and stack 1/8-*/
12-
define symbol __ICFEDIT_size_cstack__ = 0x00000400;
11+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
12+
define symbol MBED_BOOT_STACK_SIZE = 0x400;
13+
}
14+
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
1315
define symbol __ICFEDIT_size_heap__ = 0x00000C00;
1416
/**** End of ICF editor section. ###ICF###*/
1517

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_ARM_STD/W7500.sct

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#! armcc -E
2+
3+
#if !defined(MBED_BOOT_STACK_SIZE)
4+
#define MBED_BOOT_STACK_SIZE 0x400
5+
#endif
6+
7+
#define Stack_Size MBED_BOOT_STACK_SIZE
8+
19
; *************************************************************
210
; *** Scatter-Loading Description File generated by uVision ***
311
; *************************************************************
@@ -8,8 +16,10 @@ LR_IROM1 0x00000000 0x00020000 { ; load region size_region
816
*(InRoot$$Sections)
917
.ANY (+RO)
1018
}
11-
RW_IRAM1 0x20000000 0x00004000 { ; RW data
19+
RW_IRAM1 0x20000000 0x00004000-Stack_Size { ; RW data
1220
.ANY (+RW +ZI)
1321
}
22+
ARM_LIB_STACK (0x20000000+0x00004000) EMPTY -Stack_Size { ; stack
23+
}
1424
}
1525

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_GCC_ARM/W7500.ld

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
/* Linker script to configure memory regions. */
2+
3+
#if !defined(MBED_BOOT_STACK_SIZE)
4+
#define MBED_BOOT_STACK_SIZE 0x400
5+
#endif
6+
7+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
8+
29
MEMORY
310
{
411
FLASH (rx) : ORIGIN = 0x0, LENGTH = 0x20000 /* 128K */
@@ -143,7 +150,7 @@ SECTIONS
143150
/* Set stack top to end of RAM, and stack limit move down by
144151
* size of stack_dummy section */
145152
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
146-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
153+
__StackLimit = __StackTop - STACK_SIZE;
147154
PROVIDE(__stack = __StackTop);
148155

149156
/* Check if data + heap + stack exceeds RAM limit */

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_IAR/W7500_Flash.icf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
88
define symbol __ICFEDIT_region_ROM_end__ = 0x00020000;
99
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
1010
define symbol __ICFEDIT_region_RAM_end__ = 0x20004000;
11-
/*-Heap 1/4 of ram and stack 1/8-*/
12-
define symbol __ICFEDIT_size_cstack__ = 0x00000400;
11+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
12+
define symbol MBED_BOOT_STACK_SIZE = 0x400;
13+
}
14+
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
1315
define symbol __ICFEDIT_size_heap__ = 0x00000C00;
1416
/**** End of ICF editor section. ###ICF###*/
1517

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_ARM_STD/W7500.sct

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#! armcc -E
2+
3+
#if !defined(MBED_BOOT_STACK_SIZE)
4+
#define MBED_BOOT_STACK_SIZE 0x400
5+
#endif
6+
7+
#define Stack_Size MBED_BOOT_STACK_SIZE
8+
19
; *************************************************************
210
; *** Scatter-Loading Description File generated by uVision ***
311
; *************************************************************
@@ -8,8 +16,10 @@ LR_IROM1 0x00000000 0x00020000 { ; load region size_region
816
*(InRoot$$Sections)
917
.ANY (+RO)
1018
}
11-
RW_IRAM1 0x20000000 0x00004000 { ; RW data
19+
RW_IRAM1 0x20000000 0x00004000-Stack_Size { ; RW data
1220
.ANY (+RW +ZI)
1321
}
22+
ARM_LIB_STACK (0x20000000+0x00004000) EMPTY -Stack_Size { ; stack
23+
}
1424
}
1525

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_GCC_ARM/W7500.ld

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
/* Linker script to configure memory regions. */
2+
3+
#if !defined(MBED_BOOT_STACK_SIZE)
4+
#define MBED_BOOT_STACK_SIZE 0x400
5+
#endif
6+
7+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
8+
29
MEMORY
310
{
411
FLASH (rx) : ORIGIN = 0x0, LENGTH = 0x20000 /* 128K */
@@ -143,7 +150,7 @@ SECTIONS
143150
/* Set stack top to end of RAM, and stack limit move down by
144151
* size of stack_dummy section */
145152
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
146-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
153+
__StackLimit = __StackTop - STACK_SIZE;
147154
PROVIDE(__stack = __StackTop);
148155

149156
/* Check if data + heap + stack exceeds RAM limit */

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_IAR/W7500_Flash.icf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
88
define symbol __ICFEDIT_region_ROM_end__ = 0x00020000;
99
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
1010
define symbol __ICFEDIT_region_RAM_end__ = 0x20004000;
11-
/*-Heap 1/4 of ram and stack 1/8-*/
12-
define symbol __ICFEDIT_size_cstack__ = 0x00000400;
11+
if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) {
12+
define symbol MBED_BOOT_STACK_SIZE = 0x400;
13+
}
14+
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
1315
define symbol __ICFEDIT_size_heap__ = 0x00000C00;
1416
/**** End of ICF editor section. ###ICF###*/
1517

0 commit comments

Comments
 (0)