Bug Report: Cortex-A5 PSP boot.S interrupt stack.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Bug Report: Cortex-A5 PSP boot.S interrupt stack.

跳至解决方案
1,524 次查看
billpringlemeir
Contributor V

I think that we need to use 'R0' and not 'R1' as it is not set anywhere.  It probably doesn't matter much as interrupts should be disabled until the actual interrupt stack is setup latter.  This is line 143 of MQX4.0.2 and 139 of MQX-4.1 in boot.S.  Is this where I should report issues or is there some SPR system?  Am I allowed to show the code lines or does this violate the MQX license?

标记 (3)
0 项奖励
回复
1 解答
1,195 次查看
billpringlemeir
Contributor V
diff --git a/mqx/source/psp/cortex_a/core/A5/boot.S b/mqx/source/psp/cortex_a/core/A5/boot.S
index 7ae8de3..f2b33f1 100644
--- a/mqx/source/psp/cortex_a/core/A5/boot.S
+++ b/mqx/source/psp/cortex_a/core/A5/boot.S
@@ -131,12 +131,12 @@ ASM_LABEL(reset)
 
                 /* set fast interrupt (FIQ) mode stack */
                 msr cpsr_c, #PSP_PSR_MODE_FIQ | PSP_PSR_CTRL_DIS_FIQ | PSP_PSR_CTRL_DIS_IRQ
                 ldr sp, =FIQ_STACK_ADDR
 
                 /* set interrupt (IRQ) mode stack */
                 msr cpsr_c, #PSP_PSR_MODE_IRQ | PSP_PSR_CTRL_DIS_FIQ | PSP_PSR_CTRL_DIS_IRQ
                 ldr r0, =__BOOT_STACK_ADDRESS
-                mov sp, r1
+                mov sp, r0
 
                 /* set abort mode stack */
                 msr cpsr_c, #PSP_PSR_MODE_ABORT | PSP_PSR_CTRL_DIS_FIQ | PSP_PSR_CTRL_DIS_IRQ
                 msr cpsr_c, #PSP_PSR_MODE_ABORT | PSP_PSR_CTRL_DIS_FIQ | PSP_PSR_CTRL_DIS_IRQ

Later, the value 'r1' is updated, but at this point in the code, the value is random from reset.  There is also some commented code before that was attempting to set 'r1', but it is not active in MQX-4.1.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,195 次查看
alejandrolozan1
NXP Employee
NXP Employee

Hi Bill,

You can share the correction here, there is no issue or problem about it.

Best Regards,

Alejandro

0 项奖励
回复
1,196 次查看
billpringlemeir
Contributor V
diff --git a/mqx/source/psp/cortex_a/core/A5/boot.S b/mqx/source/psp/cortex_a/core/A5/boot.S
index 7ae8de3..f2b33f1 100644
--- a/mqx/source/psp/cortex_a/core/A5/boot.S
+++ b/mqx/source/psp/cortex_a/core/A5/boot.S
@@ -131,12 +131,12 @@ ASM_LABEL(reset)
 
                 /* set fast interrupt (FIQ) mode stack */
                 msr cpsr_c, #PSP_PSR_MODE_FIQ | PSP_PSR_CTRL_DIS_FIQ | PSP_PSR_CTRL_DIS_IRQ
                 ldr sp, =FIQ_STACK_ADDR
 
                 /* set interrupt (IRQ) mode stack */
                 msr cpsr_c, #PSP_PSR_MODE_IRQ | PSP_PSR_CTRL_DIS_FIQ | PSP_PSR_CTRL_DIS_IRQ
                 ldr r0, =__BOOT_STACK_ADDRESS
-                mov sp, r1
+                mov sp, r0
 
                 /* set abort mode stack */
                 msr cpsr_c, #PSP_PSR_MODE_ABORT | PSP_PSR_CTRL_DIS_FIQ | PSP_PSR_CTRL_DIS_IRQ
                 msr cpsr_c, #PSP_PSR_MODE_ABORT | PSP_PSR_CTRL_DIS_FIQ | PSP_PSR_CTRL_DIS_IRQ

Later, the value 'r1' is updated, but at this point in the code, the value is random from reset.  There is also some commented code before that was attempting to set 'r1', but it is not active in MQX-4.1.

0 项奖励
回复
1,195 次查看
alejandrolozan1
NXP Employee
NXP Employee

Thanks a lot Bill!!

Best Regards,

Alejandro