Bug in _mqx_init_interrupt_stack() when using bootloader (KSDK 1.2.0)

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

Bug in _mqx_init_interrupt_stack() when using bootloader (KSDK 1.2.0)

514 Views
priya_dwivedula
Contributor III

I found a bug in _mqx_init_interrupt_stack() routine where the stack base address is obtained from this line of code.
stack_ptr = (_mqx_uint)*(_mqx_uint*)0x0; /* Get stack base address located on interrupt vector 0. */

 

Since the interrupt vector relocates to a different address (for instance, 0xa000) when using a bootloader, the above line would result in an incorrect value for stack_ptr which in turn results in incorrect INIT.INTERRUPT_STACK_SIZE. This was causing a hard-fault in my case when _sched_start_internal() is called. The right way to fix it is to get the stack base address from VTOR as below.

stack_ptr = (_mqx_uint)*(_mqx_uint*)SCB->VTOR;

 

By the way, I was using FRDM-K22F board with freedom bootloader to debug this issue and I also noticed that this issue is fixed in KSDK 1.3.0.

 

Thanks,
Priya

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

389 Views
ivadorazinova
NXP Employee
NXP Employee

Hi Priya,

Thank you for your feedback.

This issue should be fixed in KSDK 1.3.

Have a great day!

Iva

0 Kudos
Reply