Hi,
I want to execute the following code (every few microseconds):
Status= sl_Send(socket_descriptor,RawData,sizeof(RawData),0);
Report("sl_Send_Status = %d. Data sent: %s. sizeof(RawData):%d.\n\r",Status,RawData,sizeof(RawData));
if(Status < 0)
{
UART_PRINT("Transmition Failed!\r\n");
sl_Close(socket_descriptor);
}
that is, to send a packet in the stack bypass mode using a CC3200.
How can I do that? if possible, please provide a working example. Thanks!
So far I am creating a clock and on the rising edge I execute the code above. The complete code is:
Void clk0Fxn(UArg arg0);
Void clk1Fxn(UArg arg0);
...
in the main
// Configure and start clock
Clock_Params clkParams;
/* Create a periodic Clock Instance with period = 5 system time units */
Clock_Params_init(&clkParams);
clkParams.period = 10000; //10s
clkParams.startFlag = TRUE;
Clock_create(clk0Fxn, 10000, &clkParams, NULL);
/* Create an one-shot Clock Instance with timeout = 11 system time units */
clkParams.period = 0;
clkParams.startFlag = FALSE;
clk2 = Clock_create(clk1Fxn, 11000, &clkParams, NULL);
Clock_start(clk2);
...
Void clk0Fxn(UArg arg0)
{
Status= sl_Send(socket_descriptor,RawData,sizeof(RawData),0);
Report("sl_Send_Status = %d. Data sent: %s. sizeof(RawData):%d.\n\r",Status,RawData,sizeof(RawData));
if(Status < 0)
{
UART_PRINT("Transmition Failed!\r\n");
sl_Close(socket_descriptor);
}
}
But when I debug the code I get the following error in the console after 10s:
ti.sysbios.gates.GateMutex: line 99: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.
xdc.runtime.Error.raise: terminating execution
I guess because I am using a mutex (or GateMutex) inside a SWI. What can I do?