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.
By default, the mmWave radar demonstration labs accept configuration commands over UART to set up the device with the desired settings. To provide flexibility, these are typically stored in a text file and sent at startup, but this requires a PC connection and takes a small amount of time. When using the devices remotely, or if repeating measurements, it can be very helpful to have these configuration values 'hard coded' so the device will boot, configure, chirp, and output data without further input from the user.
This functionality can be added very easily to any of the existing demos using the already built CLI driver. The instructions below illustrate a fast way to add this functionality.
#ifdef USE_HARD_CODED_CONFIG
int32_t hardCodedConfigIndex;
char * hardCodedConfigCommands[] =
{
"sensorStop ",
"flushCfg ",
"dfeDataOutputMode 1 ",
…
…
"!!!END_OF_HARD_CODED_COMMANDS"
};
#endif
#ifdef USE_HARD_CODED_CONFIG
hardCodedConfigIndex = 0;
CLI_write ("Wait some time for system to initialize...\n");
Task_sleep(100);
CLI_write ("Performing hard-coded config\n");
#endif
#ifdef USE_HARD_CODED_CONFIG
/* Run hard-coded commands, one at a time until '!!!END_OF_HARD_CODED_COMMANDS' is reached: */
if (hardCodedConfigCommands[hardCodedConfigIndex][0] != '!')
{
//CLI_write (hardCodedConfigCommands[hardCodedConfigIndex]);
CLI_write ("Command\n");
memcpy((void *)&cmdString[0], (void *)hardCodedConfigCommands[hardCodedConfigIndex],
strlen(hardCodedConfigCommands[hardCodedConfigIndex]));
hardCodedConfigIndex++;
}
/* Accept commands from UART after all hard-coded commands done: */
else
{
/* Read the command message from the UART: */
UART_read (gCLI.cfg.cliUartHandle, &cmdString[0], (sizeof(cmdString) - 1));
}
#else
/* Read the command message from the UART: */
UART_read (gCLI.cfg.cliUartHandle, &cmdString[0], (sizeof(cmdString) - 1));
#endif