Dependencies ============ make sdcc libusb-dev (for stm8flash) udev example rules ================== STM8S-Discovery: ---------------- SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE:="0666", GROUP:="dialout", SYMLINK+="stlink_%n" The discovery board also emulates an USB mass storage device. However the implementation is buggy and it doesn't really work with linux. It's best to just ignore the usb-storage endpoints. You can do this temporarly using the following command: # echo "0483:3744:i" >/sys/module/usb_storage/parameters/quirks To make this permanent, create a file '/etc/modprobe.d/stdiscovery.conf' with the following content: options usb-storage quirks=0483:3744:i The changes will take effect on next reboot or after manually unloading the usb-storage driver # modprobe -r usb_storage This might not work if there is another device connected that is or emulates an USB storage device. Build ===== Getting the source via GIT: --------------------------- git clone git://git.spreadspace.org/stm8-utils.git cd stm8-utils make -C contrib build and flash blink example ----------------------------- # cd blink adapt Makefile (set BOARD_TYPE) # make program Some Hints ========== The object files for builded libs will be called lib-.o so make sure not to use files named like this for your own code. i.e. if you want to use the `led` library it's not possible to have a source file name lib-led.c inside your project. To use the STM8S StdPeriph Library in your project you have to provide the path to the library source code. You may do this by calling `make` inside the contrib tree. But any external path is ok. In order to build the spl object file the build system has to call `make clean` inside the SPL_PATH so make sure there is no build inside which you still need. Also paralell builds of several projects using the same SPL_PATH is not possible. License ======= The spreadspace STM8 utils are licensed under GPLv3. You can find the full text of the license in the file LICENSE.