Hello, I have developed an sniffer on the CC3200 using the trasnceiver_mode example from the SDK, my sniffer works as expected if used in that project, but now I want to move the sniffer to another project, specifically the wlan_station example.
When running my sniffer from wlan_station the application crashes, it happens just after creating the socket for the sniffer:
int iSoc = sl_Socket(SL_AF_RF, SL_SOCK_RAW, channel);
The error I'm getting is that the debugger ends the execution in a function named loader_exit and it prints an error message through the console:
ti.sysbios.family.arm.m3.Hwi: line 1095: E_hardFault: FORCED ti.sysbios.family.arm.m3.Hwi: line 1172: E_busFault: IMPRECISERR: Delayed Bus Fault, exact addr unknown, address: e000ed38 Exception occurred in background thread at PC = 0x2000a5fe. Core 0: Exception occurred in ThreadType_Task. Task name: {unknown-instance-name}, handle: 0x200188e8. Task stack base: 0x20018938. Task stack size: 0x2000. R0 = 0x0000000c R8 = 0x200141a4 R1 = 0x0000978f R9 = 0x00000000 R2 = 0x00000000 R10 = 0xffffffff R3 = 0x00000001 R11 = 0xffffffff R4 = 0xfee7fee7 R12 = 0x142c0300 R5 = 0x2001404c SP(R13) = 0x2001a808 R6 = 0x20014044 LR(R14) = 0x20005bff R7 = 0x80f44f47 PC(R15) = 0x2000a5fe PSR = 0x01000000 ICSR = 0x0400f803 MMFSR = 0x00 BFSR = 0x04 UFSR = 0x0000 HFSR = 0x40000000 DFSR = 0x0000000a MMAR = 0xe000ed34 BFAR = 0xe000ed38 AFSR = 0x00000000 Terminating execution...
If I manually set the PC to 0x2000a5fe the execution line is set to the return of this function:
/* * ======== Task_disable ======== */ UInt Task_disable() { UInt key = Task_module->locked; Task_module->locked = TRUE; return (key); }
Could this has anything to with the fact that now I'm launching my sniffer inside a TI-RTOS task? In the transceiver mode no tasks are used and my code runs ok. Now I'm calling from the TI-RTOS task the functions wifiSnifferSetMode and then wifiSnifferCapture, and the program crashes right after the call to the last one.
This is the sniffer I'm trying to use (I have commented out all the code but the line that creates the socket for debugging):
Pastebin with the .c file of my sniffer ->
It would be great if anybody knows how to fix this or at least point me to the right direction.
Thanks in advance
EDIT: I have uploaded my whole workspace below, just in case anyone wants to recreate the error (it's produced by the creation of the sniffer socket, line 60 of file "wifi_sniffer.c", inside "deusto_libs" folder)
The main function create the task for the gateway, the task function sets the device into station mode, set up a timer, erase the WLAN policies by calling "wifiSnifferSetMode", and then calls "wifiSnifferCapture" which is where the error occurs.