|
|||||||||||
Technical Support Support Resources
Product Information |
C166: Identify Instruction Causing Class B Hardware TrapInformation in this article applies to:
QUESTIONMy program generates a Class B Hardware Trap which indicates execution of:
How can I determine the reason of the Class B Hardware Trap and the CPU instruction that causes this problem? ANSWERYou can add the TRAPS.C file to your application. This file contains a TRAP Handler for 166/167/XC16x hardware traps. The current version of this file contains a PRINT_TRAP define that you can enable. This adds the following code to your program:
The printf statement outputs (via the serial interface) the PC address and the Trap Flag Register (TFR) value. You can load your application into the µVision Debugger and enter the Unassemble command in the Debugger Command Window. This typically displays the instruction (or the instruction after the instruction) that caused the Class B trap. The TFR value indicates the Class B Trap reason. For C16x/ST10 based devices the following TFR values are defined:
For XC16x/Super10 based devices the following TFR values are defined:
MORE INFORMATIONSEE ALSOLast Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.