Hello, working with the CC2650 LaunchPad for CCS6 with the "UART_ECHO" example. I made small modifications to use callbacks instead of blocking for the UART driver. Within my UART write callback I tried both "System_printf()" and "System_flush()" and every variation between the two. Both cause the program to crash and go into "Error_policySpin" loop. This is the callback:
void writecb(UART_Handle handle, void *buffer, size_t num) { System_printf("WRITECB"); }
Here is the driver config code:
UART_Params_init(&uartParams); uartParams.writeMode = UART_MODE_CALLBACK; uartParams.readMode = UART_MODE_CALLBACK; uartParams.writeDataMode = UART_DATA_TEXT; uartParams.readDataMode = UART_DATA_TEXT; uartParams.writeCallback = &writecb; uartParams.readCallback = &readcb; uartParams.readEcho = UART_ECHO_ON; uartParams.baudRate = 115200; uart = UART_open(Board_UART0, &uartParams); if (uart == NULL) { System_abort("Error creating UART!"); }
I then simply call UART_Write() once and I have a breakpoint within the callback to verify it is being entered (which it is). If the program doesn't get an error and go into the error loop, the print does nothing. System_flush() usually guarantees an error. Any help is appreciated.