2021-12-05 09:06 AM
I have followed an example found on the web to get DMA RX usart2 running.
I had activate RX DMA, global interrupt in cubmx project.
In the main I have :
HAL_UARTEx_ReceiveToIdle_DMA(&huart2, RxBuf, RxBuf_SIZE);
__HAL_DMA_DISABLE_IT(&hdma_usart2_rx, DMA_IT_HT);
and I added the callback function:
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
{
if (huart->Instance == USART2) {
memcpy(MainBuf, RxBuf, Size);
HAL_UARTEx_ReceiveToIdle_DMA(&huart2, RxBuf, RxBuf_SIZE);
__HAL_DMA_DISABLE_IT(&hdma_usart2_rx, DMA_IT_HT);
}
}
Then when I launch the debbug, the callback function is well called, but only one time, and never called back again.
Did I miss something to re-activate the callback ?
I'm using a nucleo H743 board.
Thnaks for your help.
2021-12-16 11:06 PM
I know that because it hit the breakpoint in UART4_IRQHandler only once.
I had add a led toggle in the IT and it is the same the led light switch on and never switch off with some character I sent from my computer to the nucleo...
It is the same if I remove this function:
> MX_ETH_Init();
> MX_USART3_UART_Init();
> MX_UART4_Init();
> MX_USB_OTG_FS_PCD_Init();