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.

CC3200MOD: Device hangs while waiting for WLAN to connect

Part Number: CC3200MOD


Preface: this happens on one 2 of my custom boards pretty frequently, more so with particular Access-Points than others.

Also, the device will only hang if there are profiles present - I suspect this is pointing to an issue with WLAN events.. or something within SimpleLink.

Host Driver Version: 1.0.1.11

Build Version: 2.9.0.0.31.1.4.0.1.1.0.3.37

OS: TI-RTOS

My code started off as the provisioning_ap example but has some modifications, although mostly after a connection has been established to an AP or provisioning is complete.

Here is a snippet of the code... device always hangs in the while-loop that is waiting for IS_CONNECTED and IS_IP_ACQUIRED, and often only loops a few times before it hangs:

void connectionThread(void *pvParam)
{
	long lRetVal = -1;
	int i;
	short clearProf = ((threadParams_t*)pvParameters)->clearProfiles;

	InitializeAppVariables();

	lRetVal = ConfigureSimpleLinkToDefaultState(clearProf);
	if(lRetVal < 0)
	{
		if (DEVICE_NOT_IN_STATION_MODE == lRetVal)
			UART_PRINT("Failed to configure the device in its default state \n\r");

		LOOP_FOREVER();
	}

	UART_PRINT("Device is configured in default state \n\r");

	CLR_STATUS_BIT_ALL(g_ulStatus);

	//Start simplelink
	lRetVal = sl_Start(0,0,0);
	if (lRetVal < 0 || ROLE_STA != lRetVal)
	{
		UART_PRINT("Failed to start the device \n\r");
		LOOP_FOREVER();
	}


	UART_PRINT("Device started as STATION \n\r");

	if(1)
	{
		int limit = 0;
		while((!IS_CONNECTED(g_ulStatus)) || (!IS_IP_ACQUIRED(g_ulStatus)))
		{
			osi_Sleep(100);
			if(limit++ > 300)
			{
				UART_PRINT("Timedout waiting for auto connect\n\r");
				break;
			}
		}
	}
	
	if( (!IS_CONNECTED(g_ulStatus)) || (!IS_IP_ACQUIRED(g_ulStatus)) )
	{
		// Connect to our AP using SmartConfig method
		lRetVal = startProvisioning();
		if(lRetVal < 0)
		{
			ERR_PRINT(lRetVal);
		}
		else
		{
			UART_PRINT("Provisioning Succeeded \n\r");
		}
	}

	/*** more application code here ***/
}

While I had debugging for the provisioninglib enabled, I noticed that the hang would often occur just before it would normally print "[DEBUG ProvLib] WlanEvent:1"

I found a thread with a very similar question asked, back in late 2014, but it was closed with no resolution.

I do have a watchdog timer (10 second timeout), but I have tried without the watchdog running at all and this problem will still occur.

Hoping someone will be able to help me figure out what is causing this hang.

Thanks,
Josh