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.

AWR1243BOOST: Clarification for client call backs in mmwave link libraray

Part Number: AWR1243BOOST
Other Parts Discussed in Thread: AWR1243, AWR2243

Hi I am using AWR1243 BOOST EVM first time , I am configuring AWR1243 BOOST EVM from external HOST controller , I have the mmwave link library from the TI DFP.

I am using freeRTOS in the HOST controller, I have done most of the configuration , for few client call back functions I am not able to understand what I need to do.

The first one is , rlInt32_t (*rlOsiSpawn)(RL_P_OSI_SPAWN_ENTRY pEntry, const void* pValue, rlUInt32_t flags); in rlOsiMsgQCbs  , I am not able to understand the 

use of this function , how I need to handle this function as part of the client callback , I am using freeRTOS for my application. 

  • Hi,

    Please use google site search as follows to see similar threads in this forum

    site e2e.ti.com mmwave link porting

    site e2e.ti.com mmwave link call back

    site e2e.ti.com mmwave link pEntry

    Thank you

    Cesar

  • Hi I have went through the links and solved most of the callbacks but for OSISPAWN , there was explanation for only nonOSSPAWN , so i didn't clear picture for how to provide the client callback for OSISPAWN.

    I am trying to provide the freeRTOS function as client call back for OSISPAWN , how can i achieve that?

  • Hi Surya,

    I would request you to refer mmwave studio CLI which is based on TI-RTOS but give you context to implement for Free-RTOS

    https://dev.ti.com/tirex/explore/node?node=AK3GYIhDPkgp.R8qt-gVUg__Z2F8GEn__LATEST

    in mmwl_if.c file, refer MmwaveLink_spawn and MmwaveLink_mmwaveLinkMgmtTask function.

    RlApp_ClientCtx.osiCb.queue.rlOsiSpawn      = MmwaveLink_spawn;

    And on the other hand, mmWave MCU PLus SDK 4.2.0.3 provide reference to communicate to AWR2243 from AM273x device which is based on Free-RTOS. (here AWR2243 can be replaced with AWR1243 with some change but mmwavelink hooks will be same).

    mmwave_link_spi_22xx.c :  MMWave_initMMWaveLink

        RlApp_ClientCtx.osiCb.queue.rlOsiSpawn = &MMWave_spawn;

    Regards,

    Jitendra

  • Thank you so much , I will check on this 

  • Hi Jitendra,

    This is the only example i was able to find related to osspawn , i took this from mmwave sdk 3.5.0.4 

    /**
    * @b Description
    * @n
    * This is the mmWave link registered callback function which is invoked
    * to ensure that the spawn function is invoked in a different execution
    * context
    *
    * @param[in] fxn
    * Pointer to the function to be executed in a different context
    * @param[in] pValue
    * Pointer of data to be passed to the function
    * @param[in] flags
    * Flag to indicate preference
    *
    * \ingroup MMWAVE_INTERNAL_FUNCTION
    *
    * @retval
    * Success - 0
    * @retval
    * Error - <0
    */
    static rlInt32_t MMWave_spawn
    (
    RL_P_OSI_SPAWN_ENTRY fxn,
    const void* pValue,
    uint32_t flags
    )
    {
    MMWave_SpawnFxnNode* ptrSpawnFxnNode;
    uintptr_t key;
    int32_t retVal = 0;

    /* Critical Section: The spawn free list is a critical resource which is accessed
    * from multiple contexts */
    key = HwiP_disable();
    ptrSpawnFxnNode = (MMWave_SpawnFxnNode*)MMWave_listRemove ((MMWave_ListNode**)&gMMWave_MCB.ptrSpawnFxnFreeList);
    HwiP_restore (key);

    /* Did we get an entry? */
    if (ptrSpawnFxnNode != NULL)
    {
    /* YES: Populate the entry */
    ptrSpawnFxnNode->spawnEntry = fxn;
    ptrSpawnFxnNode->arg = pValue;

    /* Critical Section: The spawn active list is a critical resource which is accessed
    * from multiple contexts */
    key = HwiP_disable();
    MMWave_listAdd ((MMWave_ListNode**)&gMMWave_MCB.ptrSpawnFxnActiveList, (MMWave_ListNode*)ptrSpawnFxnNode);
    HwiP_restore (key);

    /* Keep track of the number of spawn messages which have been received */
    gMMWave_MCB.spawnCounter++;

    /* Wake up the mmWave execution thread */
    SemaphoreP_post (gMMWave_MCB.linkSemHandle);
    }
    else
    {
    /* Error: No span free node was present. This can happen if all the spawn functions
    * have been taken up and the execute mmWave control API has not been invoked. Increment
    * statistics to report this condition */
    gMMWave_MCB.spawnOverflow++;

    /* Setup the return value to indicate an error. */
    retVal = MINUS_ONE;
    }
    return retVal;
    }

    this function just adds the passed function pointer to a list and then signals some task through semaphore , I am still not able to understand the clear purpose of this function. can you explain what is the need for this function and how this function works.

  • As you see here, after adding function pointer to list (mmwave_listAdd), it post a semaphore (gMMWave_MCB.linkSemHandle) which is being pending by other task MmwDemo_mmWaveCtrlTask

    MMWave_execute() ---->

    SemaphoreP_pend (&(ptrMMWaveMCB->linkSemHandle), SystemP_WAIT_FOREVER);

    MMWave_executeLink()  -> calling the Spawned function  :   ptrSpawnFxnNode->spawnEntry (ptrSpawnFxnNode->arg);  // for mmwavelink async-event message read

    .

    .

    There are multiple ways of reading this async-event message, you can implement as per your fit.

    Regards,

    Jitendra