Skip to content

Commit da3d347

Browse files
committed
TARGET_WIZNET: ISR stack size unification
Unify ISR stack size for targets which support MBED 5 (or MBED 2 and MBED 5). MBED 5 : 0 boards ---------------- MBED 2, 5 : 3 boards ---------------- WIZWIKI_W7500ECO WIZWIKI_W7500P WIZWIKI_W7500 MBED 2 : 0 boards (skipped) ----------------
1 parent eb31883 commit da3d347

File tree

10 files changed

+73
-30
lines changed

10 files changed

+73
-30
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
#! armcc -E
2+
#include "mbed_config.h"
13
; *************************************************************
24
; *** Scatter-Loading Description File generated by uVision ***
35
; *************************************************************
46

7+
#if (defined(__stack_size__))
8+
#define Stack_Size __stack_size__
9+
#else
10+
#if (defined(MBED_CONF_RTOS_PRESENT))
11+
#define Stack_Size 0x0400
12+
#else
13+
#define Stack_Size 0x1000
14+
#endif
15+
#endif
16+
517
LR_IROM1 0x00000000 0x00020000 { ; load region size_region
618
ER_IROM1 0x00000000 0x00020000 { ; load address = execution address
719
*.o (RESET, +First)
@@ -11,5 +23,8 @@ LR_IROM1 0x00000000 0x00020000 { ; load region size_region
1123
RW_IRAM1 0x20000000 0x00004000 { ; RW data
1224
.ANY (+RW +ZI)
1325
}
26+
27+
ARM_LIB_STACK 0x20000000+0x00004000 EMPTY -Stack_Size { ; Stack region growing down
28+
}
1429
}
1530

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ SECTIONS
128128
__end__ = .;
129129
end = __end__;
130130
*(.heap*)
131+
. = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size;
131132
__HeapLimit = .;
132133
} > RAM
133134

@@ -137,13 +138,14 @@ SECTIONS
137138
.stack_dummy (COPY):
138139
{
139140
*(.stack*)
141+
. += Stack_Size;
140142
} > RAM
141143

142144

143145
/* Set stack top to end of RAM, and stack limit move down by
144146
* size of stack_dummy section */
145147
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
146-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
148+
__StackLimit = __StackTop - Stack_Size;
147149
PROVIDE(__stack = __StackTop);
148150

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

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_GCC_ARM/startup_W7500.S

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,16 @@
5050
#ifdef __STACK_SIZE
5151
.equ Stack_Size, __STACK_SIZE
5252
#else
53-
.equ Stack_Size, 0x200
53+
#if defined(MBED_CONF_RTOS_PRESENT)
54+
.equ Stack_Size, 0x400
55+
#else
56+
.equ Stack_Size, 0x1000
57+
#endif
5458
#endif
5559
.globl __StackTop
5660
.globl __StackLimit
5761
__StackLimit:
58-
.space Stack_Size
62+
.globl Stack_Size
5963
.size __StackLimit, . - __StackLimit
6064
__StackTop:
6165
.size __StackTop, . - __StackTop

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
#! armcc -E
2+
#include "mbed_config.h"
13
; *************************************************************
24
; *** Scatter-Loading Description File generated by uVision ***
35
; *************************************************************
46

7+
#if (defined(__stack_size__))
8+
#define Stack_Size __stack_size__
9+
#else
10+
#if (defined(MBED_CONF_RTOS_PRESENT))
11+
#define Stack_Size 0x0400
12+
#else
13+
#define Stack_Size 0x1000
14+
#endif
15+
#endif
16+
517
LR_IROM1 0x00000000 0x00020000 { ; load region size_region
618
ER_IROM1 0x00000000 0x00020000 { ; load address = execution address
719
*.o (RESET, +First)
@@ -11,5 +23,8 @@ LR_IROM1 0x00000000 0x00020000 { ; load region size_region
1123
RW_IRAM1 0x20000000 0x00004000 { ; RW data
1224
.ANY (+RW +ZI)
1325
}
26+
27+
ARM_LIB_STACK 0x20000000+0x00004000 EMPTY -Stack_Size { ; Stack region growing down
28+
}
1429
}
1530

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ SECTIONS
128128
__end__ = .;
129129
end = __end__;
130130
*(.heap*)
131+
. = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size;
131132
__HeapLimit = .;
132133
} > RAM
133134

@@ -137,13 +138,14 @@ SECTIONS
137138
.stack_dummy (COPY):
138139
{
139140
*(.stack*)
141+
. += Stack_Size;
140142
} > RAM
141143

142144

143145
/* Set stack top to end of RAM, and stack limit move down by
144146
* size of stack_dummy section */
145147
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
146-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
148+
__StackLimit = __StackTop - Stack_Size;
147149
PROVIDE(__stack = __StackTop);
148150

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

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500ECO/device/TOOLCHAIN_GCC_ARM/startup_W7500.S

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,16 @@
5050
#ifdef __STACK_SIZE
5151
.equ Stack_Size, __STACK_SIZE
5252
#else
53-
.equ Stack_Size, 0x200
53+
#if defined(MBED_CONF_RTOS_PRESENT)
54+
.equ Stack_Size, 0x400
55+
#else
56+
.equ Stack_Size, 0x1000
57+
#endif
5458
#endif
5559
.globl __StackTop
5660
.globl __StackLimit
5761
__StackLimit:
58-
.space Stack_Size
62+
.globl Stack_Size
5963
.size __StackLimit, . - __StackLimit
6064
__StackTop:
6165
.size __StackTop, . - __StackTop

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1+
#! armcc -E
2+
#include "mbed_config.h"
3+
14
; *************************************************************
25
; *** Scatter-Loading Description File generated by uVision ***
36
; *************************************************************
47

8+
#if (defined(__stack_size__))
9+
#define Stack_Size __stack_size__
10+
#else
11+
#if (defined(MBED_CONF_RTOS_PRESENT))
12+
#define Stack_Size 0x0400
13+
#else
14+
#define Stack_Size 0x1000
15+
#endif
16+
#endif
17+
518
LR_IROM1 0x00000000 0x00020000 { ; load region size_region
619
ER_IROM1 0x00000000 0x00020000 { ; load address = execution address
720
*.o (RESET, +First)
@@ -11,5 +24,8 @@ LR_IROM1 0x00000000 0x00020000 { ; load region size_region
1124
RW_IRAM1 0x20000000 0x00004000 { ; RW data
1225
.ANY (+RW +ZI)
1326
}
27+
28+
ARM_LIB_STACK 0x20000000+0x00004000 EMPTY -Stack_Size { ; Stack region growing down
29+
}
1430
}
1531

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ SECTIONS
129129
end = __end__;
130130
*(.heap*)
131131
__HeapLimit = .;
132+
. = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size;
132133
} > RAM
133134

134135
/* .stack_dummy section doesn't contains any symbols. It is only
@@ -137,13 +138,14 @@ SECTIONS
137138
.stack_dummy (COPY):
138139
{
139140
*(.stack*)
141+
. += Stack_Size;
140142
} > RAM
141143

142144

143145
/* Set stack top to end of RAM, and stack limit move down by
144146
* size of stack_dummy section */
145147
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
146-
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
148+
__StackLimit = __StackTop - Stack_Size;
147149
PROVIDE(__stack = __StackTop);
148150

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

targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500P/device/TOOLCHAIN_GCC_ARM/startup_W7500.S

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,16 @@
5050
#ifdef __STACK_SIZE
5151
.equ Stack_Size, __STACK_SIZE
5252
#else
53-
.equ Stack_Size, 0x200
53+
#if defined(MBED_CONF_RTOS_PRESENT)
54+
.equ Stack_Size, 0x400
55+
#else
56+
.equ Stack_Size, 0x1000
57+
#endif
5458
#endif
5559
.globl __StackTop
5660
.globl __StackLimit
5761
__StackLimit:
58-
.space Stack_Size
62+
.globl Stack_Size
5963
.size __StackLimit, . - __StackLimit
6064
__StackTop:
6165
.size __StackTop, . - __StackTop

targets/TARGET_WIZNET/mbed_rtx.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,4 @@
1717
#ifndef MBED_MBED_RTX_H
1818
#define MBED_MBED_RTX_H
1919

20-
#if defined(TARGET_WIZWIKI_W7500)
21-
22-
#ifndef INITIAL_SP
23-
#define INITIAL_SP (0x20004000UL)
24-
#endif
25-
26-
#elif defined(TARGET_WIZWIKI_W7500P)
27-
28-
#ifndef INITIAL_SP
29-
#define INITIAL_SP (0x20004000UL)
30-
#endif
31-
32-
33-
#elif defined(TARGET_WIZWIKI_W7500ECO)
34-
35-
#ifndef INITIAL_SP
36-
#define INITIAL_SP (0x20004000UL)
37-
#endif
38-
39-
#endif //
40-
4120
#endif // MBED_MBED_RTX_H

0 commit comments

Comments
 (0)