2017-10-27 11:06 AM
2017-10-28 07:18 AM
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.
2017-10-28 07:56 AM
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.
2017-10-28 10:08 AM
Polling for each tx character doesn't seem to be an efficient strategy, DMA works well for large blocks.
2017-11-08 08:59 AM
Thank you Clive ,
Disable of Interrupt at no data available : worked .