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.

BOOSTXL-CC3135: Function not found

Part Number: BOOSTXL-CC3135
Other Parts Discussed in Thread: CC3135, CC31XXEMUBOOST

Hi team,

My customer was requesting assistance:
I am going through the WiFi driver documentation and have come across a function that I cannot seem to find an actual function for. I can only find a declaration. The function in question is in SimpleLink CC31xx/CC32xx Host Driver: user.h Source File (ti.com) line #906: #define sl_SyncObjGetCount(pSyncObj,pValue) sem_getvalue(pSyncObj, pValue);
The sem_getvalue function I cannot find anywhere. I have looked in all of the semaphore….h files in the SDKs I have (SDK WiFi plugin 4.20.00.10, MSP432P4 SDK 3.40.01.02 and CC32XX SDK 7.10.00.13) and cannot find the function itself. Where can I find it so I know what is in the function? I am using no RTOS and am using a CC3135 Booster Pack, TM4C129EXL and CC31XXEMUBOOST for my project.

Thank you,
Drew
  • Hey Drew,

    The sem_getvalue() function is defined in source\ti\posix\xxx\semaphore.c in the  MSP432P4 SDK 3.40.01.02 and the CC32XX SDK 7.10.00.13 and should return the current semaphore count.

    hope this helps.

    best regards,

    Avi E

  • Hi Avi,

    I got the response from the customer:

    The only place I found the semaphore.c file was in the RTOS folders. Is there a version of semaphore.c that is not for RTOS?

    Thank you,

    Drew

  • Hi Drew,

    In noRTOS there is no implementation for the sl_SyncObjGetCount(). 

    In general semaphores and mutexes are more suited to RTOS Type of applications as they provide mutual exclusion between threads.
    best regards,
    Avi Epstein.
  • Hi Avi,

    I got the response from the customer:

    Alright. Thank you for letting me know. I will implement it with RTOS in mind for my non-RTOS system. Make sure it works and then throw an RTOS in it later.

    Thank you,

    Drew

  • Hi Avi,

    I have a follow-up question from the customer.

    1.  I am going through the Wi-Fi code that TI has documented and there are a couple of structures that I cannot find anywhere.  They are "Work", which is used on line 2,149 of SimpleLink CC31xx/CC32xx Host Driver: driver.c Source File (ti.com) and "MsgCnt" on line 1,606 of the same file.  Where are those structures located so I can see what is in them?

    2. I am going through the Wi-Fi driver code and am getting an error with the _SlDrvMsgRead function of SimpleLink CC31xx/CC32xx Host Driver: driver.c Source File (ti.com) .  On line 1,448, CCS is giving me an error of #137 struct "_SlPoolObj_t" has no field "pData".  I have the line copied verbatim.  I have gone back and made sure that all my structures are correct and they are.  Is there an issue with the typecasting on the documentation, or something else?  I am attaching my code that refers to it as well.

     Thanks!

    Marv

  • Hi Marvin,

    Regarding item 1:

    both "MsgCnt" and "Work" are raped by the function -  _SL_DBG_CNT_INC() and is used for debug purposes. if you look at the trace.h file you will see that there is no function definition for this function. Hence there is no compiler error when the "MsgCnt" and "Work" have no definition and declaration.

    Regarding item 2: 

    If you set the structures correctly you shouldn't be receiving an error. can you give more context on what you are trying to achieve and we can point you in the right direction.(code was not attached)

    best regards,

    Avi

  • Hi Avi,

    If you set the structures correctly you shouldn't be receiving an error. can you give more context on what you are trying to achieve and we can point you in the right direction.(code was not attached)

    Kindly refer to this screenshot folder: screenshot.zip

    Let me know if you need more information

    Regards,

    Marvin

  • Hi Marvin,

    As in item 1:

    (_SlArgsData_t *)(g_pCB->ObjPool[g_pCB->FunctionParams.AsyncExt.ActionIndex].pData))->pArgs

    is wrapped by:

    VERIFY_SOCKET_CB() which is just defined as true so there shouldn't be any problem.
    if you have a more detailed explanation of what you are trying to do, we can better help.
    best regards,
    Avi
  • Hi Avi,

    Item 1.

    Can you tell where is the definition of the structure: g_DbgCnt. I cannot find it anywhere.

    WIFI_Defines.zip

    Item 2:

    The customer is positive that the structures are set correctly. They copied the code verbatim from the web. The line in question is on line 1,439 in the attached file.  

    Let me know if you need more information

    Regards,

    Marvin

  • These are optional debug functions and variables that are to be implemented by the user. that's why you cant find them.

    waiting for more info on the objective so we can better support the costumer.

    best regard,

    Avi

  • Hi Avi,

    Cx is trying to reverse engineer the Wi-Fi driver code to understand what is happening with it instead of just copying and pasting an example. they have gotten to the line in question and cannot seem to get it to work.  

    Regards,

    Marvin

  • HI Marvin,

    the code in trace.h:

    /* #define SL_DBG_CNT_ENABLE */
    #ifdef SL_DBG_CNT_ENABLE
    #define _SL_DBG_CNT_INC(Cnt)            g_DbgCnt. ## Cnt++
    #define _SL_DBG_SYNC_LOG(index,value)   {if(index < SL_DBG_SYNC_LOG_SIZE){*(_u32 *)&g_DbgCnt.SyncLog[index] = *(_u32 *)(value);}}
    
    #else
    #define _SL_DBG_CNT_INC(Cnt)
    #define _SL_DBG_SYNC_LOG(index,value)
    #endif

    you can see that 

    SL_DBG_CNT_ENABLE is not defined and hence the calls to 
    _SL_DBG_CNT_INC() don't do anything. If you wish to use this counter for counting the read and write operations you need to define the structures appropriately.
    these functions are for debug prepuces. and don't impact the functionality of the driver.  
    to better understand how the driver works id start by reading:
    chapter 19 about porting the host driver.
    best regards,
    Avi
  • Hi Avi,

    Thank you. This helps with item 1. How about the type-casting error in Item 2? would you kindly help further?

    Regards,

    Marvin

  • HI Marvin,

    as you can see in the following code, currently the 

    VERIFY_SOCKET_CB() is just defined to true and has no affect on the diver.c function

    #if (defined(PROTECT_SOCKET_ASYNC_RESP) && (SL_SELF_COND_HANDLING == SL_HANDLING_ASSERT))
    #define VERIFY_SOCKET_CB(expr)                  _SL_ASSERT(expr)
    #elif (defined(PROTECT_SOCKET_ASYNC_RESP) && (SL_SELF_COND_HANDLING == SL_HANDLING_ERROR))
    #define VERIFY_SOCKET_CB(expr)                  _SL_ERROR(expr, SL_RET_CODE_SELF_ERROR)
    #else
    #define VERIFY_SOCKET_CB(expr)
    #endif

    As I wrote before if the client wishes to implement these self conditions by himself he can but adjustments need to be made.

    I see the casting issue and we will try to fix this for further releases. if the client wishes to implement this he will need to fix the casting. although it is not necessary for basic functionality.