I altered the 3D People Counting Demo to output via the command port instead of the logging port.
In void MmwDemo_uartTxTask(UArg arg0, UArg arg1) I added the following which prints just fine...
char logMessage[24] = "count:255 \n\r"; /* wait for new message and process all the messages received from the peer */ while(1) { Semaphore_pend(gMmwMssMCB.uartTxSemHandle, BIOS_WAIT_FOREVER); startTime = Cycleprofiler_getTimeStamp(); /* Log the message on the UART CLI console: */ if (gCLI.cfg.usePolledMode == true) { /* Polled mode: */ UART_writePolling (gMmwMssMCB.commandUartHandle, (uint8_t*)&logMessage[0], 22); } else { /* Blocking Mode: */ UART_write (gMmwMssMCB.commandUartHandle, (uint8_t*)&logMessage[0], 22); } GPIO_toggle(gMmwMssMCB.cfg.platformCfg.SensorStatusGPIO); gMmwMssMCB.uartProcessingTimeInUsec = (Cycleprofiler_getTimeStamp() - startTime)/R4F_CLOCK_MHZ; }
Which very happily outputs "count:255 \n\r" to the command port.
However,
If I add in snprintf, the code does not output anything at all to the command port and the code appears to be frozen. It never reaches GPIO_toggle(gMmwMssMCB.cfg.platformCfg.SensorStatusGPIO);char logMessage[24] = "count:255 \n\r";
uint8_t numTargets = 29;
/* wait for new message and process all the messages received from the peer */
while(1)
{
Semaphore_pend(gMmwMssMCB.uartTxSemHandle, BIOS_WAIT_FOREVER);
startTime = Cycleprofiler_getTimeStamp();
/* Format the message: */
snprintf (logMessage, 22, "count:%03u \n\r", numTargets);
/* Log the message on the UART CLI console: */
if (gCLI.cfg.usePolledMode == true)
{
/* Polled mode: */
UART_writePolling (gMmwMssMCB.commandUartHandle, (uint8_t*)&logMessage[0], 22);
}
else
{
/* Blocking Mode: */
UART_write (gMmwMssMCB.commandUartHandle, (uint8_t*)&logMessage[0], 22);
}
GPIO_toggle(gMmwMssMCB.cfg.platformCfg.SensorStatusGPIO);
gMmwMssMCB.uartProcessingTimeInUsec = (Cycleprofiler_getTimeStamp() - startTime)/R4F_CLOCK_MHZ;
}