iLLD_TC27xC
1.0
|
Macro to define the trap vector table. This macro is provided to define the trap vector table in the frameowrk. User shall not use this macro. Refer to the documentation to extend the trap with hook functions. How to use the Trap Function Hooks?. More...
![]() |
Macro to define the trap vector table. This macro is provided to define the trap vector table in the frameowrk. User shall not use this macro. Refer to the documentation to extend the trap with hook functions. How to use the Trap Function Hooks?.
This page describes how to use the trap function hooks with application framework.
Framework has built in Trap Service Routines, which has minimal set of debug information. The execution of trap service is as below,
1) When a trap occurs, a global structure variable "trapWatch" is updated with the information:
__a. Which CPU caused this trap,
__b. What is the trap class and
__c. What is the trap identification number
2) Call to a configurable hook function, passing structure trapWatch as parameter.
3) Then debug instruction executed.
4) Returning from the trap. (This instruction is not reached if debugger is connected because of "debug" instruction before)
For normal cases during development, where user works with debugger, user can watch the structure variable "trapWatch" in the debugger.
In case, user wants to make use of the information of trap for further processing,
extend the traps, using the hook functions provided.
If the trap extensions are to be extended, it is very important to enable this feature. By default this feature is disabled.
To extend the trap hook functions user must enable this feature by defining the macro "IFX_CFG_EXTEND_TRAP_HOOKS" in Ifx_Cfg.h, at path: 0_Src/0_AppSw/Config/Common/, as shown below.
Now the compiler will accept the further configurations to extend the hooks.
IfxCpu_Traps_Cfg.h file shall be used to extend the traps. This provide two kind of hook functions. ie. Hook for error traps and hooks (per CPU available) for system calls.
Error trap occurs as a result of an error event such as an instruction error, memory-management error or an illegal access.
To extend the error traps, following steps are to be followed:
This definition shall be as user defined code (Generally in DemoApps folder).
Considerations:
Configure error trap hook extension function as defined above to the macro as below:
Tricore architecture provides the system call trap which is executed by software trigger. The instruction "syscall" triggers this trap. Please refer Tricore architecture manual for more details.
IfxCpu_trap driver provide hook function for each CPU separately. To extend System Call trap following steps are to be followed:
This definition shall be as user defined code (Generally in DemoApps folder).
Considerations:
Configure the hook extension function defined above, to the macro as below: