Easy to use toolchain for building applications with STM8
Report Bug
·
Request Feature
This toolchain is based on compilation with SDCC and programming the controller with STVP. This allows you to use all the features of C99 standard and use any programmer that is supported by STVP.
In addition to this, unused functions are removed during compilation with the use of sdccrm.
Follow all the steps below for desired functionality of the toolchain.
Disclaimer: the steps are described for windows because i suppose linux users are much smarter than windows users so they don't need to be guided XD
Before running the toolchain on your machine, some necessary tools need to be downloaded.
You may have some of these tools already downloaded.
- Toolchain uses nodejs to handle more complex tasks (parsing json config, calculating the size of files, adjusting SPL library)
- Download (download the LTS version): nodejs.org
- Programmer to flash the program to stm
- STVP comes with STVD that is distributed by STM. You can download STVD and STVP here
- Compiler to compile the program
- Download: sdcc.sourceforge.net
choco install git make vscode mingw
Now when all necessary tools are downloaded you can run the toolchain on your machine.
-
Clone the repo
git clone https://github.com/matejkrenek/stm8-toolchain.git {project_name}
-
Edit config.json according to you needs
{ "device": "STM8S103", "flash": { "stvp_path": "C:/Program Files (x86)/STMicroelectronics/st_toolset/stvp/", "stlink": "ST-LINK", "device": "STM8S103F3" } }
Property Values "device" STM8S103, STM8S105, STM8S208 "flash.stlink" Any programmer supported by STVP "flash.device" Any device supported by STVP -
After editing config.json
make update
-
After any adjustment of config.js run:
make update
or
make install
-
For libraries there is associated folder lib:
|--app |--inc |--src |--lib |--SPL |--inc |--src |--Your-Library |--inc |--src
-
make commands that you can use to trigger functions
make {command}
Command Functionality "install" It installs desired version of SPL library based on your configuration "update" Same as the install command "clean" Removes build directory "compile" Compiles the program "flash" Uploads the program to stm "run" Runs clean, compile, flash commands
Matěj Křenek - mate23.krenek@gmail.com
Project Link: https://github.com/matejkrenek/stm8-toolchain
- You have to run make file commands in git bash 😥
Apart from this toolchain I recommend any of these: