

You may find this conf file from the Project template folder.

You need one more header file which is “stm8s_conf.h” file.

You also need to go to the “inc” folder from the Libraries folder and need to select the “stm8s.h” header file. It will take you to the folder browser and here you need to navigate to the Standard Peripheral Libraries folder and from the “src” folder select all the “C” files for your desired Peripheral. Now right click on the left project pannel into the “include file” folder icon and select the “add files to the folder” option. Once all is set up just finish the stm8 project initialization process. After that select your appropriate microcontroller part number. Select your folder and name your project. Now go back to your STVD IDE and Add a new Project into your workspace. This folder also has the STM8S_StdPeriph_Examples folder which contains all the examples for each and every peripheral which you may use as a starter project for that specific project. This folder contains a template project folder. One more important folder is the “Project” folder. In the inc folder, there are all the header files and in the src folder, there are all the c files related to the Peripheral drivers. There are further two folders inside the Libraries folder the inc and src. Here you see the Libraries folder, this is the folder where all the peripheral libraries are. Once you are done creating a folder and extracting the Libraries into that folder, you need to create a new workspace in that folder in your STVD IDE. You can choose the name of the folders whatever you like or choose the location of your choice on your computer. For example in my case, I am using a COSMIC-SPL folder in the My Documents folder. Once you downloaded the libraries you need to extract the zip files into a Project folder which you are using for your workspace. You may also need to refer to the STVD documentation as a reference. Download the STM8 Standard Peripheral Libraryįirst of all, you need to go to the ST website and download the STM8S/A Standard Peripheral library package. So it is easy to migrate from the STM32 devices to STM8 devices using the STM8 standard Peripheral Library, which in short is sometimes referred to as SPL. So if you had previously worked with the STM32 devices, the API is going to be the same for the STM8 as well. So it is a very unique way to access the peripherals of the STM8 microcontroller. But ST makes a good Peripheral library for the STM8 as well, just like they did for the STM32 devices. We always used the GPIOs and all the Peripherals like UART etc. You may already know from our previous tutorials that we used the stm8 bare-metal programming. Today we are going to use the STM8 standard peripheral library (SPL) with STVD IDE and Cosmic Compiler.
