I have been trying to my code to connect to an AP but after much debugging and thinking it was the exra code added in I see the code is in fact hanging at establishConnectionWithAP(); is there something I am missing in my code. Any help would be appreciated.
Thanks
Kas
P.S. My full code (ll functions can be found in this post but the "main" that I am using is included below
/* * Application's entry point */ int main(void) { INT32 retVal = -1; retVal = initializeAppVariables(); ASSERT_ON_ERROR(__LINE__, retVal); /* Stop WDT and initialize the system-clock of the MCU These functions needs to be implemented in PAL */ stopWDT(); initClk(); /* Configure command line interface */ CLI_Configure(); CLI_Write("\r\n\r\n\r\n\r\n\r\n\r\n"); //Initialise I2C // I2CInit(); //Initialise I2C // mpl3115aInit(); displayBanner(); /* * Following function configures the device to default state by cleaning * the persistent settings stored in NVMEM (viz. connection profiles & * policies, power policy etc) * * Applications may choose to skip this step if the developer is sure * that the device is in its default state at start of application * * Note that all profiles and persistent settings that were done on the * device will be lost */ retVal = configureSimpleLinkToDefaultState(); if(retVal < 0) { if (DEVICE_NOT_IN_STATION_MODE == retVal) { CLI_Write(" Failed to configure the device in its default state \n\r"); } LOOP_FOREVER(__LINE__); } CLI_Write(" Device is configured in default state \n\r"); /* * Assumption is that the device is configured in station mode already * and it is in its default state */ /* Initializing the CC3100 device */ retVal = sl_Start(0, 0, 0); if ((retVal < 0) || (ROLE_STA != retVal) ) { CLI_Write(" Failed to start the device \n\r"); LOOP_FOREVER(__LINE__); } CLI_Write(" Device started as STATION \n\r"); CLI_Write(" Location C \n\r"); /* Connecting to WLAN AP - Set with static parameters defined at the top After this call we will be connected and have IP address */ retVal = establishConnectionWithAP(); if(retVal < 0) { CLI_Write(" Failed to establish connection w/ an AP \n\r"); LOOP_FOREVER(__LINE__); } CLI_Write(" Connection established w/ AP and IP is acquired \n\r"); CLI_Write(" Location D \n\r"); /*Before proceeding, please make sure to have a server waiting on PORT_NUM*/