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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

798件の閲覧回数
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

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 返信

673件の閲覧回数
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 件の賞賛
返信