How to set Stack size for MK20DX128 in eclipse?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set Stack size for MK20DX128 in eclipse?

2,039 Views
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.

Labels (1)
Tags (2)
0 Kudos
Reply
3 Replies

1,145 Views
Pixo
Contributor I

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

1,145 Views
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

1,145 Views
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 Kudos
Reply