I have successfully used UARTCharGet and UARTCharPut for sending and receiving a small number of bytes less than the FIFO size of 16.
Now I am sending more than 16 bytes and the UARTCharPut function hangs indefinitely waiting for the FIFO to have a spot available in it. Sometimes a FaultISR is raised.
It is as though the UARTEnable function has not been called (but is has inside UARTConfigSetExpClk), or it is as though subsequent to the UART being enabled, the UARTDisable function has been called. However I find no such calls in my code nor in any TIVAware library code I am using. I know I write to the 16 byte FIFO with more than 16 chars in quick succession, but then I am happy for the UARTCharPut function to block waiting for the FIFO to empty out one or more of its elements.
I am not using interrupts and have not enabled them.
I have attempted to use the UARTCharPut NonBlocking option after first waiting for UARTSpaceAvail to return true, to no avail. The only way I have found to overcome this problem is to put a large delay prior to a run of a few calls to UARTCharPut as follows
ROM_SysCtlDelay(200000); UARTCharPut(Command_UART_PORT_with_EP,0x23);//reply with get filter type cmd UARTCharPut(Command_UART_PORT_with_EP,(uint8_t)FilterChannel);//reply with channel UARTCharPut(Command_UART_PORT_with_EP,(uint8_t)FilterType);
What possible reason can explain this behaviour ?
BTW here is my UART init routine:
void initialise_UART_with_EP(void)
{
Command_UART_PORT_with_EP=UART6_BASE;
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOP); //EP to SP UART for Commands
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART6); //enable EP to SP UART6.
GPIOPinConfigure(GPIO_PP0_U6RX);//UART for commands between EP and SP
GPIOPinConfigure(GPIO_PP1_U6TX);//UART for commands between EP and SP
GPIOPinTypeUART(GPIO_PORTP_BASE, GPIO_PIN_0 | GPIO_PIN_1);//UART for commands between EP and SP
UARTConfigSetExpClk(Command_UART_PORT_with_EP, ui32SysClock, 80000,(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
}