Hello,
as I understand, the UARTFlushTx(false) is waiting for the uartstdio to transmit all remaining characters in the Tx buffer and on the return, the Tx buffer is empty. My UART0 initialization looks like this:
void ConfigureUART0(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); // Enable the GPIO Peripheral used by the UART.
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); // Enable UART0
GPIOPinConfigure(GPIO_PA0_U0RX); // Configure GPIO Pins for UART mode.
GPIOPinConfigure(GPIO_PA1_U0TX);
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC); // Use the internal 16MHz oscillator as the UART clock source.
UARTStdioConfig(0, 115200, 16000000); // Initialize the UART for console I/O.
UARTEchoSet(0);
}
And my program line looks like this:
UARTprintf("01234567012345670123456701234567\r\n");
UARTFlushTx(0);
What I'm getting on the terminal is:
01234567012345670
This is first 17 characters and then program stalls. When "UARTFlushTx(0);" line is commented, I am getting all the characters and program is working ok.
Another problem is this one: if I am replacing UARTFlushTx(0); with SysCtlDelay(...);, I am getting those first 17 chars before delay and the other remaining chars after delay, no matter how long delay is!!! I dont know, where the problem is...