Part Number:AWR2944EVMOther Parts Discussed in Thread:AWR2944
我是想自定义CLI 的 命令,所以尝试修改了channelCfg命令。
在ccs 工程中,MmwDemo_CLIInit 中 如下代码所示,比如channelCfg中没有,那不是在执行AWR2944_CLI_ByPassApi(&cliCfg);这个函数的时候,如果截图1所示 执行到channelCfg的时候,是不是就会去执行cli_mmwave.c文件中的CLI_MMWaveChannelCfg这个函数,如图2所示。
有几个问题想咨询一下:
1.比如我把channelCfg 换成testCfg ,在cli_mmwave.c文件中也将channelCfg 换成testCfg,对应的函数也进行函数名的修改,发现程序执行后发现channnelCfg中的TX enable 和 RXenable 都没有使能;程序报错,显示chirp config error;是不是channelCfg是CLI 的内部函数不能进行修改;
2.如果可以修改的话,除了cli_mmwave.c文件需要修改,哪些文件还需要修改;

图1

图2
void MmwDemo_CLIInit (uint8_t taskPriority)
{CLI_CfgcliCfg;chardemoBanner[256];uint32_tcnt;/* Create Demo Banner to be printed out by CLI */
//sprintf(&demoBanner[0],
//"******************************************\n" \
//"AWR294X MMW Demo %02d.%02d.%02d.%02d\n" \
//"******************************************\n",
//MMWAVE_SDK_VERSION_MAJOR,
//MMWAVE_SDK_VERSION_MINOR,
//MMWAVE_SDK_VERSION_BUGFIX,
//MMWAVE_SDK_VERSION_BUILD
//);/* Initialize the CLI configuration: */memset ((void *)&cliCfg, 0, sizeof(CLI_Cfg));/* Populate the CLI configuration: */cliCfg.cliPrompt= "mmwDemo:/>";cliCfg.cliBanner= demoBanner;cliCfg.cliUartHandle= gMmwMssMCB.commandUartHandle;cliCfg.taskPriority= taskPriority;cliCfg.mmWaveHandle= gMmwMssMCB.ctrlHandle;cliCfg.enableMMWaveExtension= 1U;cliCfg.usePolledMode= true;cliCfg.overridePlatform= false;cliCfg.overridePlatformString= "AWR294X";
#ifdef MMWDEMO_DDMcliCfg.procChain= 1;
#elsecliCfg.procChain= 0;
#endifcnt=0;cliCfg.tableEntry[cnt].cmd= "sensorStart";cliCfg.tableEntry[cnt].helpString= "[doReconfig(optional, default:enabled)]";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLISensorStart;cnt++;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= "aoaFovCfg";cliCfg.tableEntry[cnt].helpString= "<subFrameIdx> <minAzimuthDeg> <maxAzimuthDeg> <minElevationDeg> <maxElevationDeg>";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLIAoAFovCfg;cnt++;
#ifdef MMWDEMO_TDMcliCfg.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++;
#endifcliCfg.tableEntry[cnt].cmd= "adcbufCfg";cliCfg.tableEntry[cnt].helpString= "<subFrameIdx> <adcOutputFmt> <SampleSwap> <ChanInterleave> <ChirpThreshold>";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLIADCBufCfg;cnt++;
#ifdef MMWDEMO_TDMcliCfg.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= "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++;
#endifcliCfg.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= "configDataPort";cliCfg.tableEntry[cnt].helpString= "<baudrate> <ackPing>";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLIConfigDataPort;cnt++;cliCfg.tableEntry[cnt].cmd= "queryDemoStatus";cliCfg.tableEntry[cnt].helpString= "";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLIQueryDemoStatus;cnt++;
#ifdef ENET_STREAMcliCfg.tableEntry[cnt].cmd= "queryLocalIp";cliCfg.tableEntry[cnt].helpString= "";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLIQueryLocalIp;cnt++;
#endifcliCfg.tableEntry[cnt].cmd= "calibData";cliCfg.tableEntry[cnt].helpString= "<save enable> <restore enable> <Flash offset>";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLICalibDataSaveRestore;cnt++;
#ifdef ENET_STREAMcliCfg.tableEntry[cnt].cmd= "enetStreamCfg";cliCfg.tableEntry[cnt].helpString= "<isEnabled> <remoteIpD> <remoteIpC> <remoteIpB> <remoteIpA>"; /* Ip: D.C.B.A */cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLIEnetCfg;cnt++;
#endif
#ifdef MMWDEMO_DDMcliCfg.tableEntry[cnt].cmd= "compressionCfg";cliCfg.tableEntry[cnt].helpString= "<subFrameIdx> <compressionRatio> <rangeBinsPerBlock> <compressionMethod>";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLICompressionCfg;cnt++;cliCfg.tableEntry[cnt].cmd= "localMaxCfg";cliCfg.tableEntry[cnt].helpString= "<subFrameIdx> <azimThreshdB> <dopplerThreshdB>";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLILocalMaxCfg;cnt++;cliCfg.tableEntry[cnt].cmd= "intfMitigCfg";cliCfg.tableEntry[cnt].helpString= "<subFrameIdx> <magSNRdB> <magDiffSNRdB>";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLIIntfMitigCfg;cnt++;cliCfg.tableEntry[cnt].cmd= "antennaCalibParams";cliCfg.tableEntry[cnt].helpString= "<I0> <Q0> .... <I11> <Q11>";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLIAntennaCalibParams;cnt++;
#endifcliCfg.tableEntry[cnt].cmd= "procChain";cliCfg.tableEntry[cnt].helpString= "";cliCfg.tableEntry[cnt].cmdHandlerFxn = MmwDemo_CLIProcChain;cnt++;/* Open the CLI: */if (CLI_open (&cliCfg) < 0){test_print ("Error: Unable to open the CLI\n");return;}test_print ("Debug: CLI is operational\n");
#ifdef CLI_BYPASSAWR2944_CLI_ByPassApi(&cliCfg);test_print ("Debug: CLI is config\n");
#endifreturn;
}
static int32_t AWR2944_CLI_ByPassApi(CLI_Cfg* ptrCLICfg)
{//uint8_tcmdString[128];char*tokenizedArgs[CLI_MAX_ARGS];char*ptrCLICommand;chardelimitter[] = " \r\n";uint32_targIndex;CLI_CmdTableEntry*ptrCLICommandEntry;int32_tcliStatus;uint32_tindex, idx;uint16_t numCLICommands = 0U;uint16_t countTemp = 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++){
//DebugP_log (" index = %d \n", index);
//DebugP_log ("cmd = %s \n", ptrCLICfg->tableEntry[index].cmd);
//DebugP_log ("helpString = %s \n", ptrCLICfg->tableEntry[index].helpString);/* Do we have a valid entry? */if (ptrCLICfg->tableEntry[index].cmd == NULL){
//DebugP_log (" index = %d \n", index);
//DebugP_log ("break\r\n\n");/* 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*)gHardcodedCliConfigs[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){
//DebugP_log (" index = %d \n", index);
//DebugP_log ("cmd = %s \n", ptrCLICommandEntry->cmd);
//
//DebugP_log ("helpString = %s \n", ptrCLICommandEntry->helpString);CLI_write("%d\n", index);CLI_write("%s\n", gCLI.cfg.tableEntry[index].cmd);/* YES: Pass this to the CLI registered function */cliStatus = ptrCLICommandEntry->cmdHandlerFxn (argIndex, tokenizedArgs);if (cliStatus == 0){countTemp = countTemp + 1;DebugP_log ("countTemp %d\r\n", countTemp);DebugP_log ("Done\r\n\n");}else{DebugP_log ("Error %d\r\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;
}
Chris Meng:
qiang li16 说:在ccs 工程中,MmwDemo_CLIInit 中 如下代码所示,比如channelCfg中没有,那不是在执行AWR2944_CLI_ByPassApi(&cliCfg);这个函数的时候,如果截图1所示 执行到channelCfg的时候,是不是就会去执行cli_mmwave.c文件中的CLI_MMWaveChannelCfg这个函数,如图2所示。
不是,会按照配置里一条一条的执行下去。
,
qiang li16:
如下图所示,当在cli_init 函数中 cliCfg.enableMMWaveExtension = 1u;是不是在cli_init 函数中如果没有对channelCfg进行进行定义,那么由于cliCfg.enableMMWaveExtension = 1u,channnelcfg会自动执行CLI内部定义好的channelCfg的句柄函数,当cliCfg.enableMMWaveExtension = 0U时,channnelcfg就不会自动执行CLI内部定义好的channelCfg的句柄函数
,
Chris Meng:
你好,
是的。
对了,你的目的是自定义cli命令,这个命令是sensor的配置命令么?你可以参考现有的命令添加,而不是替换一个啊。
,
qiang li16:
你好,是这样的,我想实现实现在DDM方式的adv chirp config 和 adv frame config ,但是DDM CCS Demo 工程不支持(在之前提问你的帖子中你也有回复,sdk中写明了DDM 方式不支持 adv frame config),DDM 只支持 frame based chirps(dfeDataOutput Mode),按照在mmwave studio 中的流程,在配置完profileconfig后,我要先去配置adv chirp config 再配置 adv frame config ,但是CLI中不是没有adv chirp config 的相关命令,那么我需要自定义adv chirp config 和adv frame config 的CLI 实现sensor配置的命令。所以我尝试重新改写channelCfg进行尝试,通过调用了rI_sensor.c中函数,设置channelcfg,通过函数返回值也知道了配置成功与否,设置的返回值显示的都是success的,但是程序提示报错,显示 Error: mmWave Config failed [Error code: -3101 Subsystem: 0]。
,
Chris Meng:
* @brief Error Code: Invalid argument */#define MMWAVE_EINVAL (MMWAVE_ERRNO_BASE-1)
—-
#define MMWAVE_ERRNO_BASE (-3100)
我还是不明白,你为什么不是添加一个advchirpcfg,而是修改现有的配置参数?你可参考现有的cfg,加一个啊
,
qiang li16:
你好,我自定义了一个advchirpcfg,那我想问下,
1.程序中配置的chirpCfg和frameCfg需要屏蔽么,如图1
2. advchirp的配置,mmwave studio已经验证了,参数已经知道了,直接调用SDK 中 如图2中的函数即可么,需要创建句柄,信号量什么的,能不能讲的详细一点;
图1
图2
,
Chris Meng:
qiang li16 说:1.程序中配置的chirpCfg和frameCfg需要屏蔽么,如图1
你的配置中不使用的话,删除即可。
qiang li16 说:2. advchirp的配置,mmwave studio已经验证了,参数已经知道了,直接调用SDK 中 如图2中的函数即可么,需要创建句柄,信号量什么的,能不能讲的详细一点;
CLI只是把需要配置的参数传给了mss,然后由mss或者dss来调用函数来实际配置。
建议你看看C:\ti\mmwave_mcuplus_sdk_04_02_00_03\ti\control\mmwave\src\mmwave_link_common.c里的MMWave_configLink函数。
TI中文支持网





