summaryrefslogtreecommitdiff
path: root/examples/rules.mk
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-05-20 12:41:10 +0700
committerGitHub <[email protected]>2019-05-20 12:41:10 +0700
commitd825e0a8f1f4b3f8cbc10ceeeebee0380bbf3a3e (patch)
tree4d7719b1bac21aeccf4a0db5628aa344db8afef1 /examples/rules.mk
parente090cd2b6f0cc25109e84cb4d76806ebf45d3800 (diff)
parent6861b670fc0cf3e3c9e7c438c1f0a1410bfc6c8f (diff)
Merge pull request #70 from hathach/develop
add uf2 target for uf2 bootloader boards
Diffstat (limited to 'examples/rules.mk')
-rw-r--r--examples/rules.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/rules.mk b/examples/rules.mk
index c4b4471de..213d9a5a1 100644
--- a/examples/rules.mk
+++ b/examples/rules.mk
@@ -43,6 +43,8 @@ endif
.DEFAULT_GOAL := all
all: $(BUILD)/$(BOARD)-firmware.bin size
+uf2: $(BUILD)/$(BOARD)-firmware.uf2
+
OBJ_DIRS = $(sort $(dir $(OBJ)))
$(OBJ): | $(OBJ_DIRS)
$(OBJ_DIRS):
@@ -60,6 +62,11 @@ $(BUILD)/$(BOARD)-firmware.hex: $(BUILD)/$(BOARD)-firmware.elf
@echo CREATE $@
@$(OBJCOPY) -O ihex $^ $@
+UF2_FAMILY ?= 0x00
+$(BUILD)/$(BOARD)-firmware.uf2: $(BUILD)/$(BOARD)-firmware.hex
+ @echo CREATE $@
+ $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY) -c -o $@ $^
+
# We set vpath to point to the top of the tree so that the source files
# can be located. By following this scheme, it allows a single build rule
# to be used to compile all .c files.