Simplified generated code of the STM32CubeIDE. This code is only for studying purposes. I just removed the comments and stripped off the error handling codes (which of course, should not be done), I added notes to easily know what is happenning.
STM32 used in this project is STM32F030F4P6 Direct link to the source code