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.

AWR1642: How to integrate mmwave link features into the demo project in SDK3.5.0.4 to get the transmitter power?

Part Number: AWR1642

I try to integrate some mmwaveLink features into the demo project in SDK3.5.0.4. 

I hope my radar can continue monitor the Tx power of the radar in each processing cycle when the radar is working.

I try to imitate the rlRfGetTemperatureReport source code in the MmwaveLink to create another my own API to get TxPower, e.g. rlRfGetTxPowerReport

I look into the source code of rlRfGetTemperatureReport API in rl_sensor.c as follows.

rlReturnVal_t rlRfGetTemperatureReport(rlUInt8_t deviceMap, rlRfTempData_t* data)
{
    rlReturnVal_t retVal;

    RL_LOGV_ARG0("rlRfGetTemperatureReport starts...\n");

    /* check if deviceIndex is out of defined value */
    if ((rlDriverIsDeviceMapValid(deviceMap) != RL_RET_CODE_OK) || \
       (RL_NULL_PTR == data))
    {
        /* set return error code */
        retVal = RL_RET_CODE_INVALID_INPUT;
        RL_LOGE_ARG0("rlRfGetTemperatureReport, Invalid device map\n");
    }
    else
    {
        /* Package the command with given data and send it to device */
        retVal = rlDriverExecuteGetApi(deviceMap, RL_RF_MISC_CONF_GET_MSG,
                                       RL_RF_CHAR_CONF_DYNAMIC_GET_SB,
                                       (rlUInt8_t*)data, (rlUInt16_t)sizeof(rlRfTempData_t));
    }
    RL_LOGV_ARG0("rlRfGetTemperatureReport ends...\n");

    return retVal;
}

However I have the problem to assign the parameters of rlDriverExecuteGetApi.  

Please, tell me am I in the right track?

Teach me how to assign the parameters of rlDriverExecuteGetApi if you know about it.

