0

I am using stm32f4 on discovery board with freertos running on it.

Just started working with stm32 controller and trying to make data transfer using UART. Printf based on HAL_UART_Transmit works perfectly, but receiving data isn't working.

According to numerous tutorials it should be very simple. I create a project in Stm32CubeMX, add all necessary stuff (freertos, USART3, NVIC), enable USART3 global interrupt and generate the code.

I'm trying to add HAL_UART_Receive_IT(&huart3, &rx_char, 1); or something similar in a task and it doesn't do anything. I suppose it flies through it very fast and doesn't wait for characters to be sent from the terminal.

What do I miss here?

Logen Sand
  • 111
  • 3
  • 10
  • You'll have to re-enable the interrupt each time you receive the char. Don't use HAL for this. See [https://stackoverflow.com/questions/37297318/cannot-transmit-every-characters-through-uart/37323052#37323052](https://stackoverflow.com/questions/37297318/cannot-transmit-every-characters-through-uart/37323052#37323052). – Paulo Soares Jul 10 '17 at 09:37
  • @PauloSoares i have `__HAL_UART_ENABLE_IT(&huart3, UART_IT_RXNE)` in main. But actually my program never gets to `USART3_IRQHandler`. It doesn't matter what's in it because it never happens. Should it be triggered at least once when I send something? I am completely lost here. – Logen Sand Jul 10 '17 at 11:18
  • @LogenSand did you find the solution for your question?? – pranjal khanduri Aug 27 '18 at 12:22

0 Answers0