remove STM32duino-bootloader from Makefile
This commit is contained in:
parent
8e093acc93
commit
c526463e0a
33
Makefile
33
Makefile
|
@ -13,7 +13,7 @@
|
||||||
##
|
##
|
||||||
|
|
||||||
## the make file provide rule to compile and flash firmware for STM32F1 micro-controllers
|
## the make file provide rule to compile and flash firmware for STM32F1 micro-controllers
|
||||||
## it uses libopencm3 and STM32duino-bootloader
|
## it uses libopencm3
|
||||||
|
|
||||||
# be silent per default, but 'make V=1' will show all compiler calls.
|
# be silent per default, but 'make V=1' will show all compiler calls.
|
||||||
ifneq ($(V),1)
|
ifneq ($(V),1)
|
||||||
|
@ -117,23 +117,6 @@ OOCD_TARGET ?= stm32f1x
|
||||||
ACMPORT = /dev/ttyACM0
|
ACMPORT = /dev/ttyACM0
|
||||||
ACMPORT_EXISTS = $(shell [ -e $(ACMPORT) ] && echo 1 || echo 0 )
|
ACMPORT_EXISTS = $(shell [ -e $(ACMPORT) ] && echo 1 || echo 0 )
|
||||||
|
|
||||||
# board specific USB DFU bootloader
|
|
||||||
BOOTLOADERS = STM32duino-bootloader
|
|
||||||
ifeq ($(BOARD),SYSTEM_BOARD)
|
|
||||||
BOOTLOADER = $(BOOTLOADERS)/STM32F1/binaries/generic_boot20_pa1.bin
|
|
||||||
else ifeq ($(BOARD),BLUE_PILL)
|
|
||||||
BOOTLOADER = $(BOOTLOADERS)/STM32F1/binaries/generic_boot20_pc13.bin
|
|
||||||
else ifeq ($(BOARD),MAPLE_MINI)
|
|
||||||
BOOTLOADER = $(BOOTLOADERS)/STM32F1/binaries/maple_mini_boot20.bin
|
|
||||||
endif
|
|
||||||
|
|
||||||
# verify if STM32duino-bootloader has been downloaded
|
|
||||||
BOOTLOADER_EXISTS = $(shell [ -f $(BOOTLOADER) ] && echo 1 || echo 0 )
|
|
||||||
ifeq ($(BOOTLOADER_EXISTS), 0)
|
|
||||||
$(info run "git submodule init" and "git submodule update" before runnig make)
|
|
||||||
$(error STM32duino-bootloader repository is not initialized)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# compile target rules
|
# compile target rules
|
||||||
all: elf
|
all: elf
|
||||||
|
|
||||||
|
@ -178,13 +161,7 @@ $(LIB_DIR)/lib$(LIBNAME).a:
|
||||||
$(info compiling libopencm3 library)
|
$(info compiling libopencm3 library)
|
||||||
$(Q)$(MAKE) -C $(OPENCM3_DIR)
|
$(Q)$(MAKE) -C $(OPENCM3_DIR)
|
||||||
|
|
||||||
bootloader: $(BOOTLOADER)
|
flash: $(BINARY).hex
|
||||||
$(info flashing USB DFU bootloader $(<))
|
|
||||||
$(Q)$(OOCD) --file interface/$(OOCD_INTERFACE).cfg --file target/$(OOCD_TARGET).cfg --command "init" --command "reset init" --command "flash write_image erase $(<) 0x08000000" --command "reset" --command "shutdown" $(NULL)
|
|
||||||
|
|
||||||
flash: flash-dfu
|
|
||||||
|
|
||||||
flash-swd: $(BINARY).hex
|
|
||||||
$(info flashing $(<) using SWD)
|
$(info flashing $(<) using SWD)
|
||||||
$(Q)$(OOCD) --file interface/$(OOCD_INTERFACE).cfg --file target/$(OOCD_TARGET).cfg --command "init" --command "reset init" --command "flash write_image erase $(<)" --command "reset" --command "shutdown" $(NULL)
|
$(Q)$(OOCD) --file interface/$(OOCD_INTERFACE).cfg --file target/$(OOCD_TARGET).cfg --command "init" --command "reset init" --command "flash write_image erase $(<)" --command "reset" --command "shutdown" $(NULL)
|
||||||
|
|
||||||
|
@ -194,13 +171,9 @@ ifeq ($(ACMPORT_EXISTS), 1)
|
||||||
$(Q)stty --file $(ACMPORT) 115200 raw cs5
|
$(Q)stty --file $(ACMPORT) 115200 raw cs5
|
||||||
$(Q)sleep 0.5
|
$(Q)sleep 0.5
|
||||||
endif
|
endif
|
||||||
|
|
||||||
flash-dfu: $(BINARY).bin reset
|
|
||||||
$(info flashing $(<) using DFU)
|
|
||||||
$(Q)dfu-util --device 1eaf:0003 --cfg 1 --intf 0 --alt 2 --reset --download $(<) $(NULL)
|
|
||||||
|
|
||||||
# debug using jtag (openOCB+GDB)
|
# debug using jtag (openOCB+GDB)
|
||||||
debug: $(BINARY).elf
|
debug: $(BINARY).elf
|
||||||
$(Q)$(GDB) --eval-command="target remote | $(OOCD) --file interface/stlink-v2.cfg --file target/stm32f1x.cfg --command \"gdb_port pipe; log_output /dev/null; init\"" --eval-command="monitor reset halt" --eval-command="load" --eval-command="monitor reset init" $(<)
|
$(Q)$(GDB) --eval-command="target remote | $(OOCD) --file interface/stlink-v2.cfg --file target/stm32f1x.cfg --command \"gdb_port pipe; log_output /dev/null; init\"" --eval-command="monitor reset halt" --eval-command="load" --eval-command="monitor reset init" $(<)
|
||||||
|
|
||||||
.PHONY: clean elf bin hex srec list libraries bootloader $(BOOTLOADER) flash flash-swd reset flash-dfu
|
.PHONY: clean elf bin hex srec list libraries flash reset
|
||||||
|
|
Loading…
Reference in New Issue