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.

How to use the _SlNonOsMainLoopTask() function in an application running with FreeRTOS

Other Parts Discussed in Thread: CC3200SDK, CC3200

Hi,

I am trying to integrate P2P example application with websock_camera from CC3200SDK_1.0.0.

The CC3200 device  comes up in P2P mode smoothly but get stuck inside the below function when trying to connect with the Android device.

// Wait till Device acquired an IP in P2P mode
while(! IS_P2P_REQ_RCVD(g_ulStatus_main))
{
_SlNonOsMainLoopTask();
}

I tried including the nonos.c and nonos.h files inside the project. But it get stuck inside the below loop

_SlNonOsRetVal_t _SlNonOsMainLoopTask(void)
{
_i16 i;

for (i=0 ; i<NONOS_MAX_SPAWN_ENTRIES ; i++)
{
_SlNonOsSpawnEntry_t* pE = &g__SlNonOsCB.SpawnEntries[i];
_SlSpawnEntryFunc_t pF = pE->pEntry;

if (NULL != pF)
{
if((g_pCB)->RxIrqCnt != (g_pCB)->RxDoneCnt)
{
pF(0);/*(pValue);*/
}
pE->pEntry = NULL;
pE->pValue = NULL;
}
}

return NONOS_RET_OK;
}

Also I am unable to find where the variable g_pCB is initialized.

Please help me to solve this issue asap.

Reagrds

-Abul Hasan

  • Hi Abul,

    It seems that the example code is waiting to receive an IP address from your Android device.
    Can you please provide a bit more information on your setup? Is your Android device set to P2P GO, P2P Client or any mode?
    What is the exact Android device being used and what is the Android OS revision?

    g_pCB is initialized in Driver.C, _SlDrvDriverCBInit(), but it is an internal implementation that you shouldn't manage or take care of.

    Thanks,
    Alon 

  • Hi Alon,

    You are right, the device is waiting to receive an IP address only. Because it get stuck in the below function

    // Wait till Device acquired an IP in P2P mode
    while(! IS_P2P_REQ_RCVD(g_ulStatus))
    {
    _SlNonOsMainLoopTask();
    }

    I don't know in which mode the Android device is set to. But it works fine with the "P2P" example application of CC3200SDK_1.0.0

    I am using Sansumg GT-S7582 and the Android version is 4.2.2

    Below is the function I am calling in the program and the #defines are mentioned for your reference

    lRetVal = sl_WlanPolicySet(SL_POLICY_P2P, SL_P2P_POLICY(SL_P2P_ROLE_NEGOTIATE,

    SL_P2P_NEG_INITIATOR_ACTIVE),NULL,0);

    #define SL_POLICY_P2P                                         (0x40) 

    #define SL_P2P_POLICY(p2pNegType,p2pNegInitiator)

                                       (POLICY_VAL_2_OPTIONS(0,0xF,(p2pNegType > SL_P2P_ROLE_GROUP_OWNER ?                                                SL_P2P_ROLE_GROUP_OWNER : p2pNegType)) | \
                                       POLICY_VAL_2_OPTIONS(4,0x1,(p2pNegType > SL_P2P_ROLE_GROUP_OWNER ? 1:0)) | \
                                       POLICY_VAL_2_OPTIONS(5,0x3, p2pNegInitiator))

    #define SL_P2P_ROLE_NEGOTIATE                     (3)

    #define SL_P2P_NEG_INITIATOR_ACTIVE          (0)

    Regards

    -Abul Hasan

  • Hi Abul,

    With some Samsung phones connecting to our device  (if CC3200 is in AP mode or P2P GO) might not work due to the default configuration of the mobile WiFi.

    New setting was introduced in the phone that are checking access to www.google.com when connecting to an AP - if no access the connection will be drooped.

    In order to avoid it - in the WiFi Settings -> Advanced - make sure the"Auto Network Switch" is not marked.

    Thanks,
    Alon

  • Hi Abul,

    I am closing the thread, if issue still exist please open a new thread and add a link to this one for reference.

    Thanks,
    Alon