Other Parts Discussed in Thread: UNIFLASH, , CC31XXEMUBOOST
Hi,
I am trying to use the CC3100 on the TM4C129 board. I used the simplelink API.
Here is the relevant code to set CC3100 to the default state:
int main(){
char *pConfig = NULL; INT32 ASize = 0; SlSockAddrIn_t Addr;
initClk(); // PLL 50 MHz
UART_Init(); // Send data to PC, 115200 bps
int32_t retVal = configureSimpleLinkToDefaultState(pConfig);
if(retVal < 0)
Crash("configureSimpleLinkToDefaultState failed\n");
The retVal is -100,.
The code of configureSimpleLinkToDefaultState is:
static int32_t configureSimpleLinkToDefaultState(char *pConfig){
SlVersionFull ver = {0};
UINT8 val = 1;
UINT8 configOpt = 0;
UINT8 configLen = 0;
UINT8 power = 0;
INT32 retVal = -1;
INT32 mode = -1;
mode = sl_Start(0, pConfig, 0);
/* If the device is not in station-mode, try putting it in station-mode */
if (ROLE_STA != mode){
if (ROLE_AP == mode){
/* If the device is in AP mode, we need to wait for this event before doing anything */
while(!IS_IP_AQUIRED(g_Status));
}
/* Switch to STA role and restart */
retVal = sl_WlanSetMode(ROLE_STA);
retVal = sl_Stop(0xFF);
retVal = sl_Start(0, pConfig, 0);
/* Check if the device is in station again */
if (ROLE_STA != retVal){
/* We don't want to proceed if the device is not coming up in station-mode */
return DEVICE_NOT_IN_STATION_MODE;
}
}
the retVal of sl_Start failed. It returns -100.
Is there possible fix to this problem?
Thank you very much