Add dfu-util command for programming

Also add .bin generation, which is needed for dfu-util.
This commit is contained in:
Fred Sundvik 2016-07-05 19:28:17 +03:00
parent b4cd0cfd15
commit f9a6e34c28
3 changed files with 12 additions and 1 deletions

View File

@ -10,6 +10,7 @@ AR = avr-ar rcs
NM = avr-nm NM = avr-nm
HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature
EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT)
BIN =

View File

@ -113,6 +113,7 @@ AR = arm-none-eabi-ar
NM = arm-none-eabi-nm NM = arm-none-eabi-nm
HEX = $(OBJCOPY) -O $(FORMAT) HEX = $(OBJCOPY) -O $(FORMAT)
EEP = EEP =
BIN = $(OBJCOPY) -O binary
THUMBFLAGS = -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB THUMBFLAGS = -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB
@ -151,4 +152,7 @@ else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
endif endif
# List any extra directories to look for libraries here. # List any extra directories to look for libraries here.
EXTRALIBDIRS = $(RULESPATH)/ld EXTRALIBDIRS = $(RULESPATH)/ld
dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter
dfu-util -D $(BUILD_DIR)/$(TARGET).bin

View File

@ -234,6 +234,7 @@ MSG_COFF = Converting to AVR COFF:
MSG_EXTENDED_COFF = Converting to AVR Extended COFF: MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
MSG_FLASH = Creating load file for Flash: MSG_FLASH = Creating load file for Flash:
MSG_EEPROM = Creating load file for EEPROM: MSG_EEPROM = Creating load file for EEPROM:
MSG_BIN = Creating binary load file for Flash:
MSG_EXTENDED_LISTING = Creating Extended Listing: MSG_EXTENDED_LISTING = Creating Extended Listing:
MSG_SYMBOL_TABLE = Creating Symbol Table: MSG_SYMBOL_TABLE = Creating Symbol Table:
MSG_LINKING = Linking: MSG_LINKING = Linking:
@ -369,6 +370,11 @@ gccversion :
$(eval CMD=$(NM) -n $< > $@ ) $(eval CMD=$(NM) -n $< > $@ )
@$(BUILD_CMD) @$(BUILD_CMD)
%.bin: %.elf
@$(SILENT) || printf "$(MSG_BIN) $@" | $(AWK_CMD)
$(eval CMD=$(BIN) $< $@ || exit 0)
@$(BUILD_CMD)
# Create library from object files. # Create library from object files.
.SECONDARY : $(BUILD_DIR)/$(TARGET).a .SECONDARY : $(BUILD_DIR)/$(TARGET).a
.PRECIOUS : $(OBJ) .PRECIOUS : $(OBJ)