DMA won’t function after firmware is updated with a data stream
The problem only happens when a constant stream of data is being send to the UART. When I update my firmware sometimes DMA won't work. It is hard to debug when it only happens when updating and not every time.
This post is exactly the same issue as mine: DMA issue post
In the first image below are the registers when DMA won't work. The second image are the registers when DMA is working correctly.
I looked at every register and tried manually resetting and staring the DMA, but still sometimes after an update DMA won't work. I can;t find the source of why this happens and why it won't work even when I hardware reset the controller.
I looked at the HAL datasheet and validated the steps needed for DMA. I'm really out of option. If someone has an idea on what to check or knows a solution (maybe don't use DMA but interrupt?).
problem
no problem
UART/DMA init
hdma_uart5_rx.Instance = DMA1_Stream0;
hdma_uart5_rx.Init.Channel = DMA_CHANNEL_4;
hdma_uart5_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_uart5_rx.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_uart5_rx.Init.MemInc = DMA_MINC_ENABLE;
hdma_uart5_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
hdma_uart5_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_uart5_rx.Init.Mode = DMA_CIRCULAR;
hdma_uart5_rx.Init.Priority = DMA_PRIORITY_HIGH;
hdma_uart5_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
