Found a bug in the CubeMX Code Generation
There is a bug in the CubeMX Code Generation in STM32CubeIDE Code Generation (Version 1.7.0 updated to 1.8.0) for the STM32F767ZI. (STM32Cube FW_F7 V1.16.2)
The bug was found by debugging a not working auto generated code that is using a DMA circular buffer to read from uart.
In the auto generated initialization code for the hardware the ordering of the function calls was:
MX_GPIO_Init();
MX_USART3_UART_Init();
MX_DMA_Init();Because DMA_Init starts the clock to the dma the dma isn't clocked when initializing the uart which uses the DMA.
This leads to a non functioning dma transfer and the uart overflow error is triggered because nothing is reading from the uart peripheral.
As a work arround you can write:
LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_DMA1);before the block with the MX initializiation functions or you can swap the calls to dma init and uart init.
