This is such a perversity, that is beyond outrageous! I mean, there is only one way to set the registers and correctly “start the engine” of the controller! That is part of the user manual or documentation that comes with the microcontroller! To declare that foundation code generated by CubeMX to be unarguably their property is beyond common sense. It is a mockery to all.
But what is more infuriating is that there are people that can be tricked to think that this is part of normality. Outrageous! Public apologies won’t be enough from Microchip and STM.