How to clear the CSA used for trap/interrupt for Tc397 board

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

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_E
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 25 likes received

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_E
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 25 likes received

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