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/IWR1443: There are some question in the function of MmwDemo_CLISensorStart().why?

Part Number: IWR1443
Other Parts Discussed in Thread: IWR1642

Tool/software: Code Composer Studio

There are some question in the function of MmwDemo_CLISensorStart().why?

this is my using of the function of MmwDemo_CLISensorStart() follow:

const char * command[] = {
                          "% ***************************************************************\r\n",
                          "% Created for SDK ver:01.01\r\n",
                          "% Created using Visualizer ver:2.0.0.0\r\n",
                          "% Frequency:77\r\n",
                          "% Platform:xWR14xx\r\n",
                          "% Scene Classifier:best_range_res\r\n",
                          "% Azimuth Resolution(deg):15\r\n",
                          "% Range Resolution(m):0.044\r\n",
                          "% Maximum unambiguous Range(m):9.01\r\n",
                          "% Maximum Radial Velocity(m/s):1\r\n",
                          "% Radial velocity resolution(m/s):0.13\r\n",
                          "% Frame Duration(msec):1000\r\n",
                          "% Range Detection Threshold (dB):15\r\n",
                          "% Range Peak Grouping:enabled\r\n",
                          "% Doppler Peak Grouping:enabled\r\n",
                          "% Static clutter removal:disabled\r\n",
                          "% ***************************************************************\r\n",
//                          "sensorStop\r\n",
                          "flushCfg\r\n",
                          "dfeDataOutputMode 1\r\n",
                          "channelCfg 15 5 0\r\n",
                          "adcCfg 2 1\r\n",
                          "adcbufCfg 0 1 0 1\r\n",
                          "profileCfg 0 77 429 7 57.14 0 0 70 1 240 4884 0 0 30\r\n",
                          "chirpCfg 0 0 0 0 0 0 0 1\r\n",
                          "chirpCfg 1 1 0 0 0 0 0 4\r\n",
                          "frameCfg 0 1 16 0 1000 1 0\r\n",
                          "lowPower 0 0\r\n",
                          "guiMonitor 1 1 0 0 0 1\r\n",
                          "cfarCfg 0 2 8 4 3 0 1280\r\n",
                          "peakGrouping 1 1 1 1 229\r\n",
                          "multiObjBeamForming 1 0.5\r\n",
                          "clutterRemoval 0\r\n",
                          "calibDcRangeSig 0 -5 8 256\r\n",
                          "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\r\n",
                          "measureRangeBiasAndRxChanPhase 0 1.5 0.2\r\n",
//                          "sensorStart\r\n"
};

    if (inside_init (&cliCfg) < 0)
    {
        //System_printf ("Error: Unable to open the CLI\n");
        MmwDemo_debugAssert (0);
        return;
    }

static int32_t inside_init(CLI_Cfg* ptrCLICfg)
{
        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:/>";

        /* Initialize the task parameters and launch the CLI Task: */
        inside_task();
        return 0;

}


