I am having trouble getting a SWI to function properly on my TMS320C6000.
In my application, main waits for messages from a host application. The HWI takes care of time-critcal data events and the SWI is posted from within the HWI such that it takes care of less time-critical calculations after the HWI finishes up.
The trouble is that the code hangs up the first time the SWI is called. I can use the "DSP/Bios Kernal Object View" to check on the status of the SWI I created dynamically. The state of the SWI (which could be "inactive", "ready", or "running") starts out as "inactive". Once the SWI is posted, it becomes "ready". At that point, the code hangs up. I never see it show "running". So, I suspect I am doing something wrong, and I need some help.
I have defined my SWI with the following:
volatile int SWITally = 0;
void swiCountFxn(void); // Function for SWI
// Use the below for dynamic creation of the SWI
SWI_Attrs attrs={(SWI_Fxn)swiCountFxn,0,0,10,0}; // Pointer to swi attributes (Priority=10)
SWI_Handle swi; // Handle for new swi object that will use 'attrs'
// SWI Function
//=============================================================================
void swiCountFxn(void) // Simple function for testing SWI
{
SWITally = (SWITally + 1) % 100000; // Increment SWITally index modulus 100000
}
//=============================================================================
And I post the SWI from within my HWI with:
SWI_post(swi);
Any thoughts here? Have I set-up and defined my SWI properly?
For the record, when the code does hang up, it seems to just sit there without ever advancing (or allowing anymore HWIs). At that point, if I "halt" the run or refresh the "watch window", I get a warning that forces me to disconnect.
Any thoughts, ideas or suggestions are appreciated.
Thanks.