summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2017-08-27 21:40:39 +0200
committerChristian Pointner <equinox@spreadspace.org>2017-08-27 21:40:39 +0200
commit9f7d0606365abe9739a23fe148c481b7a22d5f3e (patch)
tree2de6cf667b2e50b5b3790c1466fa2fd74950d16a
parentfix redefinition of HSE_VALUE (diff)
added stm8-serial-flasher
-rw-r--r--contrib/Makefile9
-rw-r--r--defines.mk1
-rw-r--r--include.mk11
3 files changed, 20 insertions, 1 deletions
diff --git a/contrib/Makefile b/contrib/Makefile
index c87b2e8..8e94812 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -20,7 +20,7 @@
## along with spreadspace stm8 utils. If not, see <http://www.gnu.org/licenses/>.
##
-all: download-spl update-stm8flash
+all: download-spl update-stm8flash update-stm8_serial_flasher
doxygen := $(shell which doxygen)
download-spl: stsw-stm8069.zip
@@ -36,3 +36,10 @@ stsw-stm8069.zip:
update-stm8flash: .stm8flash.prepared
cd stm8flash; git pull; make
+
+.stm8_serial_flasher.prepared:
+ git clone https://github.com/gicking/STM8_serial_flasher.git
+ touch $@
+
+update-stm8_serial_flasher: .stm8_serial_flasher.prepared
+ cd STM8_serial_flasher; git pull; make
diff --git a/defines.mk b/defines.mk
index 7765add..e415df7 100644
--- a/defines.mk
+++ b/defines.mk
@@ -37,6 +37,7 @@ AR = sdar rcs
LIB_DIR = $(SPREADSTM8_PATH)/lib
stm8flash = $(SPREADSTM8_PATH)/contrib/stm8flash/stm8flash
+stm8_serial_flasher = $(SPREADSTM8_PATH)/contrib/STM8_serial_flasher/STM8_serial_flasher
## Options common to C compiler
CFLAGS = -mstm8
diff --git a/include.mk b/include.mk
index 05215ba..82141c5 100644
--- a/include.mk
+++ b/include.mk
@@ -141,6 +141,17 @@ endef
define stm8flash/run
endef
+### stm8_serial_flasher
+define stm8flash/erase
+endef
+
+define stm8flash/flash
+ $(stm8_serial_flasher) -p $(UPLOAD_PORT) -b $(UPLOAD_RATE) -w $1 -Q
+endef
+
+define stm8flash/run
+endef
+
### Program Targets
program: reset erase flash run