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 :https://community.nxp.com/thread/440700#comment-860538. 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.
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.