static void inside_task()
{
    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;

    uint32_t                command_index=0;

    /* Do we have a banner to be displayed? */
    if (gCLI.cfg.cliBanner != NULL)
    {
        /* YES: Display the banner */
        CLI_write (gCLI.cfg.cliBanner);
    }

    /* Loop around forever: */
    while (1)
    {
        /* Demo Prompt: */
        CLI_write (gCLI.cfg.cliPrompt);

        /* Reset the command string: */
        memset ((void *)&cmdString[0], 0, sizeof(cmdString));

        /* Read the command message from the UART: */

        if(command_index>=sizeof(command)/sizeof(command[0]))
        {
            return;
        }
        else
        {
            memcpy(&cmdString[0], command[command_index],(sizeof(cmdString) - 1));
            command_index++;
        }

        /* 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]);
            }
        }
    }
}

.

.

.

.

that function is no problem in IWR1642. but is some problem in IWR1443.

and I check it ,I find which there are some bug in the function of MmwDemo_CLISensorStart();

when I call it ,the System is disorders and it fly into outer space. why? is IWR1443 some problem ?.who can you tell me why?.cry,cry ,cry .thank you.

  • const char * command[] = {
    "% ***************************************************************\r\n",
    "% Created for SDK ver:01.01\r\n",
    "% Created using Visualizer ver:2.0.0.0\r\n",
    "% Frequency:77\r\n",
    "% Platform:xWR14xx\r\n",
    "% Scene Classifier:best_range_res\r\n",
    "% Azimuth Resolution(deg):15\r\n",
    "% Range Resolution(m):0.044\r\n",
    "% Maximum unambiguous Range(m):9.01\r\n",
    "% Maximum Radial Velocity(m/s):1\r\n",
    "% Radial velocity resolution(m/s):0.13\r\n",
    "% Frame Duration(msec):1000\r\n",
    "% Range Detection Threshold (dB):15\r\n",
    "% Range Peak Grouping:enabled\r\n",
    "% Doppler Peak Grouping:enabled\r\n",
    "% Static clutter removal:disabled\r\n",
    "% ***************************************************************\r\n",
    // "sensorStop\r\n",
    "flushCfg\r\n",
    "dfeDataOutputMode 1\r\n",
    "channelCfg 15 5 0\r\n",
    "adcCfg 2 1\r\n",
    "adcbufCfg 0 1 0 1\r\n",
    "profileCfg 0 77 429 7 57.14 0 0 70 1 240 4884 0 0 30\r\n",
    "chirpCfg 0 0 0 0 0 0 0 1\r\n",
    "chirpCfg 1 1 0 0 0 0 0 4\r\n",
    "frameCfg 0 1 16 0 1000 1 0\r\n",
    "lowPower 0 0\r\n",
    "guiMonitor 1 1 0 0 0 1\r\n",
    "cfarCfg 0 2 8 4 3 0 1280\r\n",
    "peakGrouping 1 1 1 1 229\r\n",
    "multiObjBeamForming 1 0.5\r\n",
    "clutterRemoval 0\r\n",
    "calibDcRangeSig 0 -5 8 256\r\n",
    "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\r\n",
    "measureRangeBiasAndRxChanPhase 0 1.5 0.2\r\n",
    // "sensorStart\r\n"
    };

    if (inside_init (&cliCfg) < 0)
    {
    //System_printf ("Error: Unable to open the CLI\n");
    MmwDemo_debugAssert (0);
    return;
    }

    static int32_t inside_init(CLI_Cfg* ptrCLICfg)
    {
    inside_task();
    return 0;
    }

    static void inside_task()
    {
     
    }

  • Hello,

    From your code, I understand that you are trying to hard-code the configuration to avoid sending through Visualizer, correct? Please look at the following threads which discuss this topic:

    1. IWR1642BOOST: Loading config file through program on linux
    2. Starterware/AWR1642: Starting up the device without sending config from the visualizer
    3. IWR1443BOOST: send config to IWR1443 without using visualizer (Here, a user has provided modified cli.c file for the IWR1443 SDK Demo to achieve this)

    As mentioned in the first thread referred above, you need to consider things such as waiting for response, initial invalid characters, inter character/inter line delays etc when sending the commands over UART from a program.

    Regards

    -Nitin

  • I see it ,but that modified file is IWR1642 which is not IWR1443. and now I modified IWR1642 is successed ,but not IWR1443,cry,cry,cry,...
    I debug my function in IWR1443,I found that there are some problem in IWR1443 when I call MmwDemo_CLISensorStart(). thank you!
  • Can you provide more details about the problem you see in CLISensorStart()?
  • Ok, it is my debug following, I add only MmwDemo_CLISensorStop() and MmwDemo_CLISensorStart() in mmw_cli.c of IWR1443,
    but I get only " before MmwDemo_CLISensorStop\r\n" from serial. I think the function of MmwDemo_CLISensorStop() is some question.
    here is code

    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

    /* Open the CLI: */
    if (CLI_open (&cliCfg) < 0)
    {
    //System_printf ("Error: Unable to open the CLI\n");
    MmwDemo_debugAssert (0);
    return;
    }
    return;
  • Hello,

    It seems that you're discussing the same question in the following thread as well. As mentioned in the following thread, please ensure that you are using the latest SDK? 

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

    Thanks

    -Nitin

     

  • Hi,

    Closing this thread as the above questions has been resolved in the following thread:

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

    Please open a new ticket if you have further questions.

    Thanks

    -Nitin