HAL_UART_RxCpltCallback not being called for USART1 and USART1_IRQHandler has no data
Hello,
I have an STM32L476G Evaluation board, and I'm trying to use USART1 to generate an interrupt on receiving characters. On the evaluation board, this is connected to the RS232 port, which I have a module, I transmit data to get a response back. I've hooked up a salae logic analyser and can see when I send the data, the response is being sent back.
![2023-10-29 07_24_32-Logic 2 [Logic Pro 16 - Connected] [Session 2].png 2023-10-29 07_24_32-Logic 2 [Logic Pro 16 - Connected] [Session 2].png](https://uploads-eu-west-1.insided.com/stmicroelectronics-en/attachment/764d6b39-96e0-bc3a-1cba-c94cfacdd1a4.png)
From CubeMX I have enabled the USART1, with global interrupts, as well as in the project manager tab, I have selected in the advanced settings register callback for USART and UART.
In the code I write the line below, to receive and interrupt every character:
HAL_UART_Receive_IT(&huart1, rx_buffer, 1);
Then I transmit the string code I write the line below, to receive and interrupt every character:
while(HAL_UART_Transmit_IT(&huart1, atc, 4) != HAL_OK);
HAL_Delay(1000);
The function below gets called, however, HAL_UART_RxCpltCallback(UART_HandleType *huart) never gets called.
void USART1_IRQHandler(void)
{
/* USER CODE BEGIN USART1_IRQn 0 */
/* USER CODE END USART1_IRQn 0 */
HAL_UART_IRQHandler(&huart1);
/* USER CODE BEGIN USART1_IRQn 1 */
/* USER CODE END USART1_IRQn 1 */
}
When I debug and put a breakpoint in the USART_IRQHandler(void) function, there is no data in the buffer.
What is the problem with what I am doing and why is the data not being stored in the buffer? I am generating an interrupt as the USART_IRQHandler(void) is causing the breakpoint to stop, but there is no data in the buffer.
