2019-11-18 02:13 AM
I receive the data byte by byte and I can see that the only time that it fails is at the beginning of the transmit. It looks like the HAL is busy starting the transmit so it cannot re-enable the receive interrupt after the previous byte has been received. The HAL receive function returns busy and therefore the interrupt is not enabled.
Can the HAL cope with transmitting and receiving at the same time? It only happens when the first byte is being prepared for transmit.
Any advice would be greatly appreciated.
2019-11-18 02:29 AM
I'm afraid you have to implement it without HAL. The UART controller has no difficulty handling transmit and receive at the same time, you just don't disable the receive interrupt at all. Enable/disable transmit interrupt (TXEIE) as needed.
Read the USART chapter in the reference manual for details.
2019-11-18 03:03 AM
Thanks, did you also have issues with HAL? I shall try to implement the receive and transmit using the examples given in the reference manual.
2019-11-18 05:20 AM
Stopped using HAL a long time ago. It was just getting in the way of doing stuff.
2019-11-18 05:59 AM
The U(S)ART HAL implementation is unhelpful and frequently gets in its own way. Not using the IT/DMA methods provided.