Thanks your help.

  • Hi,

    Please check the Radar Interface Control Document

    C:\ti\mmwave_dfp_01_02_06_03\docs

    You will need to use

    5.13.29 Sub block 0x101B – AWR_MONITOR_TX0_POWER_REPORT_AE_SB

    Please see this example

    C:\ti\mmwave_dfp_01_02_06_03\ti\example\mmwavelink_monitoring

    Thank you

    Cesar

  • Dear Cesar,

    I think there is a difference between mmwave_dfp_01_02_06_03 example code and mmwDemo program in SDK 3.5.0.4.

    In mmwDemo program, it used the mmwave library which has the initial MMWave_XXXX API. 

    However   mmwave_dfp_01_02_06_03 example is based on the mmwavelink framework.

    I try to merge mmwave_dfp_01_02_06_03 example code into the demo program. 

    However, it did not work at all.  It won't report object detection results and looks like the radar is dead because it won't accept any CLI command.

    I guess we can NOT use mmwave library and mmwavelink framework together in the demo program.  

    Am I right?  Any advise is welcome.

    Thanks in advanced. 

  • Hi,

    Unfortunately we don't have SDK example updated with monitoring.

    Adding monitoring will require significant sw updates

    Thank you

    Cesar

  • Hi Cesar,

    Let me explain what I have done. Then you may see anything wrong in the first glance and give me some advises.

    I think the key point is to set Tx power configuration correctly.  Here I directly use the function, named

    MMWL_setRfTxPowMonConfig, in mmwave_dfp_01_02_06_03 example, as follows.

    int32_t MMWL_setRfTxPowMonConfig(void)
    {
        int32_t         retVal;
        rlTxPowMonConf_t tx0PowrMonCfg = { 0, 7, 0, 2, 0, 30, 30, 0, 0 };
        rlTxPowMonConf_t tx1PowrMonCfg = { 0, 7, 0, 2, 0, 30, 30, 0, 0 };
    #if (ENABLE_TX2)
        rlTxPowMonConf_t tx2PowrMonCfg = { 0, 7, 0, 2, 0, 30, 30, 0, 0 };
    #else
        rlTxPowMonConf_t *tx2PowrMonCfg = NULL;
    #endif
    
        rlAllTxPowMonConf_t data = { &tx0PowrMonCfg, &tx1PowrMonCfg, tx2PowrMonCfg };
    
    
        /* TX Power Monitoring configuration */
        retVal = rlRfTxPowrMonConfig(RL_DEVICE_MAP_CASCADED_1, &data);
    
        /* Sanity Check: Was the mmWave link successful? */
        if (retVal != 0)
        {
            /* Error: Link reported an issue. */
            printf("Error: rlRfTxPowrMonConfig retVal=%d\n", retVal);
            return -1;
        }
    
        printf("Debug: Finished information related to TX Power monitor configurations to BSS\n");
        return retVal;
    }
    
     

    Then, I decide where I should call MMWL_setRfTxPowMonConfig.

    After look up the demo program, I guess, but not sure,  it is the good place to invoke  MMWL_setRfTxPowMonConfig in MmwDemo_configSensor.

    Therefore, I call MMWL_setRfTxPowMonConfig() like that.

    int32_t MmwDemo_configSensor(void)
    {
        int32_t     errCode = 0;
    
        CLI_write("MmwDemo_configSensor");
        /* Prepare BPM configuration */
        if(MmwDemo_bpmConfig() < 0)
        {
            System_printf ("Error: MMWDemoMSS mmWave BPM Configuration failed\n");
            return -1;
        }
        /* Prepare TxPower monitor configuration */
        if (MMWL_setRfTxPowMonConfig() < 0)
        {
            CLI_write ("Error: MMWDemoMSS mmWave set TxPower Configuration failed\n");
            return -1;
        }
        /* Configure the mmWave module: */
        if (MMWave_config (gMmwMssMCB.ctrlHandle, &gMmwMssMCB.cfg.ctrlCfg, &errCode) < 0)
        {
            MMWave_ErrorLevel   errorLevel;
            int16_t             mmWaveErrorCode;
            int16_t             subsysErrorCode;
    
            /* Error: Report the error */
            MMWave_decodeError (errCode, &errorLevel, &mmWaveErrorCode, &subsysErrorCode);
            System_printf ("Error: mmWave Config failed [Error code: %d Subsystem: %d]\n",
                            mmWaveErrorCode, subsysErrorCode);
        }
        else
        {
            errCode = MmwDemo_dataPathConfig();
        }
    
        return errCode;
    }

    However, the execution results show that "Error: MMWDemoMSS mmWave set TxPower Configuration failed\n".

    That means it fails to MMWL_setRfTxPowMonConfig().

    Right now, I don't know how to and where to correctly set Tx Power configuration.

    Hope to receive any advises on that. 

    If there is no obvious solution in SDK 3.5.0.4, hope TI can have the solution in the new versioned SDK. 

    Thanks in advanced.

  • I have it pass the MMWL_setRfTxPowMonConfig. 

    I replaced MMWL_setRfTxPowMonConfig in the bottom of MmwDemo_startSensor instead of MmwDemo_configSensor as follows.

    int32_t MmwDemo_startSensor(void)
    {
        int32_t     errCode;
        MMWave_CalibrationCfg   calibrationCfg;
    
        /*****************************************************************************
         * Data path :: start data path first - this will pend for DPC to ack
         *****************************************************************************/
        MmwDemo_dataPathStart();
    
        /*****************************************************************************
         * RF :: now start the RF and the real time ticking
         *****************************************************************************/
        /* Initialize the calibration configuration: */
        memset ((void *)&calibrationCfg, 0, sizeof(MMWave_CalibrationCfg));
        /* Populate the calibration configuration: */
        calibrationCfg.dfeDataOutputMode = gMmwMssMCB.cfg.ctrlCfg.dfeDataOutputMode;
        calibrationCfg.u.chirpCalibrationCfg.enableCalibration    = true;
        calibrationCfg.u.chirpCalibrationCfg.enablePeriodicity    = true;
        calibrationCfg.u.chirpCalibrationCfg.periodicTimeInFrames = 10U;
    
        DebugP_log0("App: MMWave_start Issued\n");
    
        System_printf("Starting Sensor (issuing MMWave_start)\n");
    
        /* Start the mmWave module: The configuration has been applied successfully. */
        if (MMWave_start(gMmwMssMCB.ctrlHandle, &calibrationCfg, &errCode) < 0)
        {
            MMWave_ErrorLevel   errorLevel;
            int16_t             mmWaveErrorCode;
            int16_t             subsysErrorCode;
    
            /* Error/Warning: Unable to start the mmWave module */
            MMWave_decodeError (errCode, &errorLevel, &mmWaveErrorCode, &subsysErrorCode);
            System_printf ("Error: mmWave Start failed [mmWave Error: %d Subsys: %d]\n", mmWaveErrorCode, subsysErrorCode);
            /* datapath has already been moved to start state; so either we initiate a cleanup of start sequence or
               assert here and re-start from the beginning. For now, choosing the latter path */
            MmwDemo_debugAssert(0);
            return -1;
        }
    
        /*****************************************************************************
         * The sensor has been started successfully. Switch on the LED
         *****************************************************************************/
    //    hwal_working_led(0, 1);
    
        gMmwMssMCB.sensorStartCount++;
    
        if (MMWL_setRfTxPowMonConfig() < 0)
        {
            CLI_write ("Error: MMWDemoMSS mmWave set TxPower Configuration failed\n");
            return -1;
        }
        else
            CLI_write ("MMWDemoMSS mmWave set TxPower Configuration PASS\n");
    
    
        return 0;
    

    Then I got the result: "MMWDemoMSS mmWave set TxPower Configuration PASS"

    However, I can not get RL_RF_AE_MON_TX0_POWER_REPORT event from MmwDemo_eventCallbackFxn.

    The below is my MmwDemo_eventCallbackFxn function.

    int32_t MmwDemo_eventCallbackFxn(uint16_t msgId, uint16_t sbId, uint16_t sbLen, uint8_t *payload)
    {
    //    char displayMsg[200];
        uint16_t asyncSB = RL_GET_SBID_FROM_UNIQ_SBID(sbId);
        CLI_write ("Debug: BSS Event MsgId: %d [Sub Block Id: %d asyncSB: %d]\n",
                            msgId, sbId, asyncSB);
        /* Process the received message: */
        switch (msgId)
        {
            case RL_RF_ASYNC_EVENT_MSG:
            {
                /* Received Asychronous Message: */
                switch (asyncSB)
                {
                    case RL_RF_AE_CPUFAULT_SB:
                    {
                        MmwDemo_debugAssert(0);
                        break;
                    }
                    case RL_RF_AE_ESMFAULT_SB:
                    {
                        MmwDemo_debugAssert(0);
                        break;
                    }
                    case RL_RF_AE_ANALOG_FAULT_SB:
                    {
                        MmwDemo_debugAssert(0);
                        break;
                    }
                    case RL_RF_AE_MON_TEMPERATURE_REPORT_SB:
                    {
                        memcpy(&gMonDataAeStrct.monTempReport, payload, sizeof(rlMonTempReportData_t));
                        CLI_write("RL_RF_AE_MON_TEMPERATURE_REPORT_SB ");
                    }
                    case RL_RF_AE_MON_TX0_POWER_REPORT:
                    {
                        memcpy(&gMonDataAeStrct.monTx0powRep, payload, sizeof(rlMonTxPowRep_t));
                        CLI_write("RL_RF_AE_MON_TX0_POWER_REPORT0 ");
                    }
                    case RL_RF_AE_MON_TX1_POWER_REPORT:
                    {
                        memcpy(&gMonDataAeStrct.monTx1powRep, payload, sizeof(rlMonTxPowRep_t));
                        CLI_write("RL_RF_AE_MON_TX0_POWER_REPORT1 ");
                    }
                    case RL_RF_AE_INITCALIBSTATUS_SB:
                    {
                        rlRfInitComplete_t*  ptrRFInitCompleteMessage;
                        uint32_t            calibrationStatus;
    
                        /* Get the RF-Init completion message: */
                        ptrRFInitCompleteMessage = (rlRfInitComplete_t*)payload;
                        calibrationStatus = ptrRFInitCompleteMessage->calibStatus & 0x1FFFU;
    
                        /* Display the calibration status: */
                        CLI_write ("Debug: Init Calibration Status = 0x%x\n", calibrationStatus);
                        break;
                    }
                    case RL_RF_AE_FRAME_TRIGGER_RDY_SB:
                    {
                        gMmwMssMCB.stats.frameTriggerReady++;
                        break;
                    }
                    case RL_RF_AE_MON_TIMING_FAIL_REPORT_SB:
                    {
                        gMmwMssMCB.stats.failedTimingReports++;
                        break;
                    }
                    case RL_RF_AE_RUN_TIME_CALIB_REPORT_SB:
                    {
                        gMmwMssMCB.stats.calibrationReports++;
                        break;
                    }
                    case RL_RF_AE_FRAME_END_SB:
                    {
                        gMmwMssMCB.stats.sensorStopped++;
                        DebugP_log0("App: BSS stop (frame end) received\n");
    
                        MmwDemo_dataPathStop();
                        break;
                    }
                    default:
                    {
                        System_printf ("Error: RL_RF_ASYNC_EVENT_MSG/asyncSB SBId= %d not handled\n", asyncSB);
                        break;
                    }
                }
                break;
            }
            /* Async Event from MMWL */
            case RL_MMWL_ASYNC_EVENT_MSG:
            {
                switch (asyncSB)
                {
                    case RL_MMWL_AE_MISMATCH_REPORT:
                    {
                        /* link reports protocol error in the async report from BSS */
                        MmwDemo_debugAssert(0);
                        break;
                    }
                    case RL_MMWL_AE_INTERNALERR_REPORT:
                    {
                        /* link reports internal error during BSS communication */
                        MmwDemo_debugAssert(0);
                        break;
                    }
                    case RL_RF_AE_MON_TEMPERATURE_REPORT_SB:
                    {
                        memcpy(&gMonDataAeStrct.monTempReport, payload, sizeof(rlMonTempReportData_t));
                        CLI_write("RL_RF_AE_MON_TEMPERATURE_REPORT_SB ");
                    }
                    case RL_RF_AE_MON_TX0_POWER_REPORT:
                    {
                        memcpy(&gMonDataAeStrct.monTx0powRep, payload, sizeof(rlMonTxPowRep_t));
                        CLI_write("RL_RF_AE_MON_TX0_POWER_REPORT2 ");
                    }
                    case RL_RF_AE_MON_TX1_POWER_REPORT:
                    {
                        memcpy(&gMonDataAeStrct.monTx1powRep, payload, sizeof(rlMonTxPowRep_t));
                        CLI_write("RL_RF_AE_MON_TX0_POWER_REPORT3 ");
                    }
                    default:
                        CLI_write("RL_MMWL_ASYNC_EVENT_MSG/asyncSB=%d is not handled",asyncSB);
                        break;
                }
                break;
            }
            default:
            {
                System_printf ("Error: Asynchronous message %d is NOT handled\n", msgId);
                break;
            }
        }
        return 0;
    }
    

    I need any advises/guide lines to figure out what I can not receive the  RL_RF_AE_MON_TX0_POWER_REPORT 

    Thanks in advanced.

  • Hi,

    Unfortunately we don't have an example of this feature

    thank you
    Cesar

  • Hi,

    You should not edit any of the source code of mmwavelink library. but use application to invoke mmwavelink APIs to get the results.

    We don't have these features implemented as part of mmw (oob) demo but mmwavelink provides test app to showcase usage of multiple monitors APIs.

    I would request you to refer that from this path-

    C:\ti\mmwave_sdk_03_05_00_04\packages\ti\control\mmwavelink\test\

    For Tx Power Monitor use this  : test\common\link_test_monitoring.c->  MmwaveLink_setRfTxPowMonConfig -> rlRfTxPowrMonConfig

    This is to configure Tx Power Monitor and from another API you need to enable this monitor feature

    MmwaveLink_setRfAnaMonConfig:  rlMonAnaEnables_t ->enMask

    rl_monitor.h--->

    typedef struct rlMonAnaEnables
    {
        /**
         * @brief  Bit   Analog monitoring control \n
                    0   TEMPERATURE_MONITOR_EN \n
                    1   RX_GAIN_PHASE_MONITOR_EN \n
                    2   RX_NOISE_MONITOR_EN \n
                    3   RX_IFSTAGE_MONITOR_EN \n
                    4   TX0_POWER_MONITOR_EN \n
                    5   TX1_POWER_MONITOR_EN \n
                    6   TX2_POWER_MONITOR_EN \n
                    7   TX0_BALLBREAK_MONITOR_EN \n
                    8   TX1_BALLBREAK_MONITOR_EN \n
                    9   TX2_BALLBREAK_MONITOR_EN \n
                    10  TX_GAIN_PHASE_MONITOR_EN \n
                    11  TX0_BPM_MONITOR_EN \n
                    12  TX1_BPM_MONITOR_EN \n
                    13  TX2_BPM_MONITOR_EN \n
                    14  SYNTH_FREQ_MONITOR_LIVE_EN \n
                    15  EXTERNAL_ANALOG_SIGNALS_MONITOR_EN \n
                    16  INTERNAL_TX0_SIGNALS_MONITOR_EN \n
                    17  INTERNAL_TX1_SIGNALS_MONITOR_EN \n
                    18  INTERNAL_TX2_SIGNALS_MONITOR_EN \n
                    19  INTERNAL_RX_SIGNALS_MONITOR_EN \n
                    20  INTERNAL_PMCLKLO_SIGNALS_MONITOR_EN \n
                    21  INTERNAL_GPADC_SIGNALS_MONITOR_EN \n
                    22  PLL_CONTROL_VOLTAGE_MONITOR_EN \n
                    23  DCC_CLOCK_FREQ_MONITOR_EN \n
                    24  RX_IF_SATURATION_MONITOR_EN \n
                    25  RX_SIG_IMG_BAND_MONITORING_EN \n
                    26  RX_MIXER_INPUT_POWER_MONITOR \n
                    27  RESERVED \n
                    28  SYNTH_FREQ_MONITOR_NON_LIVE_EN \n
                    31:29   RESERVED \n
         */
        rlUInt32_t enMask;

    Finally with these monitor config and enable when you trigger the frame, report will be recieved to

    test\common\link_test.c :  MmwaveLink_asyncEventHandler : case RL_RF_AE_MON_TX0_POWER_REPORT (TX0/1/2)

    I hope this info will help you to complete your monitor implementation.

    Regards,

    Jitendra