mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
build: build opf images including firmware + version blob
This commit is contained in:
parent
ebca7f6bac
commit
6ec6425f5e
12
Makefile
12
Makefile
@ -321,7 +321,7 @@ BL_TARGETS := $(filter-out bl_ins, $(BL_TARGETS))
|
||||
BLUPD_TARGETS := $(filter-out blupd_ins, $(BLUPD_TARGETS))
|
||||
|
||||
.PHONY: all_fw all_fw_clean
|
||||
all_fw: $(addsuffix _bin, $(FW_TARGETS))
|
||||
all_fw: $(addsuffix _opf, $(FW_TARGETS))
|
||||
all_fw_clean: $(addsuffix _clean, $(FW_TARGETS))
|
||||
|
||||
.PHONY: all_bl all_bl_clean
|
||||
@ -337,7 +337,7 @@ all_flight: all_fw all_bl all_blupd
|
||||
all_flight_clean: all_fw_clean all_bl_clean all_blupd_clean
|
||||
|
||||
.PHONY: openpilot
|
||||
openpilot: openpilot_bin
|
||||
openpilot: openpilot_opf
|
||||
|
||||
openpilot_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/openpilot/dep
|
||||
@ -385,7 +385,7 @@ blupd_openpilot_clean:
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/blupd_openpilot
|
||||
|
||||
.PHONY: ahrs
|
||||
ahrs: ahrs_bin
|
||||
ahrs: ahrs_opf
|
||||
|
||||
ahrs_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/ahrs/dep
|
||||
@ -433,7 +433,7 @@ blupd_ahrs_clean:
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/blupd_ahrs
|
||||
|
||||
.PHONY: coptercontrol
|
||||
coptercontrol: coptercontrol_bin
|
||||
coptercontrol: coptercontrol_opf
|
||||
|
||||
coptercontrol_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/coptercontrol/dep
|
||||
@ -481,7 +481,7 @@ blupd_coptercontrol_clean:
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/blupd_coptercontrol
|
||||
|
||||
.PHONY: pipxtreme
|
||||
pipxtreme: pipxtreme_bin
|
||||
pipxtreme: pipxtreme_opf
|
||||
|
||||
pipxtreme_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/pipxtreme/dep
|
||||
@ -530,7 +530,7 @@ blupd_pipxtreme_clean:
|
||||
|
||||
|
||||
.PHONY: ins
|
||||
ins: ins_bin
|
||||
ins: ins_opf
|
||||
|
||||
ins_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/ins/dep
|
||||
|
@ -382,13 +382,16 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
$(eval $(call OPF_TEMPLATE,$(OUTDIR)/$(TARGET).bin,0x02,0x01))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino opf
|
||||
elf: $(OUTDIR)/$(TARGET).elf
|
||||
lss: $(OUTDIR)/$(TARGET).lss
|
||||
sym: $(OUTDIR)/$(TARGET).sym
|
||||
hex: $(OUTDIR)/$(TARGET).hex
|
||||
bin: $(OUTDIR)/$(TARGET).bin
|
||||
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||
opf: $(OUTDIR)/$(TARGET).opf
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
|
@ -576,13 +576,16 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
$(eval $(call OPF_TEMPLATE,$(OUTDIR)/$(TARGET).bin,0x04,0x01))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino opf
|
||||
elf: $(OUTDIR)/$(TARGET).elf
|
||||
lss: $(OUTDIR)/$(TARGET).lss
|
||||
sym: $(OUTDIR)/$(TARGET).sym
|
||||
hex: $(OUTDIR)/$(TARGET).hex
|
||||
bin: $(OUTDIR)/$(TARGET).bin
|
||||
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||
opf: $(OUTDIR)/$(TARGET).opf
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
|
@ -400,12 +400,18 @@ $(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC))
|
||||
# Compile: create assembler files from C source files. ARM only
|
||||
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
.PHONY: elf lss sym hex bin
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
$(eval $(call OPF_TEMPLATE,$(OUTDIR)/$(TARGET).bin,0x05,0x01))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino opf
|
||||
elf: $(OUTDIR)/$(TARGET).elf
|
||||
lss: $(OUTDIR)/$(TARGET).lss
|
||||
sym: $(OUTDIR)/$(TARGET).sym
|
||||
hex: $(OUTDIR)/$(TARGET).hex
|
||||
bin: $(OUTDIR)/$(TARGET).bin
|
||||
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||
opf: $(OUTDIR)/$(TARGET).opf
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
|
@ -556,13 +556,16 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
$(eval $(call OPF_TEMPLATE,$(OUTDIR)/$(TARGET).bin,0x01,0x01))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino opf
|
||||
elf: $(OUTDIR)/$(TARGET).elf
|
||||
lss: $(OUTDIR)/$(TARGET).lss
|
||||
sym: $(OUTDIR)/$(TARGET).sym
|
||||
hex: $(OUTDIR)/$(TARGET).hex
|
||||
bin: $(OUTDIR)/$(TARGET).bin
|
||||
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||
opf: $(OUTDIR)/$(TARGET).opf
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
|
@ -422,13 +422,16 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
$(eval $(call OPF_TEMPLATE,$(OUTDIR)/$(TARGET).bin,0x03,0x01))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino opf
|
||||
elf: $(OUTDIR)/$(TARGET).elf
|
||||
lss: $(OUTDIR)/$(TARGET).lss
|
||||
sym: $(OUTDIR)/$(TARGET).sym
|
||||
hex: $(OUTDIR)/$(TARGET).hex
|
||||
bin: $(OUTDIR)/$(TARGET).bin
|
||||
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||
opf: $(OUTDIR)/$(TARGET).opf
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
|
@ -45,6 +45,8 @@ MSG_ASMFROMC := ${quote} AS(C) ${quote}
|
||||
MSG_ASMFROMC_ARM := ${quote} AS(C)-ARM ${quote}
|
||||
MSG_PYMITEINIT := ${quote} PY ${quote}
|
||||
MSG_INSTALLING := ${quote} INSTALL ${quote}
|
||||
MSG_OPFIRMWARE := ${quote} OPF ${quote}
|
||||
MSG_FWDESC := ${quote} FWDESC ${quote}
|
||||
|
||||
toprel = $(subst $(realpath $(TOP))/,,$(abspath $(1)))
|
||||
|
||||
@ -68,6 +70,10 @@ gccversion :
|
||||
@echo $(MSG_LOAD_FILE) $(call toprel, $@)
|
||||
$(V1) $(OBJCOPY) -O binary $< $@
|
||||
|
||||
%.bin: %.o
|
||||
@echo $(MSG_LOAD_FILE) $(call toprel, $@)
|
||||
$(V1) $(OBJCOPY) -O binary $< $@
|
||||
|
||||
%.bin.o: %.bin
|
||||
@echo $(MSG_BIN_OBJ) $(call toprel, $@)
|
||||
$(V1) $(OBJCOPY) -I binary -O elf32-littlearm --binary-architecture arm \
|
||||
@ -96,6 +102,28 @@ $(1)_size: $(1)
|
||||
$(V1) $(SIZE) -A $$<
|
||||
endef
|
||||
|
||||
# OpenPilot firmware image template
|
||||
# $(1) = path to bin file
|
||||
# $(2) = boardtype in hex
|
||||
# $(3) = board revision in hex
|
||||
define OPF_TEMPLATE
|
||||
$(1).firmwareinfo.c: $(1) $(TOP)/make/templates/firmwareinfotemplate.c
|
||||
@echo $(MSG_FWDESC) $$(call toprel, $$@)
|
||||
$(V1) python $(TOP)/make/scripts/version-info.py \
|
||||
--path=$(TOP) \
|
||||
--template=$(TOP)/make/templates/firmwareinfotemplate.c \
|
||||
--outfile=$$@ \
|
||||
--image=$(1) \
|
||||
--type=$(2) \
|
||||
--revision=$(3)
|
||||
|
||||
$(eval $(call COMPILE_C_TEMPLATE, $(1).firmwareinfo.c))
|
||||
|
||||
$(OUTDIR)/$(notdir $(basename $(1))).opf : $(1) $(1).firmwareinfo.bin
|
||||
@echo $(MSG_OPFIRMWARE) $$(call toprel, $$@)
|
||||
$(V1) cat $(1) $(1).firmwareinfo.bin > $$@
|
||||
endef
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
define ASSEMBLE_TEMPLATE
|
||||
$(OUTDIR)/$(notdir $(basename $(1))).o : $(1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user