]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - support/make/m16c62p/sm16cf.extra
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / support / make / m16c62p / sm16cf.extra
diff --git a/support/make/m16c62p/sm16cf.extra b/support/make/m16c62p/sm16cf.extra
new file mode 100755 (executable)
index 0000000..f83aa5f
--- /dev/null
@@ -0,0 +1,27 @@
+###
+ # @author Henrik Makitaavola <henrik.makitaavola@gmail.com>
+ ##
+
+ifeq ($(SM16CF), )
+#$(error SM16CF must be defined, try "make $(TARGETS) help")
+SM16CF = /dev/ttyUSB0
+endif
+
+PROGRAM = sm16cf
+PROGRAMMER = sm16cf
+
+ifdef BOOTLOADER
+  program: FORCE
+       @echo "    installing $(PLATFORM) with bootloader using sm16cf"
+       srec_cat $(BOOTLOADER_IMG) $(INSTALL_SREC) -exclude 0x000FFFDC 0x00100000 -o $(BUILDDIR)/main_boot.srec -CRLF
+       sed '/S5/d' $(BUILDDIR)/main_boot.srec > $(BUILDDIR)/main_boot2.srec
+       $(PROGRAMMER) --device=$(SM16CF) --input-file=$(BUILDDIR)/main_boot2.srec --flash-program
+       rm $(BUILDDIR)/main_boot.srec
+       rm $(BUILDDIR)/main_boot2.srec
+else
+program: FORCE
+       @echo "    installing $(PLATFORM) using sm16cf"
+       $(PROGRAMMER) --device=$(SM16CF) --input-file=$(INSTALL_SREC) --flash-program
+endif
+
+program_bl: FORCE