How to set Stack size for MK20DX128 in eclipse?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to set Stack size for MK20DX128 in eclipse?

3,335 次查看
dinaelsissy
Contributor I

Hi,

I'm developing an application on MK20DX128 using Eclipse and there seems to be a problem in the stack size. I want to set the stack size myself but I can't seem to find a way for that. I tried to overwrite the linker file but it didn't lead me to anything  I searched in the settings to check any options related to stack size but i couldn't find anything. Does anyone know where I can specify the stack size?

Thanks in advance.

标签 (1)
标记 (2)
0 项奖励
回复
3 回复数

2,438 次查看
Pixo
Contributor I

I did it using ProcessorExpert "CPU" component.  See attached file.

2,438 次查看
DavidS
NXP Employee
NXP Employee

Hi Dina,

Are you asking how to change the task stack size?

If yes, task stack size is defined in the MQX_template_list[].

const TASK_TEMPLATE_STRUCT  MQX_template_list[] =

{    /* Task Index,   Function,     Stack,  Priority,   Name,           Attributes,          Param, Time Slice */   

{          1,   flash_task,   2000,   7,          "flash_test",   MQX_AUTO_START_TASK, 0,     0 },   

{          2,   flashnvm_task,3000,   8,          "flash_nvm",    MQX_AUTO_START_TASK, 0,     0 },  

{ 0 } };

The linker file is only defining the default interrupt stack size.


Regards,

David

2,438 次查看
JimDon
Senior Contributor III

>The linker file is only defining the default interrupt stack size.


That is not really correct. Setting the stack size in the linker really just tells the linker not to include that amount of memory when allocating RAM elsewhere, and the generated startup code will set the stack pointer to that address .  "main" will use this stack, as will interrupt handlers, but really "nobody" knows how big the stack is while running (until you crash it :-).


MQX stack size is something completely different.



What exactly did you change in the lcf file, and what did you expect to see happen that you did not see happen?

Try:

__SP_INIT = . + 0x00008000; // Increase the size here...

0 项奖励
回复