I'm trying to implement simple echo for UART on stm32f4 discovery board (using freertos). As far as I understand it should be very easy.
First I call HAL_UART_Receive_IT(&huart3, &rx_char,1)
in a task. And after receiving an interrupt USART3_IRQHandler
should trigger. And then in HAL_UART_RxCpltCallback
I'll do HAL_UART_Transmit(&huart3, &rx_char, 1, timeout)
and maybe re-enable it with HAL_UART_Receive_IT
. Did I get the idea right? Should it work?
But in my case it doesn't. I'm trying to send a char from the terminal, but USART3_IRQHandler
is never triggered. Nothing happens.
The code was generated using Stm32CubeMX with Freertos, USART3, NVIC and with USART3 global interrupt enabled.
Also I call __HAL_UART_ENABLE_IT(&huart3, UART_IT_RXNE)
in main function.
What is wrong? HAL_UART_Transmit
works perfectly.