2021-02-09 11:44 AM
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?
Solved! Go to Solution.
2021-02-09 02:37 PM
You are missing the famous set of examples for UART with DMA by Tilen Majerle.
https://github.com/MaJerle/stm32-usart-uart-dma-rx-tx
Enjoy!
-- pa
2021-02-09 12:19 PM
I got how to do it from this webpage.
2021-02-09 02:37 PM
You are missing the famous set of examples for UART with DMA by Tilen Majerle.
https://github.com/MaJerle/stm32-usart-uart-dma-rx-tx
Enjoy!
-- pa
2021-02-09 05:00 PM
Thanks. That did not pop up on the search engine.
I will look at it in the morning.