How to Change Interrupt Stack Size in MCUXpressoIDE?

Showing results for 
Search instead for 
Did you mean: 

How to Change Interrupt Stack Size in MCUXpressoIDE?

Contributor I


I am using MKL36Z64VLH4, with NXP SDK v2.0.4 and MCUXpressoIDE.

I write a simple PIT example. It has an blank main() which only have a infinite while loop in it. The PIT module interrupt CPU every 1 second and it blink the led in its IRQ handler.

This is the Heap and Stack Usage when in main():


But when the interruption happens and program enter the IRQ handler:


This is strange. I assume that this is because CPU does not reserver enough stack space when it enters the handler.

So when I started to do some complex things in IRQ handler, the stack just overflowed! How to increase interrupt stack size?

I guess i am not the first guy who have this problem. In deed, I found an old solution : But It is not for MCUXpresso and doesn`t work with me either. I didn`t find anything about "__DEFAULT_INTERRUPT_STACK_SIZE" in the link file generated by MCUXpresso.

What should I do?

Thank you.

Yuhao Gu

Labels (1)
0 Kudos
1 Reply

Contributor I


I solved this problem on my own.

This problem is due to that total default ram size is only 512B (MKL36Z64VLH4 has 8KB memory). I didn`t expected that the default stack size configuration is such small. I set it to 4K and nothing goes overflowed now.

This is how I solved this problem:

Projects -> Properties -> MCU C++ Linker -> Managed Linker Script



(default setting is only 512B)


(making it bigger may solve the problem)

0 Kudos