How to Increase Interrupt Stack Size

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

How to Increase Interrupt Stack Size

Jump to solution
1,586 Views
davidzhou
Contributor V

Hi,

I have K60 Towerboard, _K60P144M150SF3RM, with MQX4.2, and CodeWarrior 10.6.4.

I debugged into my code and interrupt stack is 78% usage. And Occasionally stack gets overflowed. I want to increase interrupt stack size for safety. But using PE, it seems to me it is not enabled to increase it:

pastedImage_1.png

Is anyway to enable it? or Is there anyway I can directly change the stack size params before I recompile bsp?

Thank You

David Zhou

0 Kudos
1 Solution
1,044 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi David:

For interrupt stack size,  I would suggest you can try to modify the link file directly

C:\Freescale\Freescale_MQX_4_2\mqx\source\bsp\twrk60d100m\gcc_cw\inflash.ld

    __DEFAULT_INTERRUPT_STACK_SIZE = 1024;

Regards

Daniel

View solution in original post

0 Kudos
6 Replies
1,044 Views
BlackNight
NXP Employee
NXP Employee

Hi David,

it is because 'generate linker file' is set to 'no'. Not sure why you have this, but I think it is because you are using MQX, and with MQX the linker files are done differently?

In any case, you should be able to edit the linker (.ld) file manually.

Erich

0 Kudos
1,044 Views
davidzhou
Contributor V

Hi Erich,

I think the linker file (.ld) is created and editable if project is bare-board (without MQX).

But if an MQX4.2 project is created through the wizard, the linker file is not under the list of the project files.

Really, the question is how to increase the stack size for the MQX.4.2 project.

Thank you,

David Zhou

0 Kudos
1,044 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi David:

For bare mental, there is only one task, you can change this attribute in CPU component.

For RTOS environment, each task has it's individual stack size. For MQX, the stack size is set by MQX task template list

pastedImage_1.png

if your task is created by task component, for example, MQX lite task, it can be changed with PE. Please see the below picture.

pastedImage_2.png

Regards

Daniel

0 Kudos
1,044 Views
davidzhou
Contributor V

Hi Daniel,

The question is how to increase stack size for interrupts (under Processors) , not tasks:

pastedImage_1.png

Thank you,

David Zhou

0 Kudos
1,045 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi David:

For interrupt stack size,  I would suggest you can try to modify the link file directly

C:\Freescale\Freescale_MQX_4_2\mqx\source\bsp\twrk60d100m\gcc_cw\inflash.ld

    __DEFAULT_INTERRUPT_STACK_SIZE = 1024;

Regards

Daniel

0 Kudos
1,044 Views
davidzhou
Contributor V

Thank you Daniel !

David Zhou

0 Kudos