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.

cc3200 hangs after programming

hi,

I have a list of nested else if statement which used to work fine but when i add an extra if else it compiles without any error..

but the program hangs when its starts..

it behaves the same way like we put osi_critical above simplelink function..

please advice

  • Hi Aneesh,


    Please share trouble code snippet.


    Regards,
    Aashish
  • please find my code below it works fine..
    but when i add one more if else it hangs...
    i receive a data checks the command and closes the socket



    // Do as per Cmds given
    //
    if (g_ulCmdFlags & CMD_NEW_INFOCFG)
    {
    g_ulCmdFlags &= ~CMD_NEW_INFOCFG;

    // Send ACK
    sl_Send(newSockID,"ACK",strlen("ACK"),0); osi_Sleep(100);

    if(g_ulCmdFlags & CMD_NEW_INFOMODULE)
    {
    //
    // Rx new module config
    //
    debugPrint("\n\rModule Config...");

    osi_EnterCritical();
    memcpy(&MyModuleInfo,&MyModuleInfoNew,sizeof(MyModuleInfo));
    osi_ExitCritical(OSI_OK);

    WriteFile(FILE_MODULE_INFO,(_u8 *)&MyModuleInfo,sizeof(MyModuleInfo));

    PrintModuleInfo(MyModuleInfo);

    g_ulCmdFlags &= ~CMD_NEW_INFOMODULE;
    }

    if (g_ulCmdFlags & CMD_NEW_INFOROUTER)
    {
    //
    // Rx new router config
    //
    debugPrint("\n\rRouter Config...");

    sl_Close(newSockID); osi_Sleep(100);

    sl_WlanProfileDel(0xFF);
    sl_WlanDisconnect();

    osi_EnterCritical();
    memcpy(&MyRouterInfo,&MyRouterInfoNew,sizeof(MyRouterInfo));
    osi_ExitCritical(OSI_OK);

    WriteFile(FILE_ROUTER_INFO,(_u8 *)&MyRouterInfo,sizeof(MyRouterInfo));

    //
    // Add New AP profile
    //
    SlSecParams_t SecParams;

    osi_EnterCritical();
    SecParams.Key = (_i8 *)MyRouterInfo.Key;
    SecParams.KeyLen = strlen(MyRouterInfo.Key);
    SecParams.Type = SL_SEC_TYPE_WPA_WPA2;
    osi_ExitCritical(OSI_OK);
    sl_WlanProfileAdd((_i8 *)MyRouterInfo.Ssid, strlen(MyRouterInfo.Ssid),
    0,&SecParams,NULL,1,0);

    // Configure AP mode Password and Security Type
    // same as router Password
    //sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_PASSWORD, SecParams.KeyLen,SecParams.Key);
    //sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SECURITY_TYPE, 1, (_u8 *)&SecParams.Type);

    osi_EnterCritical();
    g_ulWlanMode = FAILURE;
    WlanMode = ROLE_STA;
    MyModuleInfoNew.wlanmode=ROLE_STA;

    g_lModuleConfigured = TRUE;
    memcpy(&MyModuleInfo,&MyModuleInfoNew,sizeof(MyModuleInfo));
    osi_ExitCritical(OSI_OK);
    WriteFile(FILE_MODULE_INFO,(_u8 *)&MyModuleInfo,sizeof(MyModuleInfo));
    PrintModuleInfo(MyModuleInfo);

    PrintRouterInfo(MyRouterInfo);

    goto restart;
    }

    sl_Close(newSockID); osi_Sleep(100);
    }

    else if(g_ulCmdFlags & CMD_SETPASS){

    // sl_Send(newSockID,"ACK",strlen("ACK"),0); osi_Sleep(100);
    // sl_Close(newSockID); osi_Sleep(50);
    sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_PASSWORD,strlen(APpassword),APpassword);

    g_ulCmdFlags &= ~CMD_SETPASS;
    }
    else if(g_ulCmdFlags & CMD_SETUSERPASS){
    }
  • Hi Aneesh,


    What the extra if else do? Please share the code snippet or mark the code snippet that causing the trouble as we cant identify from above code snippet which one is extra if else that causing the issue . Is it application based on TI-RTOS or FreeRTOS? Also share the stack screen shot and map file.


    Regards,
    Aashish