I have a circuit that requires the receiver to be disabled when transmitting and the transmitter disabled while receiving. I seem to be having trouble re-enabling the receiver after transmitting a packet of data.
I do not get any UART interrupts on the next receive event. I have trapped it with the debugger and the UART register shows the receiver is enabled, the receive interrupt is enabled, and the uart is enabled. The only thing I do not see is the REACK flag set. If I try to sit in a loop until REACK is set, I end up in a infinite loop.
I can receive a packet, switch to transmit and send a packet, but I am unable to successfully switch back into a valid receive mode. This is all part of a exchange of data without any gaps between packets and I am not going to sleep between packets.
LPUART1->CR1 |= ( USART_CR1_TXEIE | USART_CR1_TE );
LPUART1->CR1 &= ~(USART_CR1_TXEIE | USART_CR1_TCIE | USART_CR1_TE);
LPUART1->CR1 |= ( USART_CR1_RXNEIE | USART_CR1_RE );
LPUART1->CR1 &= ~( USART_CR1_RXNEIE | USART_CR1_RE );