Interrupt stack overflow K20DX CW10.5 MQX4.0

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

Interrupt stack overflow K20DX CW10.5 MQX4.0

586 Views
tjunkans
Contributor II

I'm having a CPU crash problem and I am noticing an interrupt stack overflow when I send a high rate of SPI slave interrupts to my K20.

My system is setup as an SPI slave device utilizing a kernel level SPI interrupt when the receive FIFO is not empty (~1Khz).

The system also has two external A/D's interrupting GPIO lines configured as MQX interrupt inputs (~1Khz).

No matter what I do I con not change the size of the Interrupt Stack size, always reading ~1K. Does anyone know the trick?

Thanks n advance,

TJ

0 Kudos
2 Replies

342 Views
Rick_Li
NXP Employee
NXP Employee

Hi Tom,

If you are using GCC compiler, then, the linker file is located in {MQX}\lib\(your board).cw10gcc\debug\bsp\, with file name intflash.ld.

please change the stack size by modify the code like below:

__DEFAULT_INTERRUPT_STACK_SIZE = 1024;

342 Views
yasuhikokoumoto
Senior Contributor I

Hi Tom-san,

how about modifying the linker files. For example, in the 128KB_Pflash.lcf file the stack size is defined as 1KB. To enlarge the stack size. you can change it.

    .data_bss : AT(__DATA_ROM)
    {
        __DATA_RAM     = .;
        *(.data)
        *(.sdata)
        *(.relocate_code)
        *(.relocate_const)
        *(.relocate_data)
        *(.test)
        __DATA_END     = .;
        .              = ALIGN(0x10);
        __START_BSS    = .;
        *(.sbss)
        *(SCOMMON)
        *(.bss)
        *(COMMON)
        __END_BSS      = .;
        .              = ALIGN(0x10);
        __HEAP_START   = .;
        .              = . + (1 * 1024);
        __HEAP_END     = .;
        __SP_END       = .;
  .          = . + (1 * 1024); # You can change this line.
        __BOOT_STACK_ADDRESS = .;
    } > ram

Best regards,

Yasuhiko Koumoto.