how to enable uart interrupt
Hello,
I want to activate UART1 interrupt directly through code in STM32CubeIDE, without using the .ioc file. UART1 is already active, so I just need to add the necessary lines to enable the interrupt.
In the stm32wbxx_it.c file, I defined the interrupt handler as follows:
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 */
}
In the stm32wbxx_it.h library, I declared the prototype as void USART1_IRQHandler(void);. However, I am still not able to receive data using the HAL_UART_Receive_IT function.
