I’m learning the STM32 platform. The code generation in STM32CubeIDE makes it easier to configure different MCU subsystems and start writing “hello world” apps. However, it can be difficult to understand how all this magic works. Fortunately, there is a comprehensive explanation in the STM32CubeMX for STM32 configuration and initialization C code generation user manual in section 6.1.