2018-04-11 02:01 AM
My code is run on STM32F427ZIxx
SET_BIT(huart2.Instance->CR1, USART_CR1_TXEIE);
void USART2_IRQHandler(void)
{ /* USER CODE BEGIN USART2_IRQn 0 *//* USER CODE END USART2_IRQn 0 */
HAL_UART_IRQHandler(&huart2); /* USER CODE BEGIN USART2_IRQn 1 */ HAL_UART_Transmit(&huart3,(uint8_t *)'\r\nTransmission Complete Interrupt',33,100);}
when i am reading UART3 it is going infinite but CLEAR_BIT(huart2.Instance->CR1, USART_CR1_TXEIE); in ISR, giving two times print of.
vs what is USART_CR1_TCIE ????
Solved! Go to Solution.
2018-04-11 03:31 AM
TXE indicates the TX register is empty, and available again. The last value had just been moved to the send hardware.
The actual transmission might not yet have been started.
TC means the hardware has finished the transmission, the character has 'left' the device. This might take comparatively long.
void USART2_IRQHandler(void)
{ HAL_UART_Transmit(&huart3,(uint8_t *)'\r\nTransmission Complete Interrupt',33,100);}
Not sure what the Cube generated code is based upon, but calling synchronous output functions (like printf()) from within an interrupt handler is a recipe for disaster.
2018-04-11 03:31 AM
TXE indicates the TX register is empty, and available again. The last value had just been moved to the send hardware.
The actual transmission might not yet have been started.
TC means the hardware has finished the transmission, the character has 'left' the device. This might take comparatively long.
void USART2_IRQHandler(void)
{ HAL_UART_Transmit(&huart3,(uint8_t *)'\r\nTransmission Complete Interrupt',33,100);}
Not sure what the Cube generated code is based upon, but calling synchronous output functions (like printf()) from within an interrupt handler is a recipe for disaster.
2018-04-11 09:35 PM
thanks for valuable answer..