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

AURIX™ Forum Discussions

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

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
User13836
Level 4
10 solutions authored 50 replies posted 25 sign-ins
Level 4

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
User13836
Level 4
10 solutions authored 50 replies posted 25 sign-ins
Level 4

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