Hello ! I am working on STM32F207 controller , where I am trying to transmit my data over UART2 at TXE Interrupt . i have used ISR mention in attached file but its not working , problem is it stuck in Interrupt loop after transmission starts .
Code is incomplete and doesn't compile.
Routines in the interrupt handler should not block. If no data is available to send, the TXE interrupt must be turned off. The Cortex-M3 will stay in the interrupt state if you fail to clear the sources of those interrupts. Use a debugger and simplify the code until you understand what is happening.
You only need to check the TXE flag in the USARTx->SR, you don't need to test multiple bits and use &&
Review avaliable HAL example code for the USART under the Cube directories.
Thank you Clive ,
Disable of Interrupt at no data available : worked .
I usually avoid using TX under interrupt. Only RX would require interrupt as the data flow is not under control of the STM32.
Use polling byte or block transfer by DMA for example.
Polling for each tx character doesn't seem to be an efficient strategy, DMA works well for large blocks.
Retrieving data ...