This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

msp432 如何设置栈的大小

目前编译器采用 IAR for  ARM 8.30.1 ,

设置栈大小为12K:

"A0": place at 0x0 { ro section .intvec };
"P1": place in [from 0x0 to 0x3'ffff] { ro };
define block CSTACK with size = 12K, alignment = 8 { };
define block PROC_STACK with size = 0M, alignment = 8 { };
define block HEAP with size = 8K, alignment = 8 { };
"P3": place in [from 0x0 to 0x0] |
[from 0x2000'0000 to 0x2000'ffff] {
rw, block CSTACK, block PROC_STACK, block HEAP };
do not initialize { section .noinit };
initialize by copy { rw };

设置栈大小为256:

"A0": place at 0x0 { ro section .intvec };
"P1": place in [from 0x0 to 0x3'ffff] { ro };
define block CSTACK with size = 256, alignment = 8 { };
define block PROC_STACK with size = 0M, alignment = 8 { };
define block HEAP with size = 1K, alignment = 8 { };
"P3": place in [from 0x0 to 0x0] |
[from 0x2000'0000 to 0x2000'ffff] {
rw, block CSTACK, block PROC_STACK, block HEAP };
do not initialize { section .noinit };
initialize by copy { rw };

对比发现,修改栈大小对程序运行,没有影响,无法解决内存溢出问题;

修改启动文件这个数组,却有一定效果,请问这个数值的作用是什么?????

//static uint32_t systemStack[128] @ ".noinit";
static uint32_t systemStack[300] @ ".noinit";