How to return to code after trap occur?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User19909
Level 3
Level 3
First like received
Hello,

I am doing a fault injection to invoke a trap, however after invoking it I would like to return to the same code that generated the trap, I cant seem to return to the code whatsoever I keep returning to the trap handler and cant get to return, is there something I am missing, something I need to do in order to return?
0 Likes
3 Replies
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
What trap are you getting, how are you inducing it, and how did you declare your trap handler?
0 Likes
User19909
Level 3
Level 3
First like received
i am doing a fault injection for MPU, so a class 1 tin 3 is invoked, I invoke it by mapping a variable to a specific memory section that I know the component trying to write does not have access in MPU configuration. and the trapped is generated at the instruction its suppose to generate it.
In the trap handler I get the tin , return address, class and call a user defined trap handler, in it I would like to return to the calling code that invoked the trap at first so rfe instructions is invoked, but a context trap is generated. I tried to rfe directly from the trap handler it self, but still the context trap is generated
0 Likes
ScottW
Employee
Employee
10 sign-ins First solution authored First like received
Which context trap is generated? Calling RFE from the invoked user handler will generate a nesting error (class 3 TIN 7) because there's an extra saved context on the call chain.

RFE should work from the trap handler itself. Are you clearing the trap status flag before returning?
0 Likes