Loading...
 
Skip to main content

System Workbench for STM32


UART Character Match Interrupt

Thank you Terek! I managed to get the interruption!

However, I still have one problem. When the program handles a first interruption, it doesn't handle following ones...

I added the following lines :

In main.c before the while(1):

_ _HAL_UART_ENABLE_IT(&huart1, UART_IT_CM);

In stm32l4xx_it.c in USART1_IRQHandler :

if(_ _HAL_UART_GET_IT(&huart1, UART_IT_CM)) {
_ _HAL_UART_CLEAR_FLAG(&huart1, UART_CLEAR_CMF);
}
HAL_UART_IRQHandler(&huart1);

When I delete the CLEAR_FLAG line, the interrupt is continuously handled, of course.

Sorry I am not that comfortable with the registers and the interruptions...

 
Collapse/expand modules below