I want to know about exception priority.
In following situation
when following sequence is occurred.
My Question is how does the Cortex-M33 know correct priority number(priority B in above sequence #6)
This is a combination of the context being saved on the "stack" and the LR containing the proper EXC_RETURN value so that the proper context gets restored.
USP and Thread Mode to start.
Execption C, context saved on USP and LR set proper to restore from there and Thread Mode - on EXC_RETURN will return to USP and Thread Mode
MSP and Handler Mode
Exception B, context saved on MSP and LR set proper to restore from there and Handler Mode + Priority C on EXC_RETURN will return to MSP Handler Priority C
Exception A, context saved on MSP and LR set proper to restore from there and Handler Mode + Priority B On EXC_RETURN will return to MSP Handler Priority B
Thank you for your reply, But I want to clear more.In the Exception B handler on priority B, then Exception A occurrs, priority will be Priority A.To restore priority B when back from Exception A. Where is location to save Priority-B?
I Think the saved context which you mentioned is right place to save current priority(Priority-B in above situation).But I Could not find out.
Please show me more details.
The "Current Exception Number" is in the xPSR (Special Purpose Program Status Register)
When there is a new exception taken, this is one of the registers that is saved on the stack. On Return, this register is "restored". The Exception Number restored indicates which priority should also be "restored"
Thank you for the additional explanation. I understood priority determination mechanism.
View all questions in Cortex-M / M-Profile forum