I am using S12ZVML64 MCU.
I have not implemented the machine exception ISR in my code.
Then,I want to know that,
what will be the behavior of code if machine exception occurred in software?
Thanks in advance.
I would like to mention that the Machine Exception is not a standard interrupt.
"machine exception causes the CPU to not perform any stack operations, so it is not possible to return to application code by simply using an RTI instruction."
For more details, please, refer to the S12ZCPU RM section "7.3.3 Machine Exception"
The Machine Exception routine will result in a crash. The interrupt can be used for MCU reset. Also, it is useful for debugging and check what is the source of the machine exception before the crash.
I hope it helps.
Thank you for the response.
I understand the routine will result in crash.
I have a few queries regarding the term crash.
Q1. What exactly does it mean? Will the software behaviour be known or unknown.?
Q2. From the CPU RM : "A Machine Exception causes the S12Z CPU to jump to the address in the Machine Exception vector as
soon as the current instruction finishes execution."
- Now considering that I have not defined the handler of machine exception in my software, when the CPU jumps to the vector of machine exception, it will not find any code to execute . So will CPU try to execute the code/opcode which is present and what is the effect of executing such pre-existing code/opcode ? and is it known what opcode/code is present in such scenario? [example : 0xFF(erased)]. I am not sure it is just an example.
Can you please clarify, if possible on those queries?
I have made some tests and when the handler is not defined the code jumps at the 0xFFFFFF address (defined by the erased machine exception vector) which triggers another machine exception.
See the note in the S12ZCPU RM below:
I hope it helps.
I understood the above obsevration
So, does it mean that recursive machine exception will be thrown(issued) and the execution of code will be stuck at this erased machine exception vector (0xFFFFFF)