https://lujji.github.io/blog/bare-metal-programming-stm8/

This article will cover developing for STM8 series of microcontrolles completely from scratch, without using any vendor-supplied libraries.