2020-02-25 11:05 AM
If you generate code in CubeMX with enabled USART and DMA for TX line init functions will be called in a wrong sequence. Init function for USART is called before DMA init function but it does some setup for DMA. Since DMA init function enables bus clock that relates to DMA then all settings that were made in USART init function for DMA will be missed (all DMA register will be 0).
It works for CubeMX 5.4.0 and STM32L4 Discovery board.
2020-02-25 01:25 PM
It's a known problem with v 5.4
Generating a new project in New version may generate the correct order, but existing projects probably won't get corrected automatically and there are issues reported with manual reordering https://community.st.com/s/question/0D50X0000CAthwBSQR/stm32cubemx-56-generated-function-calls-ranking-not-working-correctly
I don't use Cube/CubeMX.
JW