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

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

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

Jump to solution
714 Views
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?

0 Kudos
1 Solution
385 Views
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.

View solution in original post

0 Kudos
3 Replies
385 Views
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 Kudos
386 Views
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 Kudos
385 Views
alejandrolozan1
NXP Employee
NXP Employee

Thanks a lot Bill!!

Best Regards,

Alejandro