Hello,
I'm trying to call UART_read() within a callbackFxn registered by Clock_construct(). Calling UART_read() completes the callback function, but then throws a "policySpin" error with the following code:
*
* ======== Pulse: registered with Clock_construct() =======
*/
Void Pulse(UArg arg0, UArg arg1)
{
System_printf("Entering secondPulseFxn.\n");
// For continuous runs, poll UART for STOP message
unsigned char alertRx;
if (continuousRun) {
UART_read(uart, &alertRx, sizeof(alertRx));
System_printf("Our alert: %i", alertRx);
}
}
// Somewhere else in code
UART_Params_init(&uartParams);
uartParams.readMode = UART_MODE_BLOCKING;
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readReturnMode = UART_RETURN_FULL; // Unblock when buffer is full
uartParams.readEcho = UART_ECHO_OFF;
uartParams.baudRate = 115200;
uartParams.readTimeout = 10;
uart = UART_open(Board_UART0, &uartParams);
If it helps, I'm using:
CCS Version: 6.1.3.00034
MCU: CC2650
TI-RTOS: 2.20
Not quick sure where to start with this one - commenting out UART_read() does not produce hanging of any kid. What's odd is the hanging only occurs after the callback is exited (i.e. I step though the last line of the callback). I've already enabled "BIOS.libType = BIOS.LibType_Debug;" in my .cfg script in an attempt for proper debug symbols to allow me to step through code with no such luck.
Ultimately, I'm trying to poll a UART handle periodically. I have several clock functions that are all time sensitive (micro-second granularity) and am trying to poll uart with the least amount of latency possible. This means avoiding for/while loops or using large receive buffers and this clock function is in charge of polling UART. If possible, I'd like to keep it within a Clock_construct() function as all of the clock functions are chained together. I've already tried closing my previous UART session and opening a UART session within this clock function without calling UART_read(). The same error is produced.
