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.