altos/easytimer-v2: Generate combined .ihx file for seeed testing
authorKeith Packard <keithp@keithp.com>
Mon, 4 Mar 2024 00:37:09 +0000 (16:37 -0800)
committerKeith Packard <keithp@keithp.com>
Mon, 4 Mar 2024 00:37:09 +0000 (16:37 -0800)
The test plan for seeed requires a combined loader and firmware image
for a single flashing step.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/easytimer-v2/Makefile

index 2298ab48c3be9a696f0f38b9bf11be0bf7cd0b7e..32b9117a7d0c170a9ea128bca1f3fb99462f2119 100644 (file)
@@ -71,17 +71,30 @@ CFLAGS = $(PRODUCT_DEF) $(SAMD21_CFLAGS) $(PROFILE_DEF) $(SAMPLE_PROFILE_DEF) $(
 PROGNAME=easytimer-v2
 PROG=$(PROGNAME)-$(VERSION).elf
 HEX=$(PROGNAME)-$(VERSION).ihx
+FLASH_PROG=flash-loader/$(PROGNAME)-altos-flash-$(VERSION).elf
+BOTH_HEX=$(PROGNAME)-combined-$(VERSION).ihx
+
+ELFTOHEX=$(TOPDIR)/../ao-tools/ao-elftohex/ao-elftohex
 
 SRC=$(ALTOS_SRC) ao_easytimer.c
 OBJ=$(SRC:.c=.o)
 
-all: $(PROG) $(HEX)
+all: $(PROG) $(HEX) $(BOTH_HEX)
 
 $(PROG): Makefile $(OBJ)
        $(call quiet,CC) $(LDFLAGS) -o $(PROG) $(OBJ) $(LIBS)
 
+$(BOTH_HEX): $(PROG) $(FLASH_PROG)
+       $(ELFTOHEX) --nosym --output=$@ $(FLASH_PROG) $(PROG)
+
 $(OBJ): $(INC)
 
+
+$(FLASH_PROG): FRC
+       +cd flash-loader && make
+
+FRC:
+
 distclean:     clean
 
 clean: