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/IWR1642: IWR1642 Use a Standalone

Part Number: IWR1642

Tool/software: Code Composer Studio

Hello TI,

1.i want to use my device standalone without GUI(Work with only Power supply)

2.No need to Configure device Every Power ON 

I try to Follow some forums for reference but it's not working  

guide me how to do hard coded config or please share me same reference to resolve this issues

thank you TI for your Support  

Thanks,

Rahul

  • Hi Rahul,

    Please follow the example provided in the following post which discusses this topic in great detail and provides the necessary source code and instructions to achieve this in the mmWave SDK Demo.

    CCS/IWR1443: there are some question in MmwDemo_CLISensorStop(1,initcfg_stop).why?

    Once you've familiarized yourself with the modifications, look at the following thread as well to avoid any errors in making the code changes:

    CCS/IWR1642BOOST: unable to run modified source code in debug mode

    Regards

    -Nitin

  • Hello Nitin,

    thank you Nitin your valuable guidelines 

    Can you explain it how to do this, i am little confuse

    I use Shot Range Radar demo code for standalone  application development  

    1.I need to modify this e2e.ti.com/.../4745.cli.c file or use it as it is (Currently i am using as it is)

    2.Rename/backup existing cli.c source file in mmwave_sdk_01_02_00_05\packages\ti\utils\cli\src directory (there are 2 file's cli.c and cli_mmwave.c)

    3.Place new cli.c

    /*
     *   @file  cli.c
     *
     *   @brief
     *      CLI Utility implementation
     *
     *  \par
     *  NOTE:
     *      (C) Copyright 2016 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/std.h>
    #include <ti/sysbios/knl/Task.h>
    
    /* mmWave SDK Include Files: */
    #include <ti/common/sys_common.h>
    #include <ti/drivers/uart/UART.h>
    #include <ti/utils/cli/cli.h>
    #include <ti/utils/cli/include/cli_internal.h>
    
    /**************************************************************************
     *************************** Hard-coded Configuation **********************
     **************************************************************************/
    #define USE_HARD_CODED_CONFIG
    
    #ifdef USE_HARD_CODED_CONFIG
    
    int32_t hardCodedConfigIndex;
    
    char * hardCodedConfigCommands[] =
    {
    "% ***************************************************************"
    "% Created for SDK ver:02.00",
    "% Created using Visualizer ver:2.0.0.2",
    "% Frequency:77",
    "% Platform:xWR16xx",
    "% Scene Classifier:best_range_res",
    "% Azimuth Resolution(deg):15",
    "% Range Resolution(m):0.044",
    "% Maximum unambiguous Range(m):9.02",
    "% Maximum Radial Velocity(m/s):1",
    "% Radial velocity resolution(m/s):0.13",
    "% Frame Duration(msec):100",
    "% Range Detection Threshold (dB):15",
    "% Doppler Detection Threshold (dB):15",
    "% Range Peak Grouping:enabled",
    "% Doppler Peak Grouping:enabled",
    "% Static clutter removal:disabled",
    "% ***************************************************************",
    "sensorStop",
    "flushCfg",
    "dfeDataOutputMode 1",
    "channelCfg 15 3 0",
    "adcCfg 2 1",
    "adcbufCfg -1 0 0 1 0",
    "profileCfg 0 77 429 7 57.14 0 0 70 1 256 5209 0 0 30",
    "chirpCfg 0 0 0 0 0 0 0 1",
    "chirpCfg 1 1 0 0 0 0 0 2",
    "frameCfg 0 1 16 0 100 1 0",
    "lowPower 0 1",
    "guiMonitor -1 1 0 0 0 0 0",
    "cfarCfg -1 0 0 8 4 4 0 5120",
    "cfarCfg -1 1 0 4 2 3 0 5120",
    "peakGrouping -1 1 1 1 1 255",
    "multiObjBeamForming -1 1 0.5",
    "clutterRemoval -1 0",
    "calibDcRangeSig -1 0 -5 8 256",
    "extendedMaxVelocity -1 0",
    "bpmCfg -1 0 0 1",
    "lvdsStreamCfg -1 0 0 0",
    "nearFieldCfg -1 0 0 0",
    "compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0",
    "measureRangeBiasAndRxChanPhase 0 1.5 0.2",
    "CQRxSatMonitor 0 3 5 123 0",
    "CQSigImgMonitor 0 127 4",
    "analogMonitor 1 1",
    "sensorStart",
     "!!!END_OF_HARD_CODED_COMMANDS"
    };
    
    #endif
    
    /**************************************************************************
     *************************** Global Variables *****************************
     **************************************************************************/
    
    /**
     * @brief   Global variable which tracks the CLI MCB
     */
    CLI_MCB     gCLI;
    
    /**************************************************************************
     **************************** CLI Functions *******************************
     **************************************************************************/
    
    /**
     *  @b Description
     *  @n
     *      The function is the HELP generated by the CLI Module
     *
     *  \ingroup CLI_UTIL_INTERNAL_FUNCTION
     *
     *  @retval
     *      Not Applicable.
     */
    static int32_t CLI_help (int32_t argc, char* argv[])
    {
        uint32_t    index;
    
        /* Display the banner: */
        CLI_write ("Help: This will display the usage of the CLI commands\n");
        CLI_write ("Command: Help Description\n");
    
        /* Cycle through all the registered CLI commands: */
        for (index = 0; index < gCLI.numCLICommands; index++)
        {
            /* Display the help string*/
            CLI_write ("%s: %s\n",
                        gCLI.cfg.tableEntry[index].cmd,
                       (gCLI.cfg.tableEntry[index].helpString == NULL) ?
                        "No help available" :
                        gCLI.cfg.tableEntry[index].helpString);
        }
    
        /* Is the mmWave Extension enabled? */
        if (gCLI.cfg.enableMMWaveExtension == 1U)
        {
            /* YES: Pass the control to the extension help handler. */
            CLI_MMWaveExtensionHelp ();
        }
        return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the CLI Execution Task
     *
     *  \ingroup CLI_UTIL_INTERNAL_FUNCTION
     *
     *  @retval
     *      Not Applicable.
     */
    static void CLI_task(UArg arg0, UArg arg1)
    {
        uint8_t                 cmdString[256];
        char*                   tokenizedArgs[CLI_MAX_ARGS];
        char*                   ptrCLICommand;
        char                    delimitter[] = " \r\n";
        uint32_t                argIndex;
        CLI_CmdTableEntry*      ptrCLICommandEntry;
        int32_t                 cliStatus;
        uint32_t                index;
    
        /* Do we have a banner to be displayed? */
        if (gCLI.cfg.cliBanner != NULL)
        {
            /* YES: Display the banner */
            CLI_write (gCLI.cfg.cliBanner);
        }
    
    #ifdef USE_HARD_CODED_CONFIG
        hardCodedConfigIndex = 0;
        CLI_write ("Wait some time for system to initialize...\n");
        Task_sleep(100);
        CLI_write ("Performing hard-coded config\n");
    #endif
    
        /* Loop around forever: */
        while (1)
        {
            /* Demo Prompt: */
            CLI_write (gCLI.cfg.cliPrompt);
    
            /* Reset the command string: */
            memset ((void *)&cmdString[0], 0, sizeof(cmdString));
    
    #ifdef USE_HARD_CODED_CONFIG
            /* Run hard-coded commands, one at a time until '!!!END_OF_HARD_CODED_COMMANDS' is reached: */
            if (hardCodedConfigCommands[hardCodedConfigIndex][0] != '!')
            {
                //CLI_write (hardCodedConfigCommands[hardCodedConfigIndex]);
                CLI_write ("Command\n");
                memcpy((void *)&cmdString[0], (void *)hardCodedConfigCommands[hardCodedConfigIndex], strlen(hardCodedConfigCommands[hardCodedConfigIndex]));
                hardCodedConfigIndex++;
            }
            /* Accept commands from UART after all hard-coded commands done: */
            else
            {
                /* Read the command message from the UART: */
                UART_read (gCLI.cfg.cliUartHandle, &cmdString[0], (sizeof(cmdString) - 1));
            }
    
    #else
            /* Read the command message from the UART: */
            UART_read (gCLI.cfg.cliUartHandle, &cmdString[0], (sizeof(cmdString) - 1));
    #endif
    
            /* Reset all the tokenized arguments: */
            memset ((void *)&tokenizedArgs, 0, sizeof(tokenizedArgs));
            argIndex      = 0;
            ptrCLICommand = (char*)&cmdString[0];
    
            /* comment lines found - ignore the whole line*/
            if (cmdString[0]=='%') {
                CLI_write ("Skipped\n");
                continue;
            }
    
            /* Set the CLI status: */
            cliStatus = -1;
    
            /* The command has been entered we now tokenize the command message */
            while (1)
            {
                /* Tokenize the arguments: */
                tokenizedArgs[argIndex] = strtok(ptrCLICommand, delimitter);
                if (tokenizedArgs[argIndex] == NULL)
                    break;
    
                /* Increment the argument index: */
                argIndex++;
                if (argIndex >= CLI_MAX_ARGS)
                    break;
    
                /* Reset the command string */
                ptrCLICommand = NULL;
            }
    
            /* Were we able to tokenize the CLI command? */
            if (argIndex == 0)
                continue;
    
            /* Cycle through all the registered CLI commands: */
            for (index = 0; index < gCLI.numCLICommands; index++)
            {
                ptrCLICommandEntry = &gCLI.cfg.tableEntry[index];
    
                /* Do we have a match? */
                if (strcmp(ptrCLICommandEntry->cmd, tokenizedArgs[0]) == 0)
                {
                    /* YES: Pass this to the CLI registered function */
                    cliStatus = ptrCLICommandEntry->cmdHandlerFxn (argIndex, tokenizedArgs);
                    if (cliStatus == 0)
                    {
                        CLI_write ("Done\n");
                    }
                    else
                    {
                        CLI_write ("Error %d\n", cliStatus);
                    }
                    break;
                }
            }
    
            /* Did we get a matching CLI command? */
            if (index == gCLI.numCLICommands)
            {
                /* NO matching command found. Is the mmWave extension enabled? */
                if (gCLI.cfg.enableMMWaveExtension == 1U)
                {
                    /* Yes: Pass this to the mmWave extension handler */
                    cliStatus = CLI_MMWaveExtensionHandler (argIndex, tokenizedArgs);
                }
    
                /* Was the CLI command found? */
                if (cliStatus == -1)
                {
                    /* No: The command was still not found */
                    CLI_write ("'%s' is not recognized as a CLI command\n", tokenizedArgs[0]);
                }
            }
        }
    }
    
    /**
     *  @b Description
     *  @n
     *      Logging function which can log the messages to the CLI console
     *
     *  @param[in]  format
     *      Format string
     *
     *  \ingroup CLI_UTIL_EXTERNAL_FUNCTION
     *
     *  @retval
     *      Not Applicable.
     */
    void CLI_write (const char* format, ...)
    {
        va_list     arg;
        char        logMessage[256];
        int32_t     sizeMessage;
    
        /* Format the message: */
        va_start (arg, format);
        sizeMessage = vsnprintf (&logMessage[0], sizeof(logMessage), format, arg);
        va_end (arg);
    
        /* Log the message on the UART CLI console: */
        if (gCLI.cfg.usePolledMode == true)
        {
            /* Polled mode: */
            UART_writePolling (gCLI.cfg.cliUartHandle, (uint8_t*)&logMessage[0], sizeMessage);
        }
        else
        {
            /* Blocking Mode: */
            UART_write (gCLI.cfg.cliUartHandle, (uint8_t*)&logMessage[0], sizeMessage);
        }
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the function which is used to initialize and setup the CLI
     *
     *  @param[in]  ptrCLICfg
     *      Pointer to the CLI configuration
     *
     *  \ingroup CLI_UTIL_EXTERNAL_FUNCTION
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    int32_t CLI_open (CLI_Cfg* ptrCLICfg)
    {
        Task_Params     taskParams;
        uint32_t        index;
    
        /* Sanity Check: Validate the arguments */
        if (ptrCLICfg == NULL)
            return -1;
    
        /* Initialize the CLI MCB: */
        memset ((void*)&gCLI, 0, sizeof(CLI_MCB));
    
        /* Copy over the configuration: */
        memcpy ((void *)&gCLI.cfg, (void *)ptrCLICfg, sizeof(CLI_Cfg));
    
        /* Cycle through and determine the number of supported CLI commands: */
        for (index = 0; index < CLI_MAX_CMD; index++)
        {
            /* Do we have a valid entry? */
            if (gCLI.cfg.tableEntry[index].cmd == NULL)
            {
                /* NO: This is the last entry */
                break;
            }
            else
            {
                /* YES: Increment the number of CLI commands */
                gCLI.numCLICommands = gCLI.numCLICommands + 1;
            }
        }
    
        /* Is the mmWave Extension enabled? */
        if (gCLI.cfg.enableMMWaveExtension == 1U)
        {
            /* YES: Initialize the CLI Extension: */
            if (CLI_MMWaveExtensionInit (ptrCLICfg) < 0)
                return -1;
        }
    
        /* Do we have a CLI Prompt specified?  */
        if (gCLI.cfg.cliPrompt == NULL)
            gCLI.cfg.cliPrompt = "CLI:/>";
    
        /* The CLI provides a help command by default:
         * - Since we are adding this at the end of the table; a user of this module can also
         *   override this to provide its own implementation. */
        gCLI.cfg.tableEntry[gCLI.numCLICommands].cmd           = "help";
        gCLI.cfg.tableEntry[gCLI.numCLICommands].helpString    = NULL;
        gCLI.cfg.tableEntry[gCLI.numCLICommands].cmdHandlerFxn = CLI_help;
    
        /* Increment the number of CLI commands: */
        gCLI.numCLICommands++;
    
        /* Initialize the task parameters and launch the CLI Task: */
        Task_Params_init(&taskParams);
        taskParams.priority  = gCLI.cfg.taskPriority;
        taskParams.stackSize = 4*1024;
        gCLI.cliTaskHandle = Task_create(CLI_task, &taskParams, NULL);
        return 0;
    }
    
    /**
     *  @b Description
     *  @n
     *      This is the function which is used to close the CLI module
     *
     *  \ingroup CLI_UTIL_EXTERNAL_FUNCTION
     *
     *  @retval
     *      Success -   0
     *  @retval
     *      Error   -   <0
     */
    int32_t CLI_close (void)
    {
        /* Shutdown the CLI Task */
        Task_delete(&gCLI.cliTaskHandle);
    
        /* Cleanup the memory */
        memset ((void*)&gCLI, 0, sizeof(CLI_MCB));
        return 0;
    }
    
    
    file in directory (only change cli.c file from this directory and not doing any thing with cli_mmwave.c)

    4.need to change any thing in mss_main.c or  mss_srr_cli.c...?

    5. In mss_srr_cli.c, i comment static int32_t SRR_MSS_CLISensorStart (int32_t argc, char* argv[])  and static int32_t SRR_MSS_CLISensorStart (int32_t argc, char* argv[])  function

    6.I am inserting this in mss_srr_cli.c file

    char* initcfg_start[1] = {"sensorStart"};
    char* initcfg_stop[1] = {"sensorStop"};

    CLI_write(" before MmwDemo_CLISensorStop\r\n");
    MmwDemo_CLISensorStop(1,initcfg_stop);
    CLI_write(" after MmwDemo_CLISensorStop\r\n");

    for (cnt = 1; cnt <= 5000000; cnt++); //this delay ensures the sensor stops

    CLI_write(" before MmwDemo_CLISensorStart\r\n");
    MmwDemo_CLISensorStart(1,initcfg_start);
    CLI_write(" after MmwDemo_CLISensorStart\r\n");

    for (cnt = 1; cnt <= 5000000; cnt++); //this delay ensures the sensor starts

    it's not working ....?

    Please guide to resolve this issue 

     Regard's ,

    Rahul

  • Rahul,

    The configuration hardcoding example I provided above is designed for the SDK Out of box demo. It will not work with the SRR demo.

    Thanks
    -Nitin
  • Hello Nitin,


    What is SDK Out Of Box, I am not aware about it ...?
    if you have any Documents How to use this SDK Out of Box, share me

    i need to use this hardcoding configuration with my modified PplCount Demo code, can you provide related Guidelines which help me to resolve this issue

    Thank's And Regard,
    Rahul
  • Rahul,

    Look under the SDK user guide (C:\ti\mmwave_sdk_02_00_00_04\docs\mmwave_sdk_user_guide.pdf), the OOB demo is mentioned in Section 1: Out-of-box mmWave Experience and detailed in Section 3: Getting Started.

    Additionally, the CCS project for the OOB demo, along-with a detailed user guide is available on TI Resource Explorer: 16xx - mmWave SDK Demo:

    Additionally, you have created another thread below for the same question so we will close this thread and continue supporting you there.

    https://e2e.ti.com/support/sensors/f/1023/t/741521

    -Nitin

  • Hello Nitin ,

    I don't want to use this OOB, i need to make changes in PPL_count demo code which we modify as per our requirement
    My end application is this(sense the Motion(People) and trigger GPIO2 ) there for i need to modify that One, can you help to do this (But need to run this demo code standalone without GUI, no need to Configure every power on)
    i am Using ES.2 EVM (IWR1642) and SDK2.0


    Thanks,
    Rahul
  • Rahul,

    As responded in the other thread as well, the example provided above is for the mmWave SDK Out of box demo. Since you've created another thread for the people counting demo, we will close this one and support you on that one as mentioned below.

    This question has been duplicated in the following threads:

    1. CCS/IWR1642BOOST: IWR1642 Self Configuration Setup
    2. CCS/IWR1642: Hard-code configuration commands in the mmwave demo code without using demo visualizer for IWR1642
    3. CCS/IWR1642BOOST: IWR1642 CLI (command line interface) UART handle issue
    4. CCS/IWR1642BOOST: IWR1642 Hard Code Config Compiler error
    5. CCS/IWR1642BOOST: IWR1642 Self Start Working (standalone)

    We will close this thread and continue supporting the question in the last thread in the list i.e.

    Thanks

    -Nitin