This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

undefined instruction exception

We are using ARM Toolset , Toolchain MDK-ARM Professional Version 5.21a and Device is LPC2388.

We are trying to create a "undefined instruction exception" on a "BL" instruction in the thumb mode. When we tried to alter the H fllag in the first part of the instruction, we were unable to single step through the instruction as the instruction decoding was not successful. But when we moved the H flag altering to the second part of the instruction, the single stepping went through the instruction and proceeded to the next.

I wonder how on both the occasions the undefined instruction exception was created. This might cause a controller reliability issue in a mission critical system.

Can someone explain why the undefined instruction exception was not entered in our case and suggest a way of creating undef-exception on a BL instruction.

Thanks in advance.

Parents
  • Can someone explain why the undefined instruction exception was not entered in our case

    BL with the H bit set is a valid thumb instruction and BL with the H bit not set is a valid thumb instruction. Since these are valid instructions the processor will not generate an undefined instruction exception.

    and suggest a way of creating undef-exception on a BL instruction.

    There is no way to make a defined instruction generate and undefined instruction exception. You would have to take the defined instruction (such as the BL instructions) and change it to something different that is undefined - but then it would no longer be the BL instruction it would be an undefined instruction.

    This might cause a controller reliability issue in a mission critical system.

    The 2 BL instructions are meant to be called back to back, the H bit not set in the first instruction and the H bit set in the 2nd one. Not doing this is highly likely to cause reliability issues in mission critical systems as well as non mission critical systems. You would not want to do this in either type of system.

Reply
  • Can someone explain why the undefined instruction exception was not entered in our case

    BL with the H bit set is a valid thumb instruction and BL with the H bit not set is a valid thumb instruction. Since these are valid instructions the processor will not generate an undefined instruction exception.

    and suggest a way of creating undef-exception on a BL instruction.

    There is no way to make a defined instruction generate and undefined instruction exception. You would have to take the defined instruction (such as the BL instructions) and change it to something different that is undefined - but then it would no longer be the BL instruction it would be an undefined instruction.

    This might cause a controller reliability issue in a mission critical system.

    The 2 BL instructions are meant to be called back to back, the H bit not set in the first instruction and the H bit set in the 2nd one. Not doing this is highly likely to cause reliability issues in mission critical systems as well as non mission critical systems. You would not want to do this in either type of system.

Children