- This topic has 2 replies, 1 voice, and was last updated 3 years, 8 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Forums › Mastering STM32 book support forum › DMA transfer in interrupt mode
Hi all, i am trying understand why in the example of UART DMA trasnfer in interrupt mode the author enables the UART related interrupt.
I mean it is not the UART to generate the interrupt but the DMA when trasfer is completed, so why he needs to enable UART interrupts?
The author writes in chapter 9.2.7 Using the HAL_UART Module With DMA Mode Transfers,
one of key points is :
• enable the UART related interrupt and call the HAL_UART_IRQHandler() routine from its ISR
(this is really important, do not skip this step);
WHY????????????????????
ok i understand why….
i think its becouse HAL_UART_RxCpltCallback
hahhaha, the reason is explained in question and suggestions.
Many thanks, but really i already see this in HAL_UART_Receive_DMA:
/* Enable the UART Parity Error Interrupt */
SET_BIT(huart->Instance->CR1, USART_CR1_PEIE);
/* Enable the UART Error Interrupt: (Frame error, noise error, overrun error) */
SET_BIT(huart->Instance->CR3, USART_CR3_EIE);