Announcements

Equip yourself to optimize AURIX™ MCUs for Evs at the EV Webinar. Click here to register.

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

AURIX™ Forum Discussions

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

Dear Team,

There is a requirement to enter into a task through interrupt

For example, 

int a;

__syscallfunc(1) void OsTC39x_API_Cal(void);

void __inrerrupt(6) OsTC39x_API_Call(void)
{
__svlcx();//upper and lower context are stored automatically when interrupt occurs
__dsync();
__asm(" j task_t1 ");
}


void task_t1()
{
activatetask(task_t2);// activate task_t2


while(1)
{
a++;
}
}

void task_t2()
{
TerminateTask();

}

so in the above example, it will never go back to interrupt to clear upper and lower CSA which is stored.
I wanted to clear it explicitly. Can u give us an example for clearing the CSA's.

 

 

Thanks and Regards,

Uma

0 Likes
1 Solution
Prudhvi
Moderator
Moderator
Moderator
50 solutions authored 250 sign-ins 10 likes given

Hello Uma,

May we know the use case of such requirement?

To answer your question, lower context can be restored using rslcx whereas upper context is restored by RFE executed while returning from Trap/Interrupt which might not happen in your case because of infinite loop. In general, the processor takes care of restoring the contexts it saved dynamically.

If you only need that information (UCX & LCX) for debugging then you can use access the CSA stack memory and store it in Global RAM.

Regards,

Prudhvi.

View solution in original post

0 Likes
2 Replies
Uma
Level 1
Level 1
5 questions asked 5 sign-ins First reply posted

Please do not consider the below line

__syscallfunc(1) void OsTC39x_API_Cal(void);

 

Thanks and Regards,

Uma

0 Likes
Prudhvi
Moderator
Moderator
Moderator
50 solutions authored 250 sign-ins 10 likes given

Hello Uma,

May we know the use case of such requirement?

To answer your question, lower context can be restored using rslcx whereas upper context is restored by RFE executed while returning from Trap/Interrupt which might not happen in your case because of infinite loop. In general, the processor takes care of restoring the contexts it saved dynamically.

If you only need that information (UCX & LCX) for debugging then you can use access the CSA stack memory and store it in Global RAM.

Regards,

Prudhvi.

0 Likes