Hi,
I work with CodeComposer3.3 using DSP/BIOS on TMS320C6713B.
I have the following question:
Is it may be a problem to branch from NMI routine (by updating the PC with the NRP value) into a task routine that waits on SEM_pend command?
If there is a problem can you please recommend an approach to address this issue.
The code example attached below.
Following description happens after main is done.
/*
Timer1 is called upon timer1 interrupt.
*/
void Timer1(void)
{
SEM_post(&handler);
}
/*
Task1 waits on Sem_pend() until the semaphore is released by "Timer1()".
*/
void Task1(void)
{
while(1){
SEM_pend(&handler, SEM_FOREVER);
/* ... Some more work */
}
}
/*
WatchDog() may be called if NMI happens (during "...Some more work").
If WatchDog is called then "Branch(void)" (below) sets the ProgramCounter to "Task1(void)" using the reference to "Task1(void)" as the address.
*/
void WatchDog(void)
{
IRQ_nmiEnable();
Counter++;
branch(&Task1);
}
/*
_branch is assembly code as follow:
*/
_branch:
mv A4, B1
mvc .S2 B1, NRP
b NRP
nop 5
.end
Best Regards
Samti Rubinti
cinlab