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.

CCS/IWR6843: IWR6843

Part Number: IWR6843

Tool/software: Code Composer Studio

hello,

I tried with "ods_point_cloud_68xx_hwa_es1" demo project and in that i modified & hard coded [mmw_cli.cMmwDemo_CLILvdsStreamCfg function as 

int8_t                  subFrameNum=LVDSSTREAM_HCC_SUBFRAME_IDX;

cfg.isHeaderEnabled = LVDSSTREAM_HCC_ENABLE_HEADER; //(bool) atoi(argv[2]);
cfg.dataFmt = LVDSSTREAM_HCC_DATA_FMT; //(uint8_t) atoi(argv[3]);
cfg.isSwEnabled = LVDSSTREAM_HCC_ENABLE_SW; //(bool) atoi(argv[4]);

then with help of mmw visualizer i got LVDS Data output. that is ok 

But the problem is each and every command which comes from visualizer need to implement hard coded instead of this i want LVDS data output in "mmwave_sdk_68xx_hcc_mss" demo project .[ Industrial Toolbox 4.5.1 ]

to get LVDS Data i did following changes in hc_config_defs.h header file. but still i am not getting any data on LVDS lines.

#ifndef HC_CONFIG_DEFS_H
#define HC_CONFIG_DEFS_H
#include <ti/common/sys_common.h>

// #ifndef PROFILE_CALIBRATION
// #define PROFILE_CALIBRATION
// #endif
//
#ifndef PROFILE_ADVANCED_SUBFRAME
#define PROFILE_ADVANCED_SUBFRAME
#endif
//
// #ifndef PROFILE_2d_BPM
// #define PROFILE_2d_BPM
// #endif

// #ifndef PROFILE_2d
// #define PROFILE_2d
// #endif


#define CHANNEL_HCC_CASCADING (0U)

#define ADC_HCC_NUM_ADC_BITS (2U)
#define ADC_HCC_OUTPUT_FMT (1U)

#define ADCBUF_HCC_SUBFRAME_IDX (-1)
#define ADCBUF_HCC_OUTPUT_FMT (0U)
#define ADCBUF_HCC_SAMPLE_SWAP (1U)
#define ADCBUF_HCC_CHAN_INTERLEAVE (1U)
#define ADCBUF_HCC_CHIRP_THRESHOLD (1U)

#define LP_HCC_DONT_CARE (0U)
#define LP_HCC_LOW_POWER_MODE (0U)

#define CLUTTER_HCC_SUBFRAME_IDX (-1)
#define CLUTTER_HCC_ENABLED (0)

#define AOAFOV_HCC_SUBFRAME_IDX (-1)
#define AOAFOV_HCC_MIN_AZIMUTH_DEG (-90)
#define AOAFOV_HCC_MAX_AZIMUTH_DEG (90U)
#define AOAFOV_HCC_MIN_ELEVATION_DEG (-90)
#define AOAFOV_HCC_MAX_ELEVATION_DEG (90U)

#define COMPRANGEBIASANDRXCHANPHASE (0.0f)

#define EXTENDMAXVELOCITY_HCC_SUBFRAME_IDX (-1)
#define EXTENDMAXVELOCITY_HCC_ENABLED (0U)

#define ANALOGMONITOR_HCC_RX_SATURATION (0U)
#define ANALOGMONITOR_HCC_SIG_IMG_BAND (0U)

#define LVDSSTREAM_HCC_SUBFRAME_IDX (-1)
#define LVDSSTREAM_HCC_ENABLE_HEADER (1U)
#define LVDSSTREAM_HCC_DATA_FMT (1U)
#define LVDSSTREAM_HCC_ENABLE_SW (1U)

#if defined(PROFILE_CALIBRATION)
#include "../mss/hc_config_profile_calibration.h"
#elif defined(PROFILE_ADVANCED_SUBFRAME)
#include "../mss/hc_config_profile_advanced_subframe.h"
#elif defined(PROFILE_2d_BPM)
#include "../mss/hc_config_profile_2d_bpm.h"
#elif defined(PROFILE_2d)
#include "../mss/hc_config_profile_2d.h"
#else
#define PROFILE_3d
#include "../mss/hc_config_profile_3d.h"
#endif

#endif

Please guide me to get LVDS Data by using "mmwave_sdk_68xx_hcc_mss" demo project .

  • Former Member
    0 Former Member

    You will not be able to use the mmwave_sdk_68xx_hcc_mss demo with ES1 6843.

    You can hard code the CLI commands in the ods_point_cloud_68xx_hwa_es1 using the steps shown here https://e2e.ti.com/support/sensors/f/1023/p/956572/3535768#3535768


    Amanda

  • I made hard code the CLI commands file in the ods_point_cloud_68xx_hwa_es1  

    i made changes in mmw_cli.c file all CLI function filled with hard code value but still i am not getting LVDS Data

    for ex. lvdsStreamCfg -1 1 1 1

    /* Populate configuration: */
    cfg.isHeaderEnabled = LVDSSTREAM_HCC_ENABLE_HEADER;             //(bool) atoi(argv[2]);
    cfg.dataFmt = LVDSSTREAM_HCC_DATA_FMT;                                       //(uint8_t) atoi(argv[3]);
    cfg.isSwEnabled = LVDSSTREAM_HCC_ENABLE_SW;                          //(bool) atoi(argv[4]);

    like above example I modified all the Command line interface function but not getting LVDS output.

  • Former Member
    0 Former Member in reply to Roshan Tej Thota
    Can you post the two files added to your project for me to review?
  • Sure, here i attached three file which is 1.mmwave_cli.c   2.profile.h    3.main.c 

    /*
     *   @file  mmw_cli.c
     *
     *   @brief
     *      Mmw (Milli-meter wave) DEMO CLI Implementation
     *
     *  \par
     *  NOTE:
     *      (C) Copyright 2018 Texas Instruments, Inc.
     *
     *  Redistribution and use in source and binary forms, with or without
     *  modification, are permitted provided that the following conditions
     *  are met:
     *
     *    Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     *    Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the
     *    distribution.
     *
     *    Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    /**************************************************************************
     *************************** Include Files ********************************
     **************************************************************************/
    
    /* Standard Include Files. */
    #include <stdint.h>
    #include <stdlib.h>
    #include <stddef.h>
    #include <string.h>
    #include <stdio.h>
    
    /* BIOS/XDC Include Files. */
    #include <xdc/runtime/System.h>
    
    /* mmWave SDK Include Files: */
    #include <ti/common/sys_common.h>
    #include <ti/common/mmwave_sdk_version.h>
    #include <ti/drivers/uart/UART.h>
    #include <ti/control/mmwavelink/mmwavelink.h>
    #include <ti/utils/cli/cli.h>
    #include <ti/utils/mathutils/mathutils.h>
    
    /* Demo Include Files */
    #include <mmw.h>
    #include <mmw_config.h>
    #include <utils/mmwdemo_adcconfig.h>
    #include <utils/mmwdemo_rfparser.h>
    #include <datapath/dpc/objectdetection/objdethwa/objectdetection.h>
    #include <profile.h>
    /**************************************************************************
     *************************** Local Definitions ****************************
     **************************************************************************/
    
    /* CLI Extended Command Functions */
    static int32_t MmwDemo_CLICfarCfg (void);
    static int32_t MmwDemo_CLIMultiObjBeamForming (void);
    static int32_t MmwDemo_CLICalibDcRangeSig (void);
    static int32_t MmwDemo_CLIClutterRemoval (void);
    static int32_t MmwDemo_CLISensorStart ();
    static int32_t MmwDemo_CLISensorStop ();
    static int32_t MmwDemo_CLIGuiMonSel (void);
    static int32_t MmwDemo_CLIADCBufCfg (void);
    static int32_t MmwDemo_CLICompRangeBiasAndRxChanPhaseCfg (void);
    static int32_t MmwDemo_CLIMeasureRangeBiasAndRxChanPhaseCfg (void);
    //static int32_t MmwDemo_CLIBpmCfg(void);
    static int32_t MmwDemo_CLICfarFovCfg (void);
    static int32_t MmwDemo_CLIAoAFovCfg (void);
    static int32_t MmwDemo_CLIExtendedMaxVelocity (void);
    static int32_t MmwDemo_CLIChirpQualityRxSatMonCfg (void);
    static int32_t MmwDemo_CLIChirpQualitySigImgMonCfg (void);
    static int32_t MmwDemo_CLIAnalogMonitorCfg (void);
    static int32_t MmwDemo_CLILvdsStreamCfg (void);
    static void mmwDemo_sensorConfig_task(void);
    /**************************************************************************
     *************************** Extern Definitions *******************************
     **************************************************************************/
    
    extern MmwDemo_MCB    gMmwMCB;
    
    /**************************************************************************
     *************************** CLI  Function Definitions **************************
     **************************************************************************/
    
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for the sensor start command
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLISensorStart ()
    {
        bool doReconfig = true;
        int32_t     retVal = 0;
    
        /*  Only following command syntax will be supported 
            sensorStart
            sensorStart 0
        */
    //    char *cmd[] = {"0","sensorStart"};
    //    if (argc == 2)
     //   {
            doReconfig = true;//(bool) atoi (cmd[1]); //atoi (argv[1]);
    
            if (doReconfig == true)
            {
                CLI_write ("Error: Reconfig is not supported, only argument of 0 is\n"
                           "(do not reconfig, just re-start the sensor) valid\n");
                return -1;
            }
    //    }
        else
        {
            /* In case there is no argument for sensorStart, always do reconfig */
            doReconfig = true;
        }
        
        /***********************************************************************************
         * Do sensor state management to influence the sensor actions
         ***********************************************************************************/
    
        /* Error checking initial state */
        if (gMmwMCB.sensorState == MmwDemo_SensorState_INIT)
        {
            MMWave_CtrlCfg ctrlCfg;
    
            /* need to get number of sub-frames so that next function to check
             * pending state can work */
            CLI_getMMWaveExtensionConfig (&ctrlCfg);
            gMmwMCB.dataPathObj.objDetCommonCfg.preStartCommonCfg.numSubFrames =
                MmwDemo_RFParser_getNumSubFrames(&ctrlCfg);
    
            if (MmwDemo_isAllCfgInPendingState() == 0)
            {
                CLI_write ("Error: Full configuration must be provided before sensor can be started "
                           "the first time\n");
    
                /* Although not strictly needed, bring back to the initial value since we
                 * are rejecting this first time configuration, prevents misleading debug. */
                gMmwMCB.dataPathObj.objDetCommonCfg.preStartCommonCfg.numSubFrames = 0;
    
                return -1;
            }
        }
    
        if (gMmwMCB.sensorState == MmwDemo_SensorState_STARTED)
        {
            CLI_write ("Ignored: Sensor is already started\n");
            return 0;
        }
    
        if (doReconfig == false)
        {
             /* User intends to issue sensor start without config, check if no
                config was issued after stop and generate error if this is the case. */
             if (! MmwDemo_isAllCfgInNonPendingState())
             {
                 /* Message user differently if all config was issued or partial config was
                    issued. */
                 if (MmwDemo_isAllCfgInPendingState())
                 {
                     CLI_write ("Error: You have provided complete new configuration, "
                                "issue \"sensorStart\" (without argument) if you want it to "
                                "take effect\n");
                 }
                 else
                 {
                     CLI_write ("Error: You have provided partial configuration between stop and this "
                                "command and partial configuration cannot be undone."
                                "Issue the full configuration and do \"sensorStart\" \n");
                 }
                 return -1;
             }
        }
        else
        {
            /* User intends to issue sensor start with full config, check if all config
               was issued after stop and generate error if  is the case. */
            if (MmwDemo_isAllCfgInPendingState() == 0)
            {
                /* Message user differently if no config was issued or partial config was
                   issued. */
                if (MmwDemo_isAllCfgInNonPendingState())
                {
                    CLI_write ("Error: You have provided no configuration, "
                               "issue \"sensorStart 0\" OR provide "
                               "full configuration and issue \"sensorStart\"\n");
                }
                else
                {
                    CLI_write ("Error: You have provided partial configuration between stop and this "
                               "command and partial configuration cannot be undone."
                               "Issue the full configuration and do \"sensorStart\" \n");
                }
                return -1;
            }
        }
    
        
        /***********************************************************************************
         * Retreive and check mmwave Open related config before calling openSensor
         ***********************************************************************************/
    
        /*  Fill demo's MCB mmWave openCfg structure from the CLI configs*/
        if (gMmwMCB.sensorState == MmwDemo_SensorState_INIT)
        {
            /* Get the open configuration: */
            CLI_getMMWaveExtensionOpenConfig (&gMmwMCB.cfg.openCfg);
        }
        else
        {
            /* openCfg related configurations like chCfg, lowPowerMode, adcCfg
             * are only used on the first sensor start. If they are different
             * on a subsequent sensor start, then generate a fatal error
             * so the user does not think that the new (changed) configuration
             * takes effect, the board needs to be reboot for the new
             * configuration to be applied.
             */
            MMWave_OpenCfg openCfg;
            gMmwMCB.cfg.openCfg.chCfg.rxChannelEn=CHANNEL_HCC_RX_CHANNEL_EN;
            gMmwMCB.cfg.openCfg.chCfg.txChannelEn=CHANNEL_HCC_TX_CHANNEL_EN;
            gMmwMCB.cfg.openCfg.chCfg.cascading=CHANNEL_HCC_CASCADING;
    
            openCfg.chCfg.rxChannelEn=CHANNEL_HCC_RX_CHANNEL_EN;        //RX Channel
            openCfg.chCfg.txChannelEn=CHANNEL_HCC_TX_CHANNEL_EN;        //TX channel
            openCfg.chCfg.cascading=CHANNEL_HCC_CASCADING;
            CLI_getMMWaveExtensionOpenConfig (&openCfg);
            /* Compare openCfg->chCfg*/
            if(memcmp((void *)&gMmwMCB.cfg.openCfg.chCfg, (void *)&openCfg.chCfg,
                              sizeof(rlChanCfg_t)) != 0)
            {
                MmwDemo_debugAssert(0);
            }
            
            /* Compare openCfg->lowPowerMode*/
            gMmwMCB.cfg.openCfg.lowPowerMode.lpAdcMode=LP_HCC_LOW_POWER_MODE;
            openCfg.lowPowerMode.lpAdcMode=LP_HCC_LOW_POWER_MODE;
         //   openCfg.lowPowerMode.reserved=LP_HCC_DONT_CARE;
            if(memcmp((void *)&gMmwMCB.cfg.openCfg.lowPowerMode, (void *)&openCfg.lowPowerMode,
                              sizeof(rlLowPowerModeCfg_t)) != 0)
            {
                MmwDemo_debugAssert(0);
            }
            /* Compare openCfg->adcOutCfg*/
            gMmwMCB.cfg.openCfg.adcOutCfg.fmt.b2AdcBits=ADC_HCC_NUM_ADC_BITS;
            gMmwMCB.cfg.openCfg.adcOutCfg.fmt.b2AdcOutFmt=ADC_HCC_OUTPUT_FMT;
            openCfg.adcOutCfg.fmt.b2AdcBits=ADC_HCC_NUM_ADC_BITS;
            openCfg.adcOutCfg.fmt.b2AdcOutFmt=ADC_HCC_OUTPUT_FMT;
            if(memcmp((void *)&gMmwMCB.cfg.openCfg.adcOutCfg, (void *)&openCfg.adcOutCfg,
                              sizeof(rlAdcOutCfg_t)) != 0)
            {
                MmwDemo_debugAssert(0);
            }
        }
        
        retVal = MmwDemo_openSensor(gMmwMCB.sensorState == MmwDemo_SensorState_INIT);
        if(retVal != 0)
        {
            return -1;
        }
    
        /***********************************************************************************
         * Retrieve mmwave Control related config before calling startSensor
         ***********************************************************************************/
        /* Get the mmWave ctrlCfg from the CLI mmWave Extension */
        if (doReconfig) {
            CLI_getMMWaveExtensionConfig (&gMmwMCB.cfg.ctrlCfg);
            retVal = MmwDemo_configSensor();
            if(retVal != 0)
            {
                return -1;
            }
        }
    
        retVal = MmwDemo_startSensor();
        if(retVal != 0)
        {
            return -1;
        }
        
        /***********************************************************************************
         * Set the state
         ***********************************************************************************/
        gMmwMCB.sensorState = MmwDemo_SensorState_STARTED;
        return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for the sensor stop command
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLISensorStop ()
    {
        if ((gMmwMCB.sensorState == MmwDemo_SensorState_STOPPED) ||
            (gMmwMCB.sensorState == MmwDemo_SensorState_INIT))
        {
            CLI_write ("Ignored: Sensor is already stopped\n");
            return 0;
        }
        
        MmwDemo_stopSensor();
        
        MmwDemo_resetStaticCfgPendingState();
    
        gMmwMCB.sensorState = MmwDemo_SensorState_STOPPED;
        return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      Utility function to get sub-frame number
     *
     *  @param[in] argc  Number of arguments
     *  @param[in] argv  Arguments
     *  @param[in] expectedArgc Expected number of arguments
     *  @param[out] subFrameNum Sub-frame Number (0 based)
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    //static int32_t MmwDemo_CLIGetSubframe (int32_t argc, char* argv[], int32_t expectedArgc,
    //                                       int8_t* subFrameNum)
    //{
    //    int8_t subframe;
    //
    //    /* Sanity Check: Minimum argument check */
    //    if (argc != expectedArgc)
    //    {
    //        CLI_write ("Error: Invalid usage of the CLI command\n");
    //        return -1;
    //    }
    //
    //    /*Subframe info is always in position 1*/
    //    subframe = (int8_t) atoi(argv[1]);
    //
    //    if(subframe >= (int8_t)RL_MAX_SUBFRAMES)
    //    {
    //        CLI_write ("Error: Subframe number is invalid\n");
    //        return -1;
    //    }
    //
    //    *subFrameNum = (int8_t)subframe;
    //
    //    return 0;
    //}
    
    
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for gui monitoring configuration
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLIGuiMonSel ()
    {
        MmwDemo_GuiMonSel   guiMonSel;
        int8_t              subFrameNum=GUI_HCC_0_SUBFRAME_IDX;
    
    //    if(MmwDemo_CLIGetSubframe(argc, argv, 8, &subFrameNum) < 0)
    //    {
    //        return -1;
    //    }
    
        /* Initialize the guiMonSel configuration: */
        memset ((void *)&guiMonSel, 0, sizeof(MmwDemo_GuiMonSel));
    
        /* Populate configuration: */
        guiMonSel.detectedObjects           = GUI_HCC_0_DETECTED_OBJECTS;   //atoi (argv[2]);
        guiMonSel.logMagRange               = GUI_HCC_0_LOG_MAGNITUDE_RANGE;//atoi (argv[3]);
        guiMonSel.noiseProfile              = GUI_HCC_0_NOISE_PROFILE;      //atoi (argv[4]);
        guiMonSel.rangeAzimuthHeatMap       = GUI_HCC_0_RANGE_AZIMUTH_MAP;  //atoi (argv[5]);
        guiMonSel.rangeDopplerHeatMap       = GUI_HCC_0_RANGE_DOPPLER_MAP;  //atoi (argv[6]);
        guiMonSel.statsInfo                 = GUI_HCC_0_STATS_INFO;         //atoi (argv[7]);
    
        MmwDemo_CfgUpdate((void *)&guiMonSel, MMWDEMO_GUIMONSEL_OFFSET,
            sizeof(MmwDemo_GuiMonSel), subFrameNum);
    
        return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for CFAR configuration
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLICfarCfg ()
    {
        DPU_CFARCAProc_CfarCfg  cfarCfg;
            uint32_t                procDirection;
            int8_t                  subFrameNum=CFAR_HCC_0_SUBFRAME_IDX;
    
            /* Initialize configuration: */
                memset ((void *)&cfarCfg, 0, sizeof(cfarCfg));
    
            /* Initialize Processing Direction */
                memset ((void *)&procDirection, 0, sizeof(uint32_t));
    
            /* Initialize Subframe Index */
                memset((void *)&subFrameNum, 0, sizeof(int8_t));
    
            /* Populate configuration: */
            subFrameNum                  = CFAR_HCC_0_SUBFRAME_IDX;
            procDirection                = CFAR_HCC_0_PROC_DIRECTION;
            cfarCfg.averageMode       = CFAR_HCC_0_MODE;
            cfarCfg.winLen            = CFAR_HCC_0_NOISE_WIN;
            cfarCfg.guardLen          = CFAR_HCC_0_GUARD_LEN;
            cfarCfg.noiseDivShift     = CFAR_HCC_0_DIV_SHIFT;
            cfarCfg.cyclicMode        = CFAR_HCC_0_CYCLIC_MODE;
            cfarCfg.thresholdScale    = (uint16_t) (CFAR_HCC_0_THRESHOLD_SCALE * MMWDEMO_CFAR_THRESHOLD_ENCODING_FACTOR);
            cfarCfg.peakGroupingEn    = CFAR_HCC_0_PEAK_GROUPING;
    
            subFrameNum                  = CFAR_HCC_1_SUBFRAME_IDX;
            procDirection                = CFAR_HCC_1_PROC_DIRECTION;
            cfarCfg.averageMode       = CFAR_HCC_1_MODE;
            cfarCfg.winLen            = CFAR_HCC_1_NOISE_WIN;
            cfarCfg.guardLen          = CFAR_HCC_1_GUARD_LEN;
            cfarCfg.noiseDivShift     = CFAR_HCC_1_DIV_SHIFT;
            cfarCfg.cyclicMode        = CFAR_HCC_1_CYCLIC_MODE;
            cfarCfg.thresholdScale    = (uint16_t) (CFAR_HCC_1_THRESHOLD_SCALE * MMWDEMO_CFAR_THRESHOLD_ENCODING_FACTOR);
            cfarCfg.peakGroupingEn    = CFAR_HCC_1_PEAK_GROUPING;
    
            /* Save Configuration to use later */
    //        for (i = 0; i < numProf; i++){
                if (procDirection == 0){
                    MmwDemo_CfgUpdate((void *)&cfarCfg, MMWDEMO_CFARCFGRANGE_OFFSET, sizeof(cfarCfg), subFrameNum);
                }
                else{
                    MmwDemo_CfgUpdate((void *)&cfarCfg, MMWDEMO_CFARCFGDOPPLER_OFFSET, sizeof(cfarCfg), subFrameNum);
                }
    //        }
            return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for CFAR FOV (Field Of View) configuration
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLICfarFovCfg ()
    {
        DPU_CFARCAProc_FovCfg   fovCfg;
        uint32_t            procDirection;
        int8_t              subFrameNum=CFAR_FOV_HCC_0_SUBFRAME_IDX;
    
    
        /* Initialize configuration: */
            memset ((void *)&fovCfg, 0, sizeof(fovCfg));
        /* Initialize Processing Direction */
            memset ((void *)&procDirection, 0, sizeof(uint32_t));
        /* Initialize Subframe Index */
            memset((void *)&subFrameNum, 0, sizeof(int8_t));
    
        /* Populate configuration: */
        procDirection             = (uint32_t)CFAR_FOV_HCC_0_PROC_DIRECTION;// atoi (argv[2]);
        fovCfg.min                = (float)CFAR_FOV_HCC_0_MINIMUM;// atof (argv[3]);
        fovCfg.max                = (float)CFAR_FOV_HCC_0_MAXIMUM;// atof (argv[4]);
    
        procDirection             = CFAR_FOV_HCC_1_PROC_DIRECTION;
        fovCfg.min                = CFAR_FOV_HCC_1_MINIMUM;
        fovCfg.max                = CFAR_FOV_HCC_1_MAXIMUM;
    
        /* Save Configuration to use later */
        if (procDirection == 0)
        {
            MmwDemo_CfgUpdate((void *)&fovCfg, MMWDEMO_FOVRANGE_OFFSET,
                              sizeof(fovCfg), subFrameNum);
        }
        else
        {
            MmwDemo_CfgUpdate((void *)&fovCfg, MMWDEMO_FOVDOPPLER_OFFSET,
                              sizeof(fovCfg), subFrameNum);
        }
        return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for AoA FOV (Field Of View) configuration
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLIAoAFovCfg ()
    {
        DPU_AoAProc_FovAoaCfg   fovCfg;
        int8_t              subFrameNum=AOAFOV_HCC_SUBFRAME_IDX;
    
        /* Initialize configuration: */
        memset ((void *)&fovCfg, 0, sizeof(fovCfg));
    
        /* Populate configuration: */
        fovCfg.minAzimuthDeg      =  (float)AOAFOV_HCC_MIN_AZIMUTH_DEG;   // atoi (argv[2]);
        fovCfg.maxAzimuthDeg      =  (float)AOAFOV_HCC_MAX_AZIMUTH_DEG;   // atoi (argv[3]);
        fovCfg.minElevationDeg    =  (float)AOAFOV_HCC_MIN_ELEVATION_DEG; // atoi (argv[4]);
        fovCfg.maxElevationDeg    =  (float)AOAFOV_HCC_MAX_ELEVATION_DEG; // atoi (argv[5]);
    
        /* Save Configuration to use later */
        MmwDemo_CfgUpdate((void *)&fovCfg, MMWDEMO_FOVAOA_OFFSET,
                          sizeof(fovCfg), subFrameNum);
        return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for extended maximum velocity configuration
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLIExtendedMaxVelocity ()
    {
        DPU_AoAProc_ExtendedMaxVelocityCfg   cfg;
        int8_t              subFrameNum=EXTENDMAXVELOCITY_HCC_SUBFRAME_IDX;
    
        /* Initialize configuration: */
        memset ((void *)&cfg, 0, sizeof(cfg));
    
        /* Populate configuration: */
        cfg.enabled      = (uint8_t)EXTENDMAXVELOCITY_HCC_ENABLED;// atoi (argv[2]);
    
        /* Save Configuration to use later */
        MmwDemo_CfgUpdate((void *)&cfg, MMWDEMO_EXTMAXVEL_OFFSET,
                          sizeof(cfg), subFrameNum);
        return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for multi object beam forming configuration
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLIMultiObjBeamForming ()
    {
        DPU_AoAProc_MultiObjBeamFormingCfg cfg;
        int8_t              subFrameNum=MULTI_OBJ_BEAM_HCC_0_SUBFRAME_IDX;
    
        /* Initialize configuration: */
        memset ((void *)&cfg, 0, sizeof(cfg));
    
        /* Populate configuration: */
        cfg.enabled                     = (uint8_t)MULTI_OBJ_BEAM_HCC_0_ENABLED;     // atoi (argv[2]);
        cfg.multiPeakThrsScal           = (float)MULTI_OBJ_BEAM_HCC_0_THRESHOLD;   // atof (argv[3]);
    
        /* Save Configuration to use later */
        MmwDemo_CfgUpdate((void *)&cfg, MMWDEMO_MULTIOBJBEAMFORMING_OFFSET,
                          sizeof(cfg), subFrameNum);
    
        return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for DC range calibration
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLICalibDcRangeSig ()
    {
        DPU_RangeProc_CalibDcRangeSigCfg cfg;
        uint32_t                   log2NumAvgChirps;
        int8_t                     subFrameNum=CALIB_DC_RANGE_HCC_0_SUBFRAME_IDX;
    
    
        /* Initialize configuration for DC range signature calibration */
        memset ((void *)&cfg, 0, sizeof(cfg));
    
        /* Populate configuration: */
        cfg.enabled          = (uint16_t)CALIB_DC_RANGE_HCC_0_ENABLED;        // atoi (argv[2]);
        cfg.negativeBinIdx   = (int16_t)CALIB_DC_RANGE_HCC_0_NEG_BIN_IDX;    //  atoi (argv[3]);
        cfg.positiveBinIdx   = (int16_t)CALIB_DC_RANGE_HCC_0_POS_BIN_IDX;    //  atoi (argv[4]);
        cfg.numAvgChirps     = (uint16_t)CALIB_DC_RANGE_HCC_0_NUM_AVG;      //   atoi (argv[5]);
    
        if (cfg.negativeBinIdx > 0)
        {
            CLI_write ("Error: Invalid negative bin index\n");
            return -1;
        }
        if ((cfg.positiveBinIdx - cfg.negativeBinIdx + 1) > DPU_RANGEPROC_SIGNATURE_COMP_MAX_BIN_SIZE)
        {
            CLI_write ("Error: Number of bins exceeds the limit\n");
            return -1;
        }
        log2NumAvgChirps = (uint32_t) mathUtils_ceilLog2(cfg.numAvgChirps);
        if (cfg.numAvgChirps != (1U << log2NumAvgChirps))
        {
            CLI_write ("Error: Number of averaged chirps is not power of two\n");
            return -1;
        }
    
        /* Save Configuration to use later */
        MmwDemo_CfgUpdate((void *)&cfg, MMWDEMO_CALIBDCRANGESIG_OFFSET,
                          sizeof(cfg), subFrameNum);
    
        return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      Clutter removal Configuration
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLIClutterRemoval ()
    {
        DPC_ObjectDetection_StaticClutterRemovalCfg_Base cfg;
        int8_t              subFrameNum=CLUTTER_HCC_SUBFRAME_IDX;
    
    
        /* Initialize configuration for clutter removal */
        memset ((void *)&cfg, 0, sizeof(cfg));
    
        /* Populate configuration: */
        cfg.enabled          = CLUTTER_HCC_ENABLED; //(uint16_t) atoi (argv[2]);
    
        /* Save Configuration to use later */
        MmwDemo_CfgUpdate((void *)&cfg, MMWDEMO_STATICCLUTTERREMOFVAL_OFFSET,
                          sizeof(cfg), subFrameNum);
    
        return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for data logger set command
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLIADCBufCfg ()
    {
        MmwDemo_ADCBufCfg   adcBufCfg;
        int8_t              subFrameNum=ADCBUF_HCC_SUBFRAME_IDX;
    
        if (gMmwMCB.sensorState == MmwDemo_SensorState_STARTED)
        {
            CLI_write ("Ignored: This command is not allowed after sensor has started\n");
            return 0;
        }
    
        /* Initialize the ADC Output configuration: */
        memset ((void *)&adcBufCfg, 0, sizeof(adcBufCfg));
    
        /* Populate configuration: */
        adcBufCfg.adcFmt          = ADCBUF_HCC_OUTPUT_FMT;//(uint8_t) atoi (argv[2]);
        adcBufCfg.iqSwapSel       = ADCBUF_HCC_SAMPLE_SWAP;//(uint8_t) atoi (argv[3]);
        adcBufCfg.chInterleave    = ADCBUF_HCC_CHAN_INTERLEAVE;//(uint8_t) atoi (argv[4]);
        adcBufCfg.chirpThreshold  = ADCBUF_HCC_CHIRP_THRESHOLD;//(uint8_t) atoi (argv[5]);
    
        /* This demo is using HWA for 1D processing which does not allow multi-chirp
         * processing */
        if (adcBufCfg.chirpThreshold != 1)
        {
            CLI_write("Error: chirpThreshold must be 1, multi-chirp is not allowed\n");
            return -1;
        }
        /* Save Configuration to use later */
        MmwDemo_CfgUpdate((void *)&adcBufCfg,
                          MMWDEMO_ADCBUFCFG_OFFSET,
                          sizeof(MmwDemo_ADCBufCfg), subFrameNum);
        return 0;
    }
    
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for compensation of range bias and channel phase offsets
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLICompRangeBiasAndRxChanPhaseCfg ()
    {
        DPU_AoAProc_compRxChannelBiasCfg   cfg;
         int32_t Re, Im;
         int32_t argInd;
         int32_t i;
    
         char *compRange[] = {"compRangeBiasAndRxChanPhase", "0.0", "-1", "0", "1", "0", "-1", "0", "1", "0", "-1", "0", "1", "0", "-1", "0", "1", "0", "-1", "0", "1", "0", "-1", "0", "1", "0"};
    
         /* Initialize configuration: */
         memset ((void *)&cfg, 0, sizeof(cfg));
    
         /* Populate configuration: */
         cfg.rangeBias          = COMPRANGEBIASANDRXCHANPHASE;
    
         argInd = 2;
         for (i=0; i < SYS_COMMON_NUM_TX_ANTENNAS*SYS_COMMON_NUM_RX_CHANNEL; i++)
         {
             Re = (int32_t) (atof (compRange[argInd++]) * 32768.);
             MATHUTILS_SATURATE16(Re);
             cfg.rxChPhaseComp[i].real = (int16_t) Re;
    
             Im = (int32_t) (atof (compRange[argInd++]) * 32768.);
             MATHUTILS_SATURATE16(Im);
             cfg.rxChPhaseComp[i].imag = (int16_t) Im;
    
         }
         /* Save Configuration to use later */
         memcpy((void *) &gMmwMCB.dataPathObj.objDetCommonCfg.preStartCommonCfg.compRxChanCfg, &cfg, sizeof(cfg));
    
         gMmwMCB.dataPathObj.objDetCommonCfg.isCompRxChannelBiasCfgPending = 1;
    
         return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for measurement configuration of range bias
     *      and channel phase offsets
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLIMeasureRangeBiasAndRxChanPhaseCfg ()
    {
        DPC_ObjectDetection_MeasureRxChannelBiasCfg   cfg;
    
        /* Initialize configuration: */
        memset ((void *)&cfg, 0, sizeof(cfg));
    
        /* Populate configuration: */
        cfg.enabled          = (uint8_t) MEASURERANGEBIAS_HCC_ENABLED;//atoi (argv[1]);
        cfg.targetDistance   = (float)MEASURERANGEBIAS_HCC_TARGET_DIST;// atof (argv[2]);
        cfg.searchWinSize    = (float)MEASURERANGEBIAS_HCC_SEARCH_WIN;// atof (argv[3]);
    
        /* Save Configuration to use later */
        memcpy((void *) &gMmwMCB.dataPathObj.objDetCommonCfg.preStartCommonCfg.measureRxChannelBiasCfg,
               &cfg, sizeof(cfg));
    
        gMmwMCB.dataPathObj.objDetCommonCfg.isMeasureRxChannelBiasCfgPending = 1;
        return 0;
    }
    /**
     *  @b Description
     *  @n
     *      This is the HCC Handler for BPM configuration supported by the mmw Demo
     *      Note that there is a generic BPM configuration command supported by
     *      utils/cli and mmwave. The generic BPM command is not supported by the
     *      demo as the mmw demo assumes a specific BPM pattern for the TX antennas.
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    //static int32_t MmwDemo_CLIBpmCfg(void)
    //{
    //
    //    MmwDemo_BpmCfg      bpmCfg;
    //
    //    /* Initialize configuration for DC range signature calibration */
    //    memset ((void *)&bpmCfg, 0, sizeof(MmwDemo_BpmCfg));
    //
    //    /* Populate configuration: */
    //    gMmwMCB.ctrlHandle->bpmCfg.isEnabled = BPM_HCC_ENABLED;
    //    bpmCfg.chirp0Idx = BPM_HCC_CHIRP_0_IDX;
    //    bpmCfg.chirp1Idx = BPM_HCC_CHIRP_1_IDX;
    //
    //    /* Save Configuration to use later */
    //    MmwDemo_CfgUpdate((void *)&bpmCfg, MMWDEMO_BPMCFG_OFFSET, sizeof(MmwDemo_BpmCfg), BPM_HCC_SUBFRAME_IDX);
    //
    //    return 0;
    //}
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for configuring CQ RX Saturation monitor
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLIChirpQualityRxSatMonCfg ()
    {
        rlRxSatMonConf_t        cqSatMonCfg;
        if (gMmwMCB.sensorState == MmwDemo_SensorState_STARTED)
        {
            CLI_write ("Ignored: This command is not allowed after sensor has started\n");
            return 0;
        }
    
        /* Initialize configuration: */
        memset ((void *)&cqSatMonCfg, 0, sizeof(rlRxSatMonConf_t));
    
        /* Populate configuration: */
        cqSatMonCfg.profileIndx                 = (uint8_t)CQRXSAT_HCC_0_PROFILE_ID;// atoi (argv[1]);
    
        if(cqSatMonCfg.profileIndx < RL_MAX_PROFILES_CNT)
        {
    
            cqSatMonCfg.satMonSel                   = CQRXSAT_HCC_0_SAT_MON_SEL;//(uint8_t) atoi (argv[2]);
            cqSatMonCfg.primarySliceDuration        = CQRXSAT_HCC_0_PRI_SLICE_DURATION;//(uint16_t) atoi (argv[3]);
            cqSatMonCfg.numSlices                   = CQRXSAT_HCC_0_NUM_SLICES;//(uint16_t) atoi (argv[4]);
            cqSatMonCfg.rxChannelMask               = CQRXSAT_HCC_0_RX_CHAN_MASK;//(uint8_t) atoi (argv[5]);
    
            /* Save Configuration to use later */
            gMmwMCB.cqSatMonCfg[cqSatMonCfg.profileIndx] = cqSatMonCfg;
    
            return 0;
        }
        else
        {
            return -1;
        }
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for configuring CQ Singal & Image band monitor
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLIChirpQualitySigImgMonCfg ()
    {
        rlSigImgMonConf_t       cqSigImgMonCfg;
    
        if (gMmwMCB.sensorState == MmwDemo_SensorState_STARTED)
        {
            CLI_write ("Ignored: This command is not allowed after sensor has started\n");
            return 0;
        }
    
        /* Initialize configuration: */
        memset ((void *)&cqSigImgMonCfg, 0, sizeof(rlSigImgMonConf_t));
    
        /* Populate configuration: */
        cqSigImgMonCfg.profileIndx              = (uint8_t)CQSIGIMG_HCC_0_PROFILE_ID;// atoi (argv[1]);
    
        if(cqSigImgMonCfg.profileIndx < RL_MAX_PROFILES_CNT)
        {
            cqSigImgMonCfg.numSlices            = (uint8_t)CQSIGIMG_HCC_0_NUM_SLICES;// atoi (argv[2]);
            cqSigImgMonCfg.timeSliceNumSamples  = (uint16_t)CQSIGIMG_HCC_0_NUM_SAMPLE_PER_SLICE;// atoi (argv[3]);
    
            /* Save Configuration to use later */
            gMmwMCB.cqSigImgMonCfg[cqSigImgMonCfg.profileIndx] = cqSigImgMonCfg;
    
            return 0;
        }
        else
        {
            return -1;
        }
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for enabling analog monitors
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLIAnalogMonitorCfg ()
    {
        if (gMmwMCB.sensorState == MmwDemo_SensorState_STARTED)
        {
            CLI_write ("Ignored: This command is not allowed after sensor has started\n");
            return 0;
        }
    
        /* Save Configuration to use later */
        gMmwMCB.anaMonCfg.rxSatMonEn = ANALOGMONITOR_HCC_RX_SATURATION;//atoi (argv[1]);
        gMmwMCB.anaMonCfg.sigImgMonEn = ANALOGMONITOR_HCC_SIG_IMG_BAND;//atoi (argv[2]);
    
        if ((gMmwMCB.anaMonCfg.rxSatMonEn == 1) ||
            (gMmwMCB.anaMonCfg.sigImgMonEn == 1))
        {
            CLI_write("Error: Analog Monitoring is not supported on this device\n");
            return -1;
        }
        gMmwMCB.isAnaMonCfgPending = 1;
    
        return 0;
    }
    
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Handler for the High Speed Interface
     *
     *  @param[in] argc
     *      Number of arguments
     *  @param[in] argv
     *      Arguments
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    static int32_t MmwDemo_CLILvdsStreamCfg ()
    {
        MmwDemo_LvdsStreamCfg   cfg;
    
        int8_t                  subFrameNum=LVDSSTREAM_HCC_SUBFRAME_IDX;
        if (gMmwMCB.sensorState == MmwDemo_SensorState_STARTED)
        {
            CLI_write ("Ignored: This command is not allowed after sensor has started\n");
            return 0;
        }
    
        /* Initialize configuration for DC range signature calibration */
        memset ((void *)&cfg, 0, sizeof(MmwDemo_LvdsStreamCfg));
    
        /* Populate configuration: */
        cfg.isHeaderEnabled = LVDSSTREAM_HCC_ENABLE_HEADER;  //(bool)    atoi(argv[2]);
        cfg.dataFmt         = LVDSSTREAM_HCC_DATA_FMT;      //(uint8_t) atoi(argv[3]);
        cfg.isSwEnabled     = LVDSSTREAM_HCC_ENABLE_SW;     //(bool)    atoi(argv[4]);
    
        if (cfg.dataFmt == MMW_DEMO_LVDS_STREAM_CFG_DATAFMT_CP_ADC_CQ)
        {
            CLI_write("Error: CP_ADC_CQ data format not supported\n");
            return -1;
        }
    
        /* If both h/w and s/w are enabled, HSI header must be enabled, because
         * we don't allow mixed h/w session without HSI header
         * simultaneously with s/w session with HSI header (s/w session always
         * streams HSI header) */
        if ((cfg.isSwEnabled == true) && (cfg.dataFmt != MMW_DEMO_LVDS_STREAM_CFG_DATAFMT_DISABLED))
        {
            if (cfg.isHeaderEnabled == false)
            {
                CLI_write("Error: header must be enabled when both h/w and s/w streaming are enabled\n");
                return -1;
            }
        }
    
        /* Save Configuration to use later */
        MmwDemo_CfgUpdate((void *)&cfg,
                          MMWDEMO_LVDSSTREAMCFG_OFFSET,
                          sizeof(MmwDemo_LvdsStreamCfg), subFrameNum);
    
        return 0;
    }
    //-----------------------------------------------------------------------------------
    /**
     *  @b Description
     *  @n
     *      Sensor Configuration Task which initializes the
     *      hard-coded chirp configurations for the sensor.
     *
     *  @retval
     *      Not Applicable.
     */
    void mmwDemo_sensorConfig_task()
    {
        int32_t             errCode;
        uint8_t             index, numAdvSubframes;
    
        memset ((void *)&errCode, 0, sizeof(int32_t));
        memset ((void *)&index, 0, sizeof(uint8_t));
        memset ((void *)&numAdvSubframes, 0, sizeof(uint8_t));
    
        /* Get RF frequency scale factor */
        double              gHCC_mmwave_freq_scale_factor;
        memset ((void *)&gHCC_mmwave_freq_scale_factor, 0, sizeof(double));
        gHCC_mmwave_freq_scale_factor = SOC_getDeviceRFFreqScaleFactor(gMmwMCB.socHandle, &errCode);
    
        /*****************************************************************************
         * Configuration :: Open Sensor
         *****************************************************************************/
    
        /* Initialize the channel configuration */
     //   MmwDemo_MCB_t openCfg;
        gMmwMCB.cfg.openCfg.chCfg.rxChannelEn             = CHANNEL_HCC_RX_CHANNEL_EN;
        gMmwMCB.cfg.openCfg.chCfg.txChannelEn             = CHANNEL_HCC_TX_CHANNEL_EN;
        gMmwMCB.cfg.openCfg.chCfg.cascading               = CHANNEL_HCC_CASCADING;
    
        /* Initialize the low power mode configuration */
        gMmwMCB.cfg.openCfg.lowPowerMode.lpAdcMode        = LP_HCC_LOW_POWER_MODE;
    
        /* Initialize the ADCOut configuration */
        gMmwMCB.cfg.openCfg.adcOutCfg.fmt.b2AdcBits       = ADC_HCC_NUM_ADC_BITS;
        gMmwMCB.cfg.openCfg.adcOutCfg.fmt.b2AdcOutFmt     = ADC_HCC_OUTPUT_FMT;
    
        /* Call MMW Demo helper function to open sensor */
        if (MmwDemo_openSensor(true) < 0)
            printf("MmDemo_openSensor command returned an error.\n");
        else
            printf("Sensor was successfully opened.\n");
    
        /*****************************************************************************
         * Configuration :: Initializing and Adding Profiles
         *****************************************************************************/
    
        /* Initialize the profile configurations */
        rlProfileCfg_t      profileCfg;
    
           memset ((void *)&profileCfg, 0, sizeof(rlProfileCfg_t));
    
        /* Populate the profiles from hard-coded config */
        profileCfg.profileId                = PROFILE_HCC_0_PROFILE_ID;
        profileCfg.startFreqConst           = (uint32_t)((float)PROFILE_HCC_0_START_FREQ_GHZ * (1U << 26) / gHCC_mmwave_freq_scale_factor);
        profileCfg.idleTimeConst            = (uint32_t)((float)PROFILE_HCC_0_IDLE_TIME_VAL * 1000 / 10);
        profileCfg.adcStartTimeConst        = (uint32_t)((float)PROFILE_HCC_0_ADC_START_TIME_VAL * 1000 / 10);
        profileCfg.rampEndTime              = (uint32_t)((float)PROFILE_HCC_0_RAMP_END_TIME_VAL * 1000 / 10);
        profileCfg.txOutPowerBackoffCode    = PROFILE_HCC_0_TXOUT_POWER_BACKOFF;
        profileCfg.txPhaseShifter           = PROFILE_HCC_0_TXPHASESHIFTER_VAL;
        profileCfg.freqSlopeConst           = (int16_t)((float)PROFILE_HCC_0_FREQ_SLOPE_MHZ_PER_US * (1U << 26) / ((gHCC_mmwave_freq_scale_factor * 1e3) * 900.0));
        profileCfg.txStartTime              = (int32_t)((float)PROFILE_HCC_0_TX_START_TIME_VAL * 1000 / 10);
        profileCfg.numAdcSamples            = PROFILE_HCC_0_ADC_SAMPLE_VAL;
        profileCfg.digOutSampleRate         = PROFILE_HCC_0_DIGOUT_SAMPLERATE_VAL;
        profileCfg.hpfCornerFreq1           = PROFILE_HCC_0_HPFCORNER_FREQ1_VAL;
        profileCfg.hpfCornerFreq2           = PROFILE_HCC_0_HPFCORNER_FREQ2_VAL;
        profileCfg.rxGain                   = PROFILE_HCC_0_RX_GAIN_VAL;
    
        /* Initialize the profile handles */
        MMWave_ProfileHandle    profileHandle;
    
           memset ((void *)&profileHandle, 0, sizeof(MMWave_ProfileHandle));
    
        /* Adding Profiles to Control Handle */
    
            profileHandle = MMWave_addProfile(gMmwMCB.ctrlHandle, &profileCfg, &errCode);
    
        /*****************************************************************************
         * Configuration :: Initializing and Adding Chirps
         *****************************************************************************/
    
        /* Initialize the chirp configurations */
        rlChirpCfg_t    chirpCfg;
    //    for (index = 0; index < numChirps; index++)
            memset ((void *)&chirpCfg, 0, sizeof(rlChirpCfg_t));
    
        /* Populate the chirps from hard-coded configs */
        chirpCfg.chirpStartIdx           = CHIRP_HCC_0_START_INDEX;
        chirpCfg.chirpEndIdx             = CHIRP_HCC_0_END_INDEX;
        chirpCfg.profileId               = CHIRP_HCC_0_PROFILE_ID;
        chirpCfg.startFreqVar            = (uint32_t)((float)CHIRP_HCC_0_START_FREQ_VAL * (1U << 26) / (gHCC_mmwave_freq_scale_factor * 1e9));
        chirpCfg.freqSlopeVar            = (uint16_t)((float)CHIRP_HCC_0_FREQ_SLOPE_VAL * (1U << 26) / ((gHCC_mmwave_freq_scale_factor * 1e6) * 900.0));
        chirpCfg.idleTimeVar             = (uint32_t)((float)CHIRP_HCC_0_IDLE_TIME_VAL * 1000.0 / 10.0);
        chirpCfg.adcStartTimeVar         = (uint32_t)((float)CHIRP_HCC_0_ADC_START_TIME_VAL * 1000.0 / 10.0);
        chirpCfg.txEnable                = CHIRP_HCC_0_TX_CHANNEL;
    
        chirpCfg.chirpStartIdx           = CHIRP_HCC_1_START_INDEX;
        chirpCfg.chirpEndIdx             = CHIRP_HCC_1_END_INDEX;
        chirpCfg.profileId               = CHIRP_HCC_1_PROFILE_ID;
        chirpCfg.startFreqVar            = (uint32_t)((float)CHIRP_HCC_1_START_FREQ_VAL * (1U << 26) / (gHCC_mmwave_freq_scale_factor * 1e9));
        chirpCfg.freqSlopeVar            = (uint16_t)((float)CHIRP_HCC_1_FREQ_SLOPE_VAL * (1U << 26) / ((gHCC_mmwave_freq_scale_factor * 1e6) * 900.0));
        chirpCfg.idleTimeVar             = (uint32_t)((float)CHIRP_HCC_1_IDLE_TIME_VAL * 1000.0 / 10.0);
        chirpCfg.adcStartTimeVar         = (uint32_t)((float)CHIRP_HCC_1_ADC_START_TIME_VAL * 1000.0 / 10.0);
        chirpCfg.txEnable                = CHIRP_HCC_1_TX_CHANNEL;
    
    
        /* Initialize the chirp handles */
        MMWave_ChirpHandle      chirpHandle;
    //    for (index = 0; index < numChirps; index++)
            memset ((void *)&chirpHandle, 0, sizeof(MMWave_ChirpHandle));
    
        /* Adding Chirps to profile handles */
    //    for (index = 0; index < numChirps; index++){
            chirpHandle = MMWave_addChirp(profileHandle, &chirpCfg, &errCode);
    //    }
    
        /*****************************************************************************
         * Configuration :: Initializing Output Mode and Frame Configurations
         *****************************************************************************/
    
        /* Determine Output Mode */
        switch(DFE_DATA_OUTPUT_MODE_HCC)
        {
        case 1U:
            printf("Data Output Mode: Frame\n");
            gMmwMCB.cfg.ctrlCfg.dfeDataOutputMode                    = MMWave_DFEDataOutputMode_FRAME;
    
            /* Populate the frame config */
            gMmwMCB.cfg.ctrlCfg.u.frameCfg.frameCfg.chirpStartIdx            = FRAME_HCC_CHIRP_START_INDEX;
            gMmwMCB.cfg.ctrlCfg.u.frameCfg.frameCfg.chirpEndIdx              = FRAME_HCC_CHIRP_END_INDEX;
            gMmwMCB.cfg.ctrlCfg.u.frameCfg.frameCfg.numLoops                 = FRAME_HCC_NUM_LOOPS;
            gMmwMCB.cfg.ctrlCfg.u.frameCfg.frameCfg.numFrames                = FRAME_HCC_NUM_FRAMES;
            gMmwMCB.cfg.ctrlCfg.u.frameCfg.frameCfg.framePeriodicity         = (uint32_t)((float)FRAME_HCC_FRAME_PERIODICITY * 1000000 / 5);
            gMmwMCB.cfg.ctrlCfg.u.frameCfg.frameCfg.triggerSelect            = FRAME_HCC_TRIGGER_SELECT;
            gMmwMCB.cfg.ctrlCfg.u.frameCfg.frameCfg.frameTriggerDelay        = (uint32_t)((float)FRAME_HCC_FRAME_TRIG_DELAY * 1000000 / 5);
    
            memcpy((void *)&gMmwMCB.cfg.ctrlCfg.u.frameCfg.profileHandle, (void *)&profileHandle, sizeof(profileHandle));
            break;
    
        case 2U:
            printf("Data Output Mode: Continuous\n");
            printf("Continuous Mode is not supported with OOB demos. Please choose either Frame Mode or Advanced Frame Mode.\n");
            gMmwMCB.cfg.ctrlCfg.dfeDataOutputMode = MMWave_DFEDataOutputMode_CONTINUOUS;
    
            break;
    
        case 3U:
            printf("Data Output Mode: Advanced Frame\n");
            gMmwMCB.cfg.ctrlCfg.dfeDataOutputMode = MMWave_DFEDataOutputMode_ADVANCED_FRAME;
    
            break;
    
        default:
            printf("DFE = Default!\n");
            printf("Error: Invalid Mode.\n");
            break;
        }
    
        /*****************************************************************************
         * Configuration :: Initializing Data Path Configurations hard coded
         *****************************************************************************/
        /* Call HCC helper functions to configure data path */
    
        MmwDemo_CLIGuiMonSel();
        MmwDemo_CLICfarCfg();
        MmwDemo_CLICfarFovCfg();
        MmwDemo_CLIAoAFovCfg();
        MmwDemo_CLIExtendedMaxVelocity();
        MmwDemo_CLIMultiObjBeamForming();
        MmwDemo_CLICalibDcRangeSig();
        MmwDemo_CLIClutterRemoval();
        MmwDemo_CLIADCBufCfg();
        MmwDemo_CLICompRangeBiasAndRxChanPhaseCfg();
        MmwDemo_CLIMeasureRangeBiasAndRxChanPhaseCfg();
    //    MmwDemo_CLIBpmCfg();
        MmwDemo_CLIChirpQualityRxSatMonCfg();
        MmwDemo_CLIChirpQualitySigImgMonCfg();
        MmwDemo_CLIAnalogMonitorCfg();
        MmwDemo_CLILvdsStreamCfg();
    
        /* Configure Pre-Start Common Config */
    //    gMmwMCB.objDetCommonCfg.preStartCommonCfg.numSubFrames = MmwDemo_RFParser_getNumSubFrames(&gMmwMCB.cfg.ctrlCfg);
        gMmwMCB.dataPathObj.objDetCommonCfg.preStartCommonCfg.numSubFrames = MmwDemo_RFParser_getNumSubFrames(&gMmwMCB.cfg.ctrlCfg);
        /*****************************************************************************
         * Deployment :: Configuring and Starting Sensor
         *****************************************************************************/
        /* Call MMW Demo helper function to configure sensor */
        printf("Sending configSensor command to EVM.\n");
        if (MmwDemo_configSensor() < 0)
            printf("MmwDemo_configSensor command returned an error.\n");
        else
            printf("Sensor was successfully configured.\n");
    
        /* Call MMW Demo helper function to start sensor */
        if (MmwDemo_startSensor() < 0)
            printf("MmDemo_startSensor command returned an error.\n");
        else
            printf("Hard Coded Configuration successfully sent to EVM.\n");
    
        return;
    }
    //-----------------------------------------------------------------------------------
    /**
     *  @b Description
     *  @n
     *      This is the CLI Execution Task
     *
     *  @retval
     *      Not Applicable.
     */
    void MmwDemo_CLIInit (uint8_t taskPriority)
    {
    //    CLI_Cfg     cliCfg;
    //    char        demoBanner[256];
    //    uint32_t    cnt;
    //    char        demoPlatform[16];
    
        /* Create Demo Banner to be printed out by CLI */
    //    sprintf(&demoBanner[0],
    //                       "******************************************\n" \
    //                       "xWR64xx MMW Demo %02d.%02d.%02d.%02d\n"  \
    //                       "******************************************\n",
    //                        MMWAVE_SDK_VERSION_MAJOR,
    //                        MMWAVE_SDK_VERSION_MINOR,
    //                        MMWAVE_SDK_VERSION_BUGFIX,
    //                        MMWAVE_SDK_VERSION_BUILD
    //            );
    
        /* Create Demo Platform string. This is needed so that this demo
        corectly reports the 64xx platform.*/
    //#if defined(USE_2D_AOA_DPU)
    //    sprintf(&demoPlatform[0], "xWR68xx_AOP");
    //#else
    //    sprintf(&demoPlatform[0], "xWR64xx");
    //#endif
    
        /* Initialize the CLI configuration: */
    //    memset ((void *)&cliCfg, 0, sizeof(CLI_Cfg));
    
    //    /* Populate the CLI configuration: */
    //    cliCfg.cliPrompt                    = "mmwDemo:/>";
    //    cliCfg.cliBanner                    = demoBanner;
    //    cliCfg.cliUartHandle                = gMmwMCB.commandUartHandle;
    //    cliCfg.taskPriority                 = taskPriority;
    //    cliCfg.socHandle                    = gMmwMCB.socHandle;
    //    cliCfg.mmWaveHandle                 = gMmwMCB.ctrlHandle;
    //    cliCfg.enableMMWaveExtension        = 1U;
    //    cliCfg.usePolledMode                = true;
    //    cliCfg.overridePlatform             = true;
    //    cliCfg.overridePlatformString       = demoPlatform;
    //
    //    cnt=0;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "sensorStop";
    //    cliCfg.tableEntry[cnt].helpString     = "No arguments";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLISensorStop;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "guiMonitor";
    //    cliCfg.tableEntry[cnt].helpString     = "<subFrameIdx> <detectedObjects> <logMagRange> <noiseProfile> <rangeAzimuthHeatMap> <rangeDopplerHeatMap> <statsInfo>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLIGuiMonSel;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "cfarCfg";
    //    cliCfg.tableEntry[cnt].helpString     = "<subFrameIdx> <procDirection> <averageMode> <winLen> <guardLen> <noiseDiv> <cyclicMode> <thresholdScale> <peakGroupingEn>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLICfarCfg;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "multiObjBeamForming";
    //    cliCfg.tableEntry[cnt].helpString     = "<subFrameIdx> <enabled> <threshold>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLIMultiObjBeamForming;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "calibDcRangeSig";
    //    cliCfg.tableEntry[cnt].helpString     = "<subFrameIdx> <enabled> <negativeBinIdx> <positiveBinIdx> <numAvgFrames>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLICalibDcRangeSig;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "clutterRemoval";
    //    cliCfg.tableEntry[cnt].helpString     = "<subFrameIdx> <enabled>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLIClutterRemoval;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "adcbufCfg";
    //    cliCfg.tableEntry[cnt].helpString     = "<subFrameIdx> <adcOutputFmt> <SampleSwap> <ChanInterleave> <ChirpThreshold>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLIADCBufCfg;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "compRangeBiasAndRxChanPhase";
    //    cliCfg.tableEntry[cnt].helpString     = "<rangeBias> <Re00> <Im00> <Re01> <Im01> <Re02> <Im02> <Re03> <Im03> <Re10> <Im10> <Re11> <Im11> <Re12> <Im12> <Re13> <Im13> ";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLICompRangeBiasAndRxChanPhaseCfg;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "measureRangeBiasAndRxChanPhase";
    //    cliCfg.tableEntry[cnt].helpString     = "<enabled> <targetDistance> <searchWin>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLIMeasureRangeBiasAndRxChanPhaseCfg;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "aoaFovCfg";
    //    cliCfg.tableEntry[cnt].helpString     = "<subFrameIdx> <minAzimuthDeg> <maxAzimuthDeg> <minElevationDeg> <maxElevationDeg>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLIAoAFovCfg;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "cfarFovCfg";
    //    cliCfg.tableEntry[cnt].helpString     = "<subFrameIdx> <procDirection> <min (meters or m/s)> <max (meters or m/s)>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLICfarFovCfg;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "extendedMaxVelocity";
    //    cliCfg.tableEntry[cnt].helpString     = "<subFrameIdx> <enabled>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLIExtendedMaxVelocity;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "CQRxSatMonitor";
    //    cliCfg.tableEntry[cnt].helpString     = "<profile> <satMonSel> <priSliceDuration> <numSlices> <rxChanMask>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLIChirpQualityRxSatMonCfg;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "CQSigImgMonitor";
    //    cliCfg.tableEntry[cnt].helpString     = "<profile> <numSlices> <numSamplePerSlice>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLIChirpQualitySigImgMonCfg;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "analogMonitor";
    //    cliCfg.tableEntry[cnt].helpString     = "<rxSaturation> <sigImgBand>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLIAnalogMonitorCfg;
    //    cnt++;
    //
    //    cliCfg.tableEntry[cnt].cmd            = "lvdsStreamCfg";
    //    cliCfg.tableEntry[cnt].helpString     = "<subFrameIdx> <enableHeader> <dataFmt> <enableSW>";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLILvdsStreamCfg;
    //    cnt++;
    
    //    cliCfg.tableEntry[cnt].cmd            = "sensorStart";
    //    cliCfg.tableEntry[cnt].helpString     = "[doReconfig(optional, default:enabled)]";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = mmwDemo_sensorConfig_task;
    //    cnt++;
    //    cliCfg.tableEntry[cnt].cmd            = "sensorStart";
    //    cliCfg.tableEntry[cnt].helpString     = "[doReconfig(optional, default:enabled)]";
    //    cliCfg.tableEntry[cnt].cmdHandlerFxn  = MmwDemo_CLISensorStart;
    //    cnt++;
    //    /* Open the CLI: */
    //    if (CLI_open (&cliCfg) < 0)
    //    {
    //        System_printf ("Error: Unable to open the CLI\n");
    //        return;
    //    }
    //    System_printf ("Debug: CLI is operational\n");
    //    return;
    
    
    //    MmwDemo_CLISensorStop();
        /***** This below function will configure mmWave sensor with full configuration */
          mmwDemo_sensorConfig_task();
    
    //      MmwDemo_openSensor(1);
    //    MmwDemo_CLISensorStart();
    //      MmwDemo_CLISensorStart();
    
    }
    
    
    
    profile.h1373.main.c

  • Former Member
    0 Former Member in reply to Roshan Tej Thota

    Hello,

    Please follow my suggestion instead in the previously linked thead.

    1. Take the project that works using cfg file for CLI commands and with LVDS

    2. Make the changes to hard code the CLI commands in the cfg file using the steps in this thread:  This requires adding the  common/cli_mmwave.c and common/cli.c as shown in the gesture demo and modifying the clic. file with the contents of the cfg file.

    Amanda

  • finally i added all the hardcoded parameters in "ods_point_cloud_68xx_hwa_es1" but one small issue is there sensor start with only demo visualizer only all other parameters are hardcoded (not depends on demo visualizer ) but only start command need to send with demo visualizer please guide me how i can run my project without demo visualizer .

    power on it should start sensor and get output ,please help us to get LVDS data on power on 

    where is issue is it depend on TI-RTOS ????

    /*****************************************************************************
    * Initialize the CLI Module:
    * User can choose to create their own task here with the same priority
    * instead that does hard coded config instead of interactive CLI
    *****************************************************************************/
    MmwDemo_CLIInit(MMWDEMO_CLI_TASK_PRIORITY);

    This above function i want to start with power on only where i need to modify???

  • Hello

    Please let us know if this is still open and if you need help.

    Would be helpful to know what which of the two are you trying to accomplish.

    1. Getting RAW data out on LVDS via OOB demo

    2. Hard coding the config so that demo can start without user intervention.

    THank you,

    Vaibhav