If you program with checkboxes in CubeMX and use other people's tools, then do not be surprised by their glitches and clandestine actions.
Please do not poison this thread with how bad tools like CubeMX are.
Daily I use PIC16, PIC18, STM32F0, STM32F4, 8052 and CubeMX saves me a lot of headaches.
Back when I used only HC11 I knew each bit in each config register.
But over the years I used also OMAPs from Ti, imx6 from Freescale, and custom ASICs(data sheet ~4500pages).
Already have millions of pages from datasheets in my head. Simply no space left for subtle differences like clocking from HSE or HSI.
Writing code bit by bit in config registers for simple things like SPI driver is the last thing that I want to spend time on.
Let focus on how to improve existing tools.