STM32F446: bug when using DMA UART
We wanted to use a UART periphal in transfer DMA mode. When configuring it with CubeMX, nothing happens, event when trying it on an empty project.
When manually configuring the various registers for DMA transfer between memory and the peripheral data register, the behaviour was correct, so I suspected an issue with the HAL library.
I tracked the bug down to the function HAL_DMA_Init in Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
The following line (line 251) is supposed to set the config register for the appropriate DMA stream:
hdma->Instance->CR = tmp;
But, when step debugging, it appears to have no effect on the register (as seen on the SFRs tab), even if the tmp variable has the correct value... How could this be explained? A weird silicon bug that doesn't allow to set the register in certain state of the mcu? An error in the library?
In the meantime, we can just set the DMA stream CR register from the main function.
Maybe it's worth mentioning that the issue occured with two different MCUs.
