Skip to content

lazicdanilo/STM8S103F3-CMake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STM8S103F3-SDCC-CMake

Prerequisites

SPL download

First we need to download Standard Peripheral Libraries (SPL) from STs website. You can find the code here, keep in mind you will need to make an account and log in. After download, move it into spl folder and unzip it.

SPL patch

As SPL is not compatible with SDCC (compiler we want to use) we need to patch it using STM8-SPL_SDCC_patch README. For instruction on how to do that checkout STM8-SPL_SDCC_patch README

Small Device C Compiler (SDCC)

# On Arch Linux
pacman -S sdcc

# On Ubuntu Linux
apt install sdcc

stm8flash

# Install stm8flash from https://github.com/vdudouyt/stm8flash
pacman -S git libusb pkg-config

git clone [email protected]:vdudouyt/stm8flash.git /tmp/stm8flash && make -C /tmp/stm8flash && sudo make install -C /tmp/stm8flash

Compile code using CMake and Make

The following commands can be used for compiling the code

mkdir build && cd build
cmake ..
make

Code can also be compiled using the compile-me.sh script

Download to board using stm8flash and ST-LINK V2

The following command can be used to download code to board

stm8flash -c stlinkv2 -p stm8s103f3 -s flash -w compiled_code.ihx

For download compile-me.sh script can be used as well.

compile-me.sh script usage

# Compile the project 
./compile-me.sh

# Recompile the project 
./compile-me.sh -r

# Compile and download to board 
./compile-me.sh -d

# Print help
./compile-me.sh -h

Hardware used

ST-LINK V2

Used for downloading the code

ST-LINK_V2

STM8103F3 board

STM8103F3_board

STM8103F3_board_pinout

About

STM8S103F3 CMake develompent bring up with SPL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published