Skip to content

Commit 5798434

Browse files
committed
TARGET_ONSEMI: 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 : 1 boards ---------------- NCS36510 MBED 2 : 0 boards (skipped) ----------------
1 parent 1af4d8b commit 5798434

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

targets/TARGET_ONSEMI/TARGET_NCS36510/device/TOOLCHAIN_ARM/NCS36510.sct

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! armcc -E
2+
#include "mbed_config.h"
23

34
LR_IROM1 0x00003000 0x0004F000 { ; load region size_region
45
ER_IROM1 0x00003000 0x0004F000 { ; load address = execution address
@@ -8,8 +9,20 @@ LR_IROM1 0x00003000 0x0004F000 { ; load region size_region
89
}
910

1011

12+
#if (defined(__stack_size__))
13+
#define Stack_Size __stack_size__
14+
#else
15+
#if (defined(MBED_CONF_RTOS_PRESENT))
16+
#define Stack_Size 0x0400
17+
#else
18+
#define Stack_Size 0x1000
19+
#endif
20+
#endif
21+
1122
RW_IRAM1 0x3FFF4000 + 0x90 { ; 8_byte_aligned(35 vectors * 4 bytes each) = 0x90
1223
.ANY(+RW +ZI)
1324
}
14-
ARM_LIB_HEAP AlignExpr(+0, 8) ALIGN 8 EMPTY (0x3FFF4000 + 0xC000 - AlignExpr(ImageLimit(RW_IRAM1),8) ) {}
25+
ARM_LIB_HEAP AlignExpr(+0, 8) ALIGN 8 EMPTY (0x3FFF4000 + 0xC000 - AlignExpr(ImageLimit(RW_IRAM1),8) - Stack_Size ) {}
26+
ARM_LIB_STACK 0x3FFF4000+0xC000 EMPTY -Stack_Size { ; Stack region growing down
27+
}
1528
}

targets/TARGET_ONSEMI/TARGET_NCS36510/device/TOOLCHAIN_GCC_ARM/NCS36510.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ MEMORY {
154154
__end__ = .;
155155
end = __end__;
156156
*(.heap*);
157-
. += 0x800;
157+
. = ORIGIN(RAM) + LENGTH(RAM) - Stack_Size - .;
158158
__HeapLimit = .;
159159
} > RAM
160160
PROVIDE(__heap_size = SIZEOF(.heap));
@@ -169,12 +169,12 @@ MEMORY {
169169
{
170170
__StackLimit = .;
171171
*(.stack*);
172-
. += 0x800 - (. - __StackLimit);
172+
. += Stack_Size;
173173
} > RAM
174174

175175
/* Set stack top to end of RAM */
176176
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
177-
__StackLimit = __StackTop - SIZEOF(.stack);
177+
__StackLimit = __StackTop - Stack_Size;
178178
PROVIDE(__stack = __StackTop);
179179

180180
}

targets/TARGET_ONSEMI/TARGET_NCS36510/device/TOOLCHAIN_GCC_ARM/startup_NCS36510.S

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,18 @@
3939
.section .stack
4040
.align 3
4141
#ifdef __STACK_SIZE
42-
.equ Stack_Size, __STACK_SIZE
42+
.equ Stack_Size, __STACK_SIZE
4343
#else
44-
.equ Stack_Size, 0x400
44+
#if defined(MBED_CONF_RTOS_PRESENT)
45+
.equ Stack_Size, 0x400
46+
#else
47+
.equ Stack_Size, 0x1000
48+
#endif
4549
#endif
4650
.globl __StackTop
4751
.globl __StackLimit
4852
__StackLimit:
49-
.space Stack_Size
53+
.globl Stack_Size
5054
.size __StackLimit, . - __StackLimit
5155
__StackTop:
5256
.size __StackTop, . - __StackTop

targets/TARGET_ONSEMI/TARGET_NCS36510/device/TOOLCHAIN_IAR/NCS36510.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ define symbol __ICFEDIT_region_ERAM3_start__ = 0x0;
2929
define symbol __ICFEDIT_region_ERAM3_end__ = 0x0;
3030

3131
/*-Sizes-*/
32-
define symbol __ICFEDIT_size_cstack__ = 0x200;
32+
define symbol __ICFEDIT_size_cstack__ = 0x400;
3333
define symbol __ICFEDIT_size_heap__ = 0x4000;
3434
/**** End of ICF editor section. ###ICF###*/
3535

targets/TARGET_ONSEMI/mbed_rtx.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919

2020
#if defined(TARGET_NCS36510)
2121

22-
#ifndef INITIAL_SP
23-
#define INITIAL_SP (0x40000000UL)
24-
#endif
25-
2622
#endif
2723

2824
#endif // MBED_MBED_RTX_H

0 commit comments

Comments
 (0)