AnsweredAssumed Answered

Issue re-enabling LPUART1 receiver?

Question asked by Nick McKendree on Jul 19, 2017
Latest reply on Jul 20, 2017 by Nick McKendree

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. 

 

Processor: STM32L011

Module: LPUART1

 

void enable_uart_transmitter(void)

{

     LPUART1->CR1 |= ( USART_CR1_TXEIE | USART_CR1_TE );

}

void disable_uart_transmitter(void)

{

     LPUART1->CR1 &= ~(USART_CR1_TXEIE | USART_CR1_TCIE | USART_CR1_TE);

}

void enable_uart_receiver(void)

{

      LPUART1->CR1 |= ( USART_CR1_RXNEIE | USART_CR1_RE );

}

void disable_uart_receiver(void)

{

     LPUART1->CR1 &= ~( USART_CR1_RXNEIE | USART_CR1_RE );

}

Outcomes