How to create a trap class 6 for TC397 using tasking compiler

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Uma
Level 1
Level 1
5 questions asked 5 sign-ins First reply posted

Hi Team,

we tried creating a trap class 6 using syscallfunc(TIN) as specified in tasking compiler user guide "ctc_user_guide" (section 1.11.4.3) as shown below. here control is going to trap6 but not getting the TIN number as expected for syscall_a(1,2); and syscall_b(4,3);

#pragma alias syscall_a=trap6
#pragma alias syscall_b=trap6

__syscallfunc(1) int syscall_a( int, int );
__syscallfunc(2) int syscall_b( int, int );
int x;
void main( void )
{
x = syscall_a(1,2); // causes a trap class 6 with TIN = 1
x = syscall_b(4,3); // causes a trap class 6 with TIN = 2
}
int __trap( 6 ) trap6( int a, int b ) // trap class 6 handler
{
int tin;
tin = __get_tin(); // get the TIN
switch( tin )
{
case 1:
a += b;
break;
case 2:
a -= b;
break;
default:
break;
}
return a;
}

please help us in getting the tin number here.

 

Thanks,

Uma

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
User13836
Level 6
Level 6
50 likes received 50 solutions authored 100 sign-ins

Hello Uma,

I cannot reproduce the problem. I used the TASKING TriCore tools v6.3r1 and executed the example code on a TC39xB TriBoard hardware. It works fine.

I did face a locate error though which is related to a known issue. To mitigate this I had to disable the default trap 6 handler for all 6 cores of the TC39xB. See attached screenshot.

Best regards,
Ulrich Kloidt

TASKING tools support

 

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
User13836
Level 6
Level 6
50 likes received 50 solutions authored 100 sign-ins

Hello Uma,

I cannot reproduce the problem. I used the TASKING TriCore tools v6.3r1 and executed the example code on a TC39xB TriBoard hardware. It works fine.

I did face a locate error though which is related to a known issue. To mitigate this I had to disable the default trap 6 handler for all 6 cores of the TC39xB. See attached screenshot.

Best regards,
Ulrich Kloidt

TASKING tools support

 

0 Likes