IWR1443BOOST 中的命令参数可不可以直接写在工程里

  • 你好,
    可以的,
    请参考e2e.ti.com/.../653296
    谢谢。
  • 非常感谢您的回复,看完您推荐的参考,我遇到了下面这些问题,希望能够继续得到您的解答

  • 你好,
    因为给出的链接是1642的参考。1443可能需要做一些对应的改动
    clistatus指的是当前这个cli命令配置的成功与否。上一行即是。
    拓展的cli命令。不需要实现的。找到1443对应的部分即可。
    替换掉当前的cli_Init即可。
    谢谢
  • 你好,对于你这次的回复的后半部分我不是很理解,不需要实现的话CLI_MMWaveExtensionHandler (argIndex, tokenizedArgs);这个函数在工程中会有个警告,替换掉当前的cli_init这句话我该如何理解呢?

  • 你好,

    请参考

    Bypass CLI 的修改
    • 1443基于SDK1.2
    • 在demo MSS部分 cli.c 处理CLI命令文件中
    • 添加头文件#include <ti/utils/cli/include/cli_internal.h>
    • 添加外部结构体定义extern CLI_MCB gCLI;
    • 在main.c中,增加外部函数定义
    extern void MmwDemo_Bypass_CLI (void);
    • Main.c中void MmwDemo_initTask(UArg arg0, UArg arg1),返回参数return前,调用函数
    MmwDemo_Bypass_CLI();
    • 添加mmwave_cli.c执行函数及参数定义
    #define CLI_BYPASS 1
    #define MAX_RADAR_CMD 24
    uint8_t* radarCmdString[MAX_RADAR_CMD] =
    {
    {"sensorStop \r\n"},
    {"flushCfg \r\n"},
    {"dfeDataOutputMode 1 \r\n"},
    {"channelCfg 15 7 0 \r\n"},
    {"adcCfg 2 1 \r\n"},
    {"adcbufCfg 0 1 0 1 \r\n"},
    {"profileCfg 0 77 7 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"},
    {"chirpCfg 2 2 0 0 0 0 0 2 \r\n"},
    {"frameCfg 0 2 16 0 33.333 1 0 \r\n"},
    {"lowPower 0 0 \r\n"},
    {"guiMonitor 1 0 0 0 0 0 \r\n"},
    {"cfarCfg 0 2 8 4 3 0 768 \r\n"},
    {"peakGrouping 1 0 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"},
    {"CQRxSatMonitor 0 3 5 123 0 \r\n"},
    {"CQSigImgMonitor 0 119 4 \r\n"},
    {"analogMonitor 1 1 \r\n"},
    {"sensorStart \r\n"},
    };

    static int32_t CLI_ByPassApi(CLI_Cfg* ptrCLICfg)
    {
    //uint8_t cmdString[128];
    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;
    }
    }

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

    return 0;
    }
    void MmwDemo_Bypass_CLI (void)
    {
    if (CLI_ByPassApi(&gCLI.cfg) != 0)
    {
    System_printf ("Error: Unable to CLI_ByPassApi\n");
    return;
    }
    return;

    }
  • 你好,

    回复得非常详细,非常感谢!

  • 你好,

    按照您的方式将命令写入工程后,进入debug模式,直接跳到了死循环,这是为什么呢?

  • 你好,

    可能性很多。

    调用位置不对

    配置有问题

    ccs_debug.bin烧写不正确

    调用函数传入的结构体有问题。

    将代码放置于工程文件夹中的mmw_cli.c

    请核对。谢谢。

  • 你好,

    我进行了如下核对:

    首先是cli文件中的配置,如下图:

    然后,烧写的文件如下图:

    调用在void MmwDemo_initTask(UArg arg0, UArg arg1)函数中,如下图:

    确认以上问题后,最后进入调试还是显示下图这样,没有从main函数开始

    不知道还有什么原因,真诚感谢您的回复。

  • 你好,
    使用CCS进行debug的话,建议烧写CCS_DEBUG.bin文件。
    步骤参考dev.ti.com/.../
    Users guide 4.3节后的内容。

    如有问题,建议修改配置,配置请参考SDK demo的默认配置。使用Visualizer设置。

    谢谢