aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-11-30 22:22:42 -0500
committerKevin O'Connor <kevin@koconnor.net>2018-11-30 22:22:42 -0500
commite505ab0df1cb4c31b171dde285fa4361d1e89df2 (patch)
tree1e1c4915e09baba6fe1d69f7af75d38ca8c4f513 /src
parentf2179da8adfaff9862f12982713b27150c9bd9d1 (diff)
downloadkutter-e505ab0df1cb4c31b171dde285fa4361d1e89df2.tar.gz
kutter-e505ab0df1cb4c31b171dde285fa4361d1e89df2.tar.xz
kutter-e505ab0df1cb4c31b171dde285fa4361d1e89df2.zip
samd21: Add support for flashing an application via the bossac tool
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r--src/samd21/Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/samd21/Makefile b/src/samd21/Makefile
index 34de8e48..abe21013 100644
--- a/src/samd21/Makefile
+++ b/src/samd21/Makefile
@@ -42,6 +42,12 @@ $(OUT)klipper.elf.hex: $(OUT)klipper.elf
@echo " Creating hex file $@"
$(Q)$(OBJCOPY) -j .text -j .relocate -O ihex $< $@
-flash: $(OUT)klipper.bin
- @echo ""
- @echo " The SAMD21 build does not currently support 'make flash'"
+# Flash rules
+lib/bossac/bin/bossac:
+ @echo " Building bossac"
+ $(Q)make -C lib/bossac bin/bossac
+
+flash: $(OUT)klipper.bin lib/bossac/bin/bossac
+ @echo " Flashing $^ to $(FLASH_DEVICE) via bossac"
+ $(Q)if [ -z $(FLASH_DEVICE) ]; then echo "Please specify FLASH_DEVICE"; exit 1; fi
+ $(Q)lib/bossac/bin/bossac -U -p "$(FLASH_DEVICE)" --offset=0x2000 -w $(OUT)klipper.bin -v -b -R