summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-03-18 11:16:59 -0700
committerKeith Packard <keithp@keithp.com>2016-03-18 11:16:59 -0700
commit4635203e9be530f53b697ac0349838916e146983 (patch)
tree3098c5975aa3c34df821fd216c0b6fee3cf9e478
parentf393482ec47e857db654fa071d4df95e98dab381 (diff)
altos/stmf0: Construct .bin files for flash loaders
This builds a .bin file which can be used with dfu-util instead of using openocd to load the initial flash loader. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/stmf0/Makefile-flash.defs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/stmf0/Makefile-flash.defs b/src/stmf0/Makefile-flash.defs
index 706b93ee..29d6ae45 100644
--- a/src/stmf0/Makefile-flash.defs
+++ b/src/stmf0/Makefile-flash.defs
@@ -39,17 +39,24 @@ LDFLAGS=$(CFLAGS) -L$(TOPDIR)/stmf0 -Wl,-Taltos-loader.ld
PROGNAME=altos-flash
PROG=$(HARDWARE)-$(PROGNAME)-$(VERSION).elf
+BIN=$(HARDWARE)-$(PROGNAME)-$(VERSION).bin
+
+MAKEBIN=$(TOPDIR)/../ao-tools/ao-makebin/ao-makebin
+FLASH_ADDR=0x08000000
+
+all: $(PROG) $(BIN)
$(PROG): Makefile $(OBJ) altos-loader.ld
$(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS)
+$(BIN): $(PROG)
+ $(MAKEBIN) --output=$@ --base=$(FLASH_ADDR) $(PROG)
+
ao_product.h: ao-make-product.5c $(TOPDIR)/Version
$(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
$(OBJ): $(INC)
-all: $(PROG)
-
distclean: clean
clean: