How do you start DMA with interrupts? huart4.Instance->CR3 |= USART_CR3_DMAT; HAL_DMA_Start_IT(&hdma_uart4_tx,(uint32_t)msg, (uint32_t)&huart4.Instance->TDR,len); Works the first time, but if you change msg and len it repeats first case.
I need the callback, to clear the cb4.DMA_Active flag and update a pointer when it finishes.
I cannot step through it because it starts sending data over and over as I step through it and does not call the callback.
First time msg points to "1234567890\r\n" len = strlen(msg)
Second time msg points to "ABCDEFGHIJKLMNOPQRSTUVWXYZ\r\n", len= strlen(mssg)
Second time it sends "1234567890\r\n" again.
static void dma_debug_write(char *msg, size_t len)
{
// this is the real code I want to run.
cb4.DMA_Active = 1;
huart4.Instance->CR3 |= USART_CR3_DMAT;
HAL_DMA_Start_IT(&hdma_uart4_tx,
(uint32_t)msg,
(uint32_t)&huart4.
Instance->TDR,
len);
}
What am I missing?