added .bin build (for flashing with dfu-util) to Makefile

This commit is contained in:
Eric Evenchick 2015-05-15 14:35:51 -04:00
parent d0b23b111b
commit 9d7bffe88c
1 changed files with 8 additions and 1 deletions

View File

@ -86,7 +86,11 @@ CFLAGS += -mcpu=$(CPU) -mthumb
CFLAGS += $(USER_CFLAGS)
# default action: build the user application
all: $(BUILD_DIR)/$(TARGET).hex
all: $(BUILD_DIR)/$(TARGET).bin $(BUILD_DIR)/$(TARGET).hex
flash: all
sudo dfu-util -d 0483:df11 -c 1 -i 0 -a 0 -s 0x08000000 -D $(BUILD_DIR)/$(TARGET).bin
#######################################
# build the st micro peripherial library
@ -148,6 +152,9 @@ LDFLAGS = -T $(LD_SCRIPT) -L $(CUBELIB_BUILD_DIR) -static $(LIBS) $(USER_LDFLAGS
$(BUILD_DIR)/$(TARGET).hex: $(BUILD_DIR)/$(TARGET).elf
$(OBJCOPY) -O ihex $(BUILD_DIR)/$(TARGET).elf $@
$(BUILD_DIR)/$(TARGET).bin: $(BUILD_DIR)/$(TARGET).elf
$(OBJCOPY) -O binary $(BUILD_DIR)/$(TARGET).elf $@
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) $(USB_OBJECTS) $(CUBELIB)
$(CC) -o $@ $(CFLAGS) $(OBJECTS) $(USB_OBJECTS) \
$(LDFLAGS) -Xlinker \