From 19539c3fd50d9e362a2b50dc61234ef2127b73fc Mon Sep 17 00:00:00 2001 From: Steve Karg Date: Sun, 17 Dec 2023 14:44:56 -0600 Subject: [PATCH] Add hex file output recipe to ports/stm32f4xx port --- ports/stm32f4xx/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ports/stm32f4xx/Makefile b/ports/stm32f4xx/Makefile index 606a66fc..19d7fc28 100644 --- a/ports/stm32f4xx/Makefile +++ b/ports/stm32f4xx/Makefile @@ -182,18 +182,20 @@ LDFLAGS = -nostartfiles LDFLAGS += -Wl,-nostdlib,-Map=$(TARGET).map,$(LIBRARIES),-T$(LDSCRIPT) # dead code removal LDFLAGS += -Wl,--gc-sections,-static -CPFLAGS = --output-target=binary ODFLAGS = -x --syms AOBJ = $(ASRC:.s=.o) COBJ = $(CSRC:.c=.o) -all: $(TARGET).bin $(TARGET).elf +all: $(TARGET).bin $(TARGET).hex $(TARGET).elf $(OBJDUMP) $(ODFLAGS) $(TARGET).elf > $(TARGET).dmp $(SIZE) $(TARGET).elf $(TARGET).bin: $(TARGET).elf - $(OBJCOPY) $(TARGET).elf $(CPFLAGS) $(TARGET).bin + $(OBJCOPY) $(TARGET).elf --output-target=binary $(TARGET).bin + +$(TARGET).hex: $(TARGET).elf + $(OBJCOPY) $(TARGET).elf --output-target=ihex $(TARGET).hex $(TARGET).elf: $(COBJ) $(AOBJ) Makefile $(CC) $(CFLAGS) $(AOBJ) $(COBJ) $(LDFLAGS) -o $@