Skip to main content
Visitor II
Question

Why is HAL_UART_Receive_IT not triggering the callback function on STM32F103?

I’m using HAL_UART_Receive_IT() on an STM32F103 to receive serial data asynchronously. The UART initialization appears correct, and I can send data successfully, but the HAL_UART_RxCpltCallback() function never gets triggered. I’ve confirmed the interrupt is enabled in NVIC and the buffer size is correct.

Is there something I might be missing in configuration or code structure that prevents the callback from firing?
Any sample code or debugging steps would be greatly appreciated. Thanks!

This topic has been closed for replies.

3 replies

Ozone
Principal

What UART interrupts do you configure, and do they fire ?
Assuming RxNE, set a corresponding breakpoint in the interrupt handler.

Do you see any signal on the Rx pin when the other side transmits ?

Andrew Neil
Super User

Welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results.

 


@timdavid0812 wrote:

Is there something I might be missing 


We can't see your code, so we can't say what might be missing or incorrect!

See: How to insert source code.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
ST Technical Moderator

Hello @timdavid0812 

Please refer to the example below:

Projects/STM3210C_EVAL/Examples/UART/UART_TwoBoards_ComIT

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om