Hello.
We are using m4 core in i.mx7d,
and we have an issue on RTOS like freeRTOS, exactly we use aother commercial RTOS.
The memory manage excepion or hard fault exception happen during running our program.
However, When we changed CAN/UART7 interrupt priority to lower than Systick interrupt priority,
The excptions do not happen.
So, We try to find the reson by reading the source of etnry to interrupt service routine and return from it.
Unfortunatly, We do not have enough knowlagements.
If you do not mind, Could you tell us the answers?
(1).When basepri=0x00, nested preempt interrupt can be used?
(2).When returning from interrut service routine, how is the privous state restored?
Especially, we do not know how interrupt priority is restored.
Ex.
We think about IRQ1(low) and IRQ2(high).
basepri=the priority of IRQ1(low)
(i).IRQ1 happen
save xPSR,LR,PC,r12,r3,r2,r1,r0 registers into stack.
change LR to EXC_RETURN and PC is entry for IRQ1 service routine.
(ii).IRQ2 happen ( now we do not think about tail chain. )
save xPSR,LR,PC,r12,r3,r2,r1,r0 registers into stack.
change LR to EXC_RETURN and PC is entry for IRQ2 service routine.
(iii).The IRQ2 Servcei routine finishs by "bx lr" instruction (lr=EXC_RETURN)
restore xPSR,LR,PC,r12,r3,r2,r1,r0.
and return to the state when IRQ1 service routine was running.
WHY M4 CORE CAN RETURN TO THE INTERRUPT PRIORITY TO IRQ1 SERVICE ROUTINE?
(iv).The IRQ1 Servcei routine finishs by "bx lr" instruction (lr=EXC_RETURN)
restore xPSR,LR,PC,r12,r3,r2,r1,r0.
and return to the prevous state before IRQ1 happens.
WHY M4 CORE CAN RETURN TO THE INTERRUPT PRIORITY TO THE STATE BEFORE IRQ1 HAPPEND?
(3).Is "basepri register" changed?
On the about situation.
Is "basepri register" changed at the time IRQ1, IRQ2 happen and return from IRQ1 and IRQ2 service routine?
Best regards,
Hideo Yamashiro.