This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320C6412: SWI_inc executed with mbox value of zero?

Part Number: TMS320C6412

Hi TI gurus

Following on from a previous posting, I was able to use SWI_inc() rather than SWI_post() in my legacy C64x DSP application.

SInce I am unable to use CCS or other tools, I have added debug code, I have seen definate cases of multiple SWIs being posted to the SWI queue prior to the first one being executed.

In these cases, the C6000 DSP BIOS users guide (Software Interrupt - Thread Scheduling) suggests using the following piece of code.

myswiFxn()

{ . . .
repetitions = SWI_getmbox();
while (repetitions --){
‘run SWI routine‘
}
. . .
}

I am monitoring the SWI_getbox value and counted the number of times that repetitions=0, 1 or 2

While I do see a problem where very occasionally (during busy periods) repetiions returns a value of 2, 95% of the time this value is 1. However, what really confused me, and actually caused the above piece of code to fail, was the other 5% of the time that the value of repetitions was equal to ZERO. This means that the while loop above will not execute at all.

I can't explain why that would happen, since surely to have the SWI executed, the mbox value must have been at least zero.

Am I missing something?

Thanks

Jim