Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: Timer Issue - GateMutex: line 97: assertion failure: A_badContext: bad calling contex

$
0
0

To resolve an issue with the CC3000 firmware in regards to mDNS advertising. I need to create a timer that periodically sends out a mDNS packet using the CC3000's mdnsAdvertiser method.

However when calling the mdnsAdvertiser method  I get the following error

ti.sysbios.knl.Semaphore: line 207: assertion failure: A_badContext: bad calling context. Must be called from a Task.

The error is pretty clear, I need to call the mdnsAdvertiser method from within a Task. So I go ahead and create a task using the following code.

void mDNSSendTask(UArg arg0, UArg arg1) {  char device_name[] = "TestServer";   mdnsAdvertiser(1,device_name,strlen(device_name));  }  void mDNSSend(UArg arg0) {  Task_Params taskParams;  Task_Handle task0;  Error_Block eb;  Error_init(&eb);  /* Create 1 task with priority 15 */  Task_Params_init(&taskParams);  taskParams.stackSize = 512;  taskParams.priority = 1;  task0 = Task_create(mDNSSendTask, &taskParams, &eb);   if (task0 == NULL)  {   System_abort("Task create failed");  }   Task_delete(&task0);  } 

But now I get the following error message when calling Task_create

ti.sysbios.gates.GateMutex: line 97: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.

How do I resolve this issue? Or am I going about this all wrong. I know that when creating my Timer/Clock it automatically creates a SWI, is then creating a Task within a SWI context a problem? If so, how can I go about calling my mdnsAdvertiser method using the TI-RTOS timer?

Glenn.


Viewing all articles
Browse latest Browse all 25965

Trending Articles