Nov 04, 2019
07:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 04, 2019
07:17 AM
Hi,
How can I debug my code when I encountered Trap?
Thank you and regards
Bernie
#8042000 13007
How can I debug my code when I encountered Trap?
Thank you and regards
Bernie
#8042000 13007
- Tags:
- IFX
1 Reply
Nov 04, 2019
08:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 04, 2019
08:22 AM
Hi Bernie,
For Tricore / AURIX, there are 8 Trap classes, the more common trap can be Class 2 - Instruction Errors or Class 4 System Bus and Peripheral Errors.
In general, we can follow the steps below to find out the trap reason:
1. Put one or more breakpoints for the trap class in the Trap vector table (ie, Class 2 & Class 4). The BTV register specifies the Base address of the Trap Vector table
2. Reset & run your code
3. If trap occurred for class 2 or class 4, it will stop at that breakpoint
4. Check register D[15] for TIN - Trap Identification Number
5. Check register A[11] for address of instruction triggering the trap. For a synchronous trap, the return address A[11] is the instruction that caused the trap.
Please refer to the architecture user manual volume 1 -> Chapter 6 Trap System for more details. (TC Architecture User Manual V10 Vol1)
Best regards
Mr. AURIX™
For Tricore / AURIX, there are 8 Trap classes, the more common trap can be Class 2 - Instruction Errors or Class 4 System Bus and Peripheral Errors.
In general, we can follow the steps below to find out the trap reason:
1. Put one or more breakpoints for the trap class in the Trap vector table (ie, Class 2 & Class 4). The BTV register specifies the Base address of the Trap Vector table
2. Reset & run your code
3. If trap occurred for class 2 or class 4, it will stop at that breakpoint
4. Check register D[15] for TIN - Trap Identification Number
5. Check register A[11] for address of instruction triggering the trap. For a synchronous trap, the return address A[11] is the instruction that caused the trap.
Please refer to the architecture user manual volume 1 -> Chapter 6 Trap System for more details. (TC Architecture User Manual V10 Vol1)
Best regards
Mr. AURIX™