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.

RTOS/AWR1642: About the error of MmwDemo_mssDataPathConfig.

Part Number: AWR1642

Tool/software: TI-RTOS

I refer the below
e2e.ti.com/.../669254
e2e.ti.com/.../653296

If I send the cmd(StartCommandLine), it will hardcode the configuration(pre-set).

It's success for the first time.

But it will fail for second time.

I see the error is from MmwDemo_mssDataPathConfig.

--CLI_getMMWaveExtensionOpenConfig (&gMmwMssMCB.cfg.openCfg);
--CLI_getMMWaveExtensionOpenConfig (&openCfg);

When they'are different, it will be error.

If I want to use my CLI.

How can I to avoid the error?


Regards,

Jui Yang

  • Hi,

    If I understand correctly you are trying to define a new CLI command?

    Is this correct?

    I would recommend you take a look at the driver vital signs lab provided in the Resource Explorer. It includes some CLI commands which were added to the original mmWave SDK Demo (version 1.1)

    dev.ti.com/.../

    Thank you
    Cesar
  • Hello,

    Yes,I define a new CLI command.
    The new CLI command can load the radar configuration which I set in hardware.
    It's OK in the first time. AWR1642 will use the command.
    But it's fail in the second time.
    Compare openCfg will fail in mms_main.c(line:1297;sdk:1.1.0.2)
    Configure the mmWave module will also fail in mss_main.c(line:1311)
    Below,it's my new CLi command.
    -----------------------------------------------------------------------------------------------------
    #define MAX_RADAR_CMD 22
    uint8_t* radarCmdString[MAX_RADAR_CMD] =
    {
    {"sensorStop \n\r"},
    {"flushCfg \n\r"},
    {"dfeDataOutputMode 1 \n\r"},
    {"channelCfg 15 3 0 \n\r"},
    {"adcCfg 2 1 \n\r"},
    {"adcbufCfg -1 0 0 1 0 \n\r"},
    {"profileCfg 0 77 287 7 200 0 0 20 1 384 2000 0 0 30 \n\r"},
    {"chirpCfg 0 0 0 0 0 0 0 1 \n\r"},
    {"chirpCfg 1 1 0 0 0 0 0 2 \n\r"},
    {"frameCfg 0 1 16 0 150 1 0 \n\r"},
    {"lowPower 0 0 \n\r"},
    {"guiMonitor -1 1 1 1 0 0 1 \n\r"},
    {"cfarCfg -1 0 0 8 4 4 0 5120 \n\r"},
    {"cfarCfg -1 1 0 4 2 3 0 5120 \n\r"},
    {"peakGrouping -1 1 1 1 1 511 \n\r"},
    {"multiObjBeamForming -1 0 0.5 \n\r"},
    {"clutterRemoval -1 0 \n\r"},
    {"calibDcRangeSig -1 0 -5 8 256 \n\r"},
    {"extendedMaxVelocity -1 0 \n\r"},
    {"compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 \n\r"},
    {"measureRangeBiasAndRxChanPhase 0 1.5 0.2 \n\r"},
    {"sensorStart \n\r"},
    };
    static int32_t MmwDemo_CLIByPassApi (int32_t argc, char* argv[])
    {
    /* Sanity Check: Minimum argument check */
    if (argc != 2)
    {
    CLI_write ("Error: Invalid usage of the CLI command\n");
    return -1;
    }
    /* Initialize configuration: */
    CLI_Cfg* ptrCLICfg;
    ptrCLICfg = &cliCfg;

    char* tokenizedArgs[CLI_MAX_ARGS];
    char* ptrCLICommand;
    char delimitter[] = " \r\n";
    uint32_t argIndex;
    CLI_CmdTableEntry* ptrCLICommandEntry;
    int32_t cliStatus;
    uint32_t index, idx;
    uint16_t numCLICommands = 0U;

    /* Sanity Check: Validate the arguments */
    if (ptrCLICfg == NULL)
    return -1;
    /* 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 (ptrCLICfg->tableEntry[index].cmd == NULL)
    {
    /* NO: This is the last entry */
    break;
    }
    else
    {
    /* YES: Increment the number of CLI commands */
    numCLICommands = numCLICommands + 1;
    }
    }
    /* Demo Prompt: */
    CLI_write (ptrCLICfg->cliPrompt);
    /* Execute All Radar Commands */
    for (idx = 0; idx < MAX_RADAR_CMD; idx++)
    {
    /* Reset all the tokenized arguments: */
    memset ((void *)&tokenizedArgs, 0, sizeof(tokenizedArgs));
    argIndex = 0;
    ptrCLICommand = (char*)radarCmdString[idx];
    /* 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 < numCLICommands; index++)
    {
    ptrCLICommandEntry = &ptrCLICfg->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 == numCLICommands)
    {
    /* NO matching command found. Is the mmWave extension enabled? */
    if (ptrCLICfg->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]);
    }
    }
    }
    System_printf ("Debug: ByPassApi successful\n");
    return 0;
    }
    ---------------------------------------------------------------------------------------------------------------
    Regards,

    Jui Yang
  • You don't mention how it fails. If it fails because of a memory allocation error or MMWave error, then you haven't completely undone what the first configuration performed.  If it fails because of a bad configuration, then you should compare the contents of gMmwMssMCB after the first and second tries.