Merge branch 'master' of ssh://git.openpilot.org/OpenPilot into spektrum_rtc_supervisor
@ -162,6 +162,8 @@ D: Creator of the OpenPilot INS / EKF
|
||||
N: Oleg Semyonov
|
||||
E: os-openpilot-org (at) os-propo (dot) info
|
||||
D: Core tester & Project organisation
|
||||
M: Common part of multi-platform packaging system
|
||||
M: Windows NSIS Installer
|
||||
M: Russian Documentation Lead
|
||||
|
||||
N: Stacey Sheldon
|
||||
@ -201,4 +203,3 @@ M: Architecture co-lead
|
||||
N: Alex Vrubel
|
||||
E: alex (dot) vrubel (plus) openpilot (at) gmail (dot) com
|
||||
D: Russian translation of the GCS
|
||||
|
||||
|
@ -94,12 +94,9 @@ V: http://vimeo.com/22221798
|
||||
|
||||
M: First CopterControl flight on a Hexa
|
||||
C: Edouard Lafargue
|
||||
|
||||
D: March 2011
|
||||
|
||||
V: http://vimeo.com/21476466
|
||||
|
||||
|
||||
M: First CopterControl flight on a Tri
|
||||
C: Gary Mortimer and the Scorpion
|
||||
D: March 2011
|
||||
@ -111,21 +108,22 @@ D: May 2011
|
||||
V: http://www.vimeo.com/23637586
|
||||
|
||||
M: First CopterControl flight on a Flybarless Heli
|
||||
C: ?
|
||||
D: ?
|
||||
V:
|
||||
C: Oleg Semyonov (osnwt)
|
||||
D: May 2011
|
||||
V: http://www.youtube.com/watch?v=-J8cxqzxxWw
|
||||
|
||||
M: First V8 Octo OpenPilot flight
|
||||
C: Sami Korhonen (Sambas)
|
||||
D: May 2011
|
||||
V: http://vimeo.com/24258192
|
||||
|
||||
M: First Y6 CopterControl flight
|
||||
C: ?
|
||||
D: ?
|
||||
V:
|
||||
|
||||
|
||||
|
||||
An incomplete list of some future Milestones is below:
|
||||
|
||||
* First Y6 CopterControl flight
|
||||
* First Helicopter flight with OpenPilot
|
||||
* First Octo flight with OpenPilot
|
||||
* First successful flight using the GCS only and no RC TX
|
||||
* First use of Magic Waypoint
|
||||
* First Flybarless Helicopter flight with OpenPilot
|
||||
|
374
Makefile
@ -77,19 +77,24 @@ help:
|
||||
@echo " all_flight - Build all firmware, bootloaders and bootloader updaters"
|
||||
@echo " all_fw - Build only firmware for all boards"
|
||||
@echo " all_bl - Build only bootloaders for all boards"
|
||||
@echo " all_blupd - Build only bootloader updaters for all boards"
|
||||
@echo " all_bu - Build only bootloader updaters for all boards"
|
||||
@echo
|
||||
@echo " all_clean - Remove your build directory ($(BUILD_DIR))"
|
||||
@echo " all_flight_clean - Remove all firmware, bootloaders and bootloader updaters"
|
||||
@echo " all_fw_clean - Remove firmware for all boards"
|
||||
@echo " all_bl_clean - Remove bootlaoders for all boards"
|
||||
@echo " all_blupd_clean - Remove bootloader updaters for all boards"
|
||||
@echo " all_bu_clean - Remove bootloader updaters for all boards"
|
||||
@echo
|
||||
@echo " all_<board> - Build all available images for <board>"
|
||||
@echo " all_<board>_clean - Remove all available images for <board>"
|
||||
@echo
|
||||
@echo " [Firmware]"
|
||||
@echo " <board> - Build firmware for <board>"
|
||||
@echo " supported boards are ($(ALL_BOARDS))"
|
||||
@echo " fw_<board> - Build firmware for <board>"
|
||||
@echo " supported boards are ($(FW_TARGETS))"
|
||||
@echo " <board>_clean - Remove firmware for <board>"
|
||||
@echo " <board>_program - Use OpenOCD + JTAG to write firmware to <board>"
|
||||
@echo " fw_<board>_clean - Remove firmware for <board>"
|
||||
@echo " fw_<board>_program - Use OpenOCD + JTAG to write firmware to <board>"
|
||||
@echo
|
||||
@echo " [Bootloader]"
|
||||
@echo " bl_<board> - Build bootloader for <board>"
|
||||
@ -98,9 +103,9 @@ help:
|
||||
@echo " bl_<board>_program - Use OpenOCD + JTAG to write bootloader to <board>"
|
||||
@echo
|
||||
@echo " [Bootloader Updater]"
|
||||
@echo " blupd_<board> - Build bootloader updater for <board>"
|
||||
@echo " supported boards are ($(BLUPD_TARGETS))"
|
||||
@echo " blupd_<board>_clean - Remove bootloader updater for <board>"
|
||||
@echo " bu_<board> - Build bootloader updater for <board>"
|
||||
@echo " supported boards are ($(BU_TARGETS))"
|
||||
@echo " bu_<board>_clean - Remove bootloader updater for <board>"
|
||||
@echo
|
||||
@echo " [Simulation]"
|
||||
@echo " sim_posix - Build OpenPilot simulation firmware for"
|
||||
@ -270,18 +275,6 @@ openpilotgcs: uavobjects_gcs
|
||||
$(MAKE) -w ; \
|
||||
)
|
||||
|
||||
.PHONY: gcs_installer
|
||||
gcs_installer: openpilotgcs
|
||||
ifeq ($(QT_SPEC), win32-g++)
|
||||
ifeq ($(GCS_BUILD_CONF), release)
|
||||
$(V1) cd $(BUILD_DIR)/ground/openpilotgcs/packaging/winx86 && $(MAKE) -r --no-print-directory $@
|
||||
else
|
||||
$(error $@ can be generated for release build only (GCS_BUILD_CONF=release))
|
||||
endif
|
||||
else
|
||||
$(error $@ is currently only available on Windows)
|
||||
endif
|
||||
|
||||
.PHONY: openpilotgcs_clean
|
||||
openpilotgcs_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
@ -323,254 +316,128 @@ uavobjects_clean:
|
||||
#
|
||||
##############################
|
||||
|
||||
FW_TARGETS := openpilot ahrs coptercontrol pipxtreme ins
|
||||
BL_TARGETS := $(addprefix bl_, $(FW_TARGETS))
|
||||
BLUPD_TARGETS := $(addprefix blupd_, $(FW_TARGETS))
|
||||
# $(1) = Canonical board name all in lower case (e.g. coptercontrol)
|
||||
# $(2) = Name of board used in source tree (e.g. CopterControl)
|
||||
define FW_TEMPLATE
|
||||
.PHONY: $(1) fw_$(1)
|
||||
$(1): fw_$(1)_opfw
|
||||
fw_$(1): fw_$(1)_opfw
|
||||
|
||||
fw_$(1)_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/fw_$(1)/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/$(2) && \
|
||||
$$(MAKE) -r --no-print-directory \
|
||||
BOARD_NAME=$(1) \
|
||||
TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
||||
$$*
|
||||
|
||||
.PHONY: $(1)_clean
|
||||
$(1)_clean: fw_$(1)_clean
|
||||
fw_$(1)_clean:
|
||||
$(V0) @echo " CLEAN $$@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/fw_$(1)
|
||||
endef
|
||||
|
||||
# $(1) = Canonical board name all in lower case (e.g. coptercontrol)
|
||||
# $(2) = Name of board used in source tree (e.g. CopterControl)
|
||||
define BL_TEMPLATE
|
||||
.PHONY: bl_$(1)
|
||||
bl_$(1): bl_$(1)_bin
|
||||
bl_$(1)_bino: bl_$(1)_bin
|
||||
|
||||
bl_$(1)_%:
|
||||
$(V1) mkdir -p $(BUILD_DIR)/bl_$(1)/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/$(2) && \
|
||||
$$(MAKE) -r --no-print-directory \
|
||||
BOARD_NAME=$(1) \
|
||||
TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
||||
$$*
|
||||
|
||||
.PHONY: bl_$(1)_clean
|
||||
bl_$(1)_clean:
|
||||
$(V0) @echo " CLEAN $$@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/bl_$(1)
|
||||
endef
|
||||
|
||||
# $(1) = Canonical board name all in lower case (e.g. coptercontrol)
|
||||
define BU_TEMPLATE
|
||||
.PHONY: bu_$(1)
|
||||
bu_$(1): bu_$(1)_opfw
|
||||
|
||||
bu_$(1)_%: bl_$(1)_bino
|
||||
$(V1) mkdir -p $(BUILD_DIR)/bu_$(1)/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \
|
||||
$$(MAKE) -r --no-print-directory \
|
||||
BOARD_NAME=$(1) \
|
||||
TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
||||
$$*
|
||||
|
||||
.PHONY: bu_$(1)_clean
|
||||
bu_$(1)_clean:
|
||||
$(V0) @echo " CLEAN $$@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/bu_$(1)
|
||||
endef
|
||||
|
||||
# $(1) = Canonical board name all in lower case (e.g. coptercontrol)
|
||||
define BOARD_PHONY_TEMPLATE
|
||||
.PHONY: all_$(1)
|
||||
all_$(1): $$(filter fw_$(1), $$(FW_TARGETS))
|
||||
all_$(1): $$(filter bl_$(1), $$(BL_TARGETS))
|
||||
all_$(1): $$(filter bu_$(1), $$(BU_TARGETS))
|
||||
|
||||
.PHONY: all_$(1)_clean
|
||||
all_$(1)_clean: $$(addsuffix _clean, $$(filter fw_$(1), $$(FW_TARGETS)))
|
||||
all_$(1)_clean: $$(addsuffix _clean, $$(filter bl_$(1), $$(BL_TARGETS)))
|
||||
all_$(1)_clean: $$(addsuffix _clean, $$(filter bu_$(1), $$(BU_TARGETS)))
|
||||
endef
|
||||
|
||||
ALL_BOARDS := openpilot ahrs coptercontrol pipxtreme ins
|
||||
|
||||
# Friendly names of each board (used to find source tree)
|
||||
openpilot_friendly := OpenPilot
|
||||
coptercontrol_friendly := CopterControl
|
||||
pipxtreme_friendly := PipXtreme
|
||||
ins_friendly := INS
|
||||
ahrs_friendly := AHRS
|
||||
|
||||
FW_TARGETS := $(addprefix fw_, $(ALL_BOARDS))
|
||||
BL_TARGETS := $(addprefix bl_, $(ALL_BOARDS))
|
||||
BU_TARGETS := $(addprefix bu_, $(ALL_BOARDS))
|
||||
|
||||
# FIXME: The INS build doesn't have a bootloader or bootloader
|
||||
# updater yet so we need to filter them out to prevent errors.
|
||||
BL_TARGETS := $(filter-out bl_ins, $(BL_TARGETS))
|
||||
BLUPD_TARGETS := $(filter-out blupd_ins, $(BLUPD_TARGETS))
|
||||
BU_TARGETS := $(filter-out bu_ins, $(BU_TARGETS))
|
||||
|
||||
.PHONY: all_fw all_fw_clean
|
||||
all_fw: $(addsuffix _bin, $(FW_TARGETS))
|
||||
all_fw: $(addsuffix _opfw, $(FW_TARGETS))
|
||||
all_fw_clean: $(addsuffix _clean, $(FW_TARGETS))
|
||||
|
||||
.PHONY: all_bl all_bl_clean
|
||||
all_bl: $(addsuffix _bin, $(BL_TARGETS))
|
||||
all_bl_clean: $(addsuffix _clean, $(BL_TARGETS))
|
||||
|
||||
.PHONY: all_blupd all_blupd_clean
|
||||
all_blupd: $(addsuffix _bin, $(BLUPD_TARGETS))
|
||||
all_blupd_clean: $(addsuffix _clean, $(BLUPD_TARGETS))
|
||||
.PHONY: all_bu all_bu_clean
|
||||
all_bu: $(addsuffix _opfw, $(BU_TARGETS))
|
||||
all_bu_clean: $(addsuffix _clean, $(BU_TARGETS))
|
||||
|
||||
.PHONY: all_flight all_flight_clean
|
||||
all_flight: all_fw all_bl all_blupd
|
||||
all_flight_clean: all_fw_clean all_bl_clean all_blupd_clean
|
||||
all_flight: all_fw all_bl all_bu
|
||||
all_flight_clean: all_fw_clean all_bl_clean all_bu_clean
|
||||
|
||||
.PHONY: openpilot
|
||||
openpilot: openpilot_bin
|
||||
$(foreach board, $(ALL_BOARDS), $(eval $(call BOARD_PHONY_TEMPLATE,$(board))))
|
||||
|
||||
openpilot_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/openpilot/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/OpenPilot && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/openpilot" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||
# Expand the bootloader updater rules
|
||||
$(foreach board, $(ALL_BOARDS), $(eval $(call BU_TEMPLATE,$(board),$($(board)_friendly))))
|
||||
|
||||
.PHONY: openpilot_clean
|
||||
openpilot_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/openpilot
|
||||
|
||||
.PHONY: bl_openpilot
|
||||
bl_openpilot: bl_openpilot_bin
|
||||
bl_openpilot_bino: bl_openpilot_bin
|
||||
|
||||
bl_openpilot_%:
|
||||
$(V1) mkdir -p $(BUILD_DIR)/bl_openpilot/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/OpenPilot && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/bl_openpilot" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||
|
||||
.PHONY: bl_openpilot_clean
|
||||
bl_openpilot_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/bl_openpilot
|
||||
|
||||
.PHONY: blupd_openpilot
|
||||
blupd_openpilot: blupd_openpilot_bin
|
||||
|
||||
blupd_openpilot_%: bl_openpilot_bino
|
||||
$(V1) mkdir -p $(BUILD_DIR)/blupd_openpilot/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/blupd_openpilot" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
||||
BOARD=STM3210E_OP MODEL=HD MODEL_SUFFIX=_OP \
|
||||
BLOBJ=$(BUILD_DIR)/bl_openpilot/OpenPilot_BL.bin.o $*
|
||||
|
||||
.PHONY: blupd_openpilot_clean
|
||||
blupd_openpilot_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/blupd_openpilot
|
||||
|
||||
.PHONY: ahrs
|
||||
ahrs: ahrs_bin
|
||||
|
||||
ahrs_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/ahrs/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/AHRS && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/ahrs" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||
|
||||
.PHONY: ahrs_clean
|
||||
ahrs_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/ahrs
|
||||
|
||||
.PHONY: bl_ahrs
|
||||
bl_ahrs: bl_ahrs_bin
|
||||
bl_ahrs_bino: bl_ahrs_bin
|
||||
|
||||
bl_ahrs_%:
|
||||
$(V1) mkdir -p $(BUILD_DIR)/bl_ahrs/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/AHRS && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/bl_ahrs" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||
|
||||
.PHONY: bl_ahrs_clean
|
||||
bl_ahrs_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/bl_ahrs
|
||||
|
||||
.PHONY: blupd_ahrs
|
||||
blupd_ahrs: blupd_ahrs_bin
|
||||
|
||||
blupd_ahrs_%: bl_ahrs_bino bl_ahrs
|
||||
$(V1) mkdir -p $(BUILD_DIR)/blupd_ahrs/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/blupd_ahrs" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
||||
BOARD=STM32103CB_AHRS MODEL=MD \
|
||||
BLOBJ=$(BUILD_DIR)/bl_ahrs/AHRS_BL.bin.o $*
|
||||
|
||||
.PHONY: blupd_ahrs_clean
|
||||
blupd_ahrs_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/blupd_ahrs
|
||||
|
||||
.PHONY: coptercontrol
|
||||
coptercontrol: coptercontrol_bin
|
||||
|
||||
coptercontrol_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/coptercontrol/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/CopterControl && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/coptercontrol" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||
|
||||
.PHONY: coptercontrol_clean
|
||||
coptercontrol_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/coptercontrol
|
||||
|
||||
.PHONY: bl_coptercontrol
|
||||
bl_coptercontrol: bl_coptercontrol_bin
|
||||
bl_coptercontrol_bino: bl_coptercontrol_bin
|
||||
|
||||
bl_coptercontrol_%:
|
||||
$(V1) mkdir -p $(BUILD_DIR)/bl_coptercontrol/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/CopterControl && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/bl_coptercontrol" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||
|
||||
.PHONY: bl_coptercontrol_clean
|
||||
bl_coptercontrol_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/bl_coptercontrol
|
||||
|
||||
.PHONY: blupd_coptercontrol
|
||||
blupd_coptercontrol: blupd_coptercontrol_bin
|
||||
|
||||
blupd_coptercontrol_%: bl_coptercontrol_bino
|
||||
$(V1) mkdir -p $(BUILD_DIR)/blupd_coptercontrol/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/blupd_coptercontrol" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
||||
BOARD=STM32103CB_CC_Rev1 MODEL=MD MODEL_SUFFIX=_CC \
|
||||
BLOBJ=$(BUILD_DIR)/bl_coptercontrol/CopterControl_BL.bin.o $*
|
||||
|
||||
.PHONY: blupd_coptercontrol_clean
|
||||
blupd_coptercontrol_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/blupd_coptercontrol
|
||||
|
||||
.PHONY: pipxtreme
|
||||
pipxtreme: pipxtreme_bin
|
||||
|
||||
pipxtreme_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/pipxtreme/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/PipXtreme && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/pipxtreme" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||
|
||||
.PHONY: pipxtreme_clean
|
||||
pipxtreme_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/pipxtreme
|
||||
|
||||
.PHONY: bl_pipxtreme
|
||||
bl_pipxtreme: bl_pipxtreme_bin
|
||||
bl_pipxtreme_bino: bl_pipxtreme_bin
|
||||
|
||||
bl_pipxtreme_%:
|
||||
$(V1) mkdir -p $(BUILD_DIR)/bl_pipxtreme/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/PipXtreme && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/bl_pipxtreme" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||
|
||||
.PHONY: bl_pipxtreme_clean
|
||||
bl_pipxtreme_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/bl_pipxtreme
|
||||
|
||||
.PHONY: blupd_pipxtreme
|
||||
blupd_pipxtreme: blupd_pipxtreme_bin
|
||||
|
||||
blupd_pipxtreme_%: bl_pipxtreme_bino
|
||||
$(V1) mkdir -p $(BUILD_DIR)/blupd_pipxtreme/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/BootloaderUpdater && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/blupd_pipxtreme" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
||||
BOARD=STM32103CB_PIPXTREME MODEL=MD MODEL_SUFFIX=_CC \
|
||||
BLOBJ=$(BUILD_DIR)/bl_pipxtreme/PipXtreme_BL.bin.o $*
|
||||
|
||||
.PHONY: blupd_pipxtreme_clean
|
||||
blupd_pipxtreme_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/blupd_pipxtreme
|
||||
|
||||
|
||||
.PHONY: ins
|
||||
ins: ins_bin
|
||||
|
||||
ins_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/ins/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/INS && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/ins" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||
|
||||
.PHONY: ins_clean
|
||||
ins_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/ins
|
||||
|
||||
.PHONY: bl_ins
|
||||
bl_ins: bl_ins_elf
|
||||
|
||||
bl_ins_%:
|
||||
$(V1) mkdir -p $(BUILD_DIR)/bl_ins/dep
|
||||
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/INS && \
|
||||
$(MAKE) -r --no-print-directory \
|
||||
OUTDIR="$(BUILD_DIR)/bl_ins" TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
||||
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" $*
|
||||
|
||||
.PHONY: bl_ins_clean
|
||||
bl_ins_clean:
|
||||
$(V0) @echo " CLEAN $@"
|
||||
$(V1) $(RM) -fr $(BUILD_DIR)/bl_ins
|
||||
# Expand the firmware rules
|
||||
$(foreach board, $(ALL_BOARDS), $(eval $(call FW_TEMPLATE,$(board),$($(board)_friendly))))
|
||||
|
||||
# Expand the bootloader rules
|
||||
$(foreach board, $(ALL_BOARDS), $(eval $(call BL_TEMPLATE,$(board),$($(board)_friendly))))
|
||||
|
||||
.PHONY: sim_posix
|
||||
sim_posix: sim_posix_elf
|
||||
@ -587,3 +454,12 @@ sim_win32_%: uavobjects_flight
|
||||
$(V1) mkdir -p $(BUILD_DIR)/sitl_win32
|
||||
$(V1) $(MAKE) --no-print-directory \
|
||||
-C $(ROOT_DIR)/flight/OpenPilot --file=$(ROOT_DIR)/flight/OpenPilot/Makefile.win32 $*
|
||||
|
||||
##############################
|
||||
#
|
||||
# Packaging components
|
||||
#
|
||||
##############################
|
||||
.PHONY: package
|
||||
package:
|
||||
$(V1) cd $@ && $(MAKE) --no-print-directory $@
|
||||
|
@ -16,5 +16,7 @@ Symbols:
|
||||
|
||||
Capital A = OpenPilot Logo
|
||||
Capital B = CC-BY-SA
|
||||
Capital B = CC-BY-NC-SA
|
||||
Capital D = RoHS
|
||||
|
||||
|
Before Width: | Height: | Size: 436 KiB After Width: | Height: | Size: 438 KiB |
@ -25,6 +25,13 @@
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
TOP := $(realpath $(WHEREAMI)/../../)
|
||||
include $(TOP)/make/firmware-defs.mk
|
||||
include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET := fw_$(BOARD_NAME)
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR := $(TOP)/build/$(TARGET)
|
||||
|
||||
# Set developer code and compile options
|
||||
# Set to YES for debugging
|
||||
@ -41,21 +48,6 @@ endif
|
||||
|
||||
FLASH_TOOL = OPENOCD
|
||||
|
||||
# MCU name, submodel and board
|
||||
# - MCU used for compiler-option (-mcpu)
|
||||
# - MODEL used for linker-script name (-T) and passed as define
|
||||
# - BOARD just passed as define (optional)
|
||||
MCU = cortex-m3
|
||||
CHIP = STM32F103CBT
|
||||
BOARD = STM32103CB_AHRS
|
||||
MODEL = MD
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR = $(TOP)/build/ahrs
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = AHRS
|
||||
|
||||
# Paths
|
||||
AHRS = ./
|
||||
AHRSINC = $(AHRS)/inc
|
||||
@ -160,7 +152,7 @@ CPPSRCARM =
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
|
||||
|
||||
# List Assembler source files here which must be assembled in ARM-Mode..
|
||||
ASRCARM =
|
||||
@ -223,7 +215,6 @@ CDEFS = -DSTM32F10X_$(MODEL)
|
||||
CDEFS += -DUSE_STDPERIPH_DRIVER
|
||||
CDEFS += -DUSE_$(BOARD)
|
||||
CDEFS += -DIN_AHRS
|
||||
CDEFS += -DUSE_BOOTLOADER
|
||||
|
||||
# Place project-specific -D and/or -U options for
|
||||
# Assembler with preprocessor here.
|
||||
@ -299,21 +290,8 @@ LDFLAGS += -lc -lgcc
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld
|
||||
|
||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||
# Program
|
||||
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08002000 bin"
|
||||
# Verify
|
||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08002000 bin"
|
||||
# reset target
|
||||
OOCD_CL+=-c "reset run"
|
||||
# terminate OOCD after programming
|
||||
OOCD_CL+=-c shutdown
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
REMOVE = $(REMOVE_CMD) -f
|
||||
###SHELL = sh
|
||||
###COPY = cp
|
||||
|
||||
# List of all source files.
|
||||
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
|
||||
@ -345,14 +323,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Program the device.
|
||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||
program: $(OUTDIR)/$(TARGET).bin
|
||||
@echo ${quote}Programming with OPENOCD${quote}
|
||||
$(OOCD_EXE) $(OOCD_CL)
|
||||
endif
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||
|
||||
@ -382,29 +352,33 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION)))
|
||||
|
||||
# Add jtag targets (program and wipe)
|
||||
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE)))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino opfw
|
||||
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
|
||||
opfw: $(OUTDIR)/$(TARGET).opfw
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
.PHONY: size
|
||||
size: $(OUTDIR)/$(TARGET).elf_size
|
||||
|
||||
# Generate Doxygen documents
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
install: $(OUTDIR)/$(TARGET).opfw
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opfw
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
@ -445,4 +419,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program install
|
||||
.PHONY : all build clean clean_list install
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
/* OpenPilot Includes */
|
||||
#include "ahrs.h"
|
||||
#include <pios_board_info.h>
|
||||
#include "pios.h"
|
||||
#include "ahrs_timer.h"
|
||||
#include "ahrs_spi_comm.h"
|
||||
@ -1228,6 +1229,8 @@ void homelocation_callback(AhrsObjHandle obj)
|
||||
|
||||
void firmwareiapobj_callback(AhrsObjHandle obj)
|
||||
{
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
|
||||
FirmwareIAPObjData firmwareIAPObj;
|
||||
FirmwareIAPObjGet(&firmwareIAPObj);
|
||||
if(firmwareIAPObj.ArmReset==0)
|
||||
@ -1235,7 +1238,7 @@ void firmwareiapobj_callback(AhrsObjHandle obj)
|
||||
if(firmwareIAPObj.ArmReset==1)
|
||||
{
|
||||
|
||||
if((firmwareIAPObj.BoardType==BOARD_TYPE) || (firmwareIAPObj.BoardType==0xFF))
|
||||
if((firmwareIAPObj.BoardType==bdinfo->board_type) || (firmwareIAPObj.BoardType==0xFF))
|
||||
{
|
||||
|
||||
++reset_count;
|
||||
@ -1247,11 +1250,11 @@ void firmwareiapobj_callback(AhrsObjHandle obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(firmwareIAPObj.BoardType==BOARD_TYPE && firmwareIAPObj.crc!=PIOS_BL_HELPER_CRC_Memory_Calc())
|
||||
else if(firmwareIAPObj.BoardType==bdinfo->board_type && firmwareIAPObj.crc!=PIOS_BL_HELPER_CRC_Memory_Calc())
|
||||
{
|
||||
PIOS_BL_HELPER_FLASH_Read_Description(firmwareIAPObj.Description,SIZE_OF_DESCRIPTION);
|
||||
PIOS_BL_HELPER_FLASH_Read_Description(firmwareIAPObj.Description,bdinfo->desc_size);
|
||||
firmwareIAPObj.crc=PIOS_BL_HELPER_CRC_Memory_Calc();
|
||||
firmwareIAPObj.BoardRevision=BOARD_REVISION;
|
||||
firmwareIAPObj.BoardRevision=bdinfo->board_rev;
|
||||
FirmwareIAPObjSet(&firmwareIAPObj);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,13 @@
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
TOP := $(realpath $(WHEREAMI)/../../../)
|
||||
include $(TOP)/make/firmware-defs.mk
|
||||
include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET := bl_$(BOARD_NAME)
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR := $(TOP)/build/$(TARGET)
|
||||
|
||||
# Set developer code and compile options
|
||||
# Set to YES for debugging
|
||||
@ -41,23 +48,6 @@ endif
|
||||
|
||||
FLASH_TOOL = OPENOCD
|
||||
|
||||
# MCU name, submodel and board
|
||||
# - MCU used for compiler-option (-mcpu)
|
||||
# - MODEL used for linker-script name (-T) and passed as define
|
||||
# - BOARD just passed as define (optional)
|
||||
MCU = cortex-m3
|
||||
CHIP = STM32F103CBT
|
||||
BOARD = STM32103CB_AHRS
|
||||
MODEL = MD
|
||||
|
||||
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR = $(TOP)/build/bl_ahrs
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = AHRS_BL
|
||||
|
||||
# Paths
|
||||
AHRS_BL = ./
|
||||
AHRS_BLINC = $(AHRS_BL)/inc
|
||||
@ -100,6 +90,7 @@ SRC += $(PIOSSTM32F10X)/pios_spi.c
|
||||
## PIOS Hardware (Common)
|
||||
#SRC += $(PIOSCOMMON)/pios_com.c
|
||||
#SRC += $(PIOSCOMMON)/pios_hmc5843.c
|
||||
SRC += $(PIOSCOMMON)/pios_board_info.c
|
||||
SRC += $(PIOSCOMMON)/pios_opahrs_proto.c
|
||||
SRC += $(PIOSCOMMON)/printf-stdarg.c
|
||||
SRC += $(PIOSCOMMON)/pios_bl_helper.c
|
||||
@ -148,7 +139,7 @@ CPPSRCARM =
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
|
||||
|
||||
# List Assembler source files here which must be assembled in ARM-Mode..
|
||||
ASRCARM =
|
||||
@ -208,6 +199,15 @@ CDEFS = -DSTM32F10X_$(MODEL)
|
||||
CDEFS += -DUSE_STDPERIPH_DRIVER
|
||||
CDEFS += -DUSE_$(BOARD)
|
||||
|
||||
# Provide (only) the bootloader with board-specific defines
|
||||
BLONLY_CDEFS += -DBOARD_TYPE=$(BOARD_TYPE)
|
||||
BLONLY_CDEFS += -DBOARD_REVISION=$(BOARD_REVISION)
|
||||
BLONLY_CDEFS += -DHW_TYPE=$(HW_TYPE)
|
||||
BLONLY_CDEFS += -DBOOTLOADER_VERSION=$(BOOTLOADER_VERSION)
|
||||
BLONLY_CDEFS += -DFW_BANK_BASE=$(FW_BANK_BASE)
|
||||
BLONLY_CDEFS += -DFW_BANK_SIZE=$(FW_BANK_SIZE)
|
||||
BLONLY_CDEFS += -DFW_DESC_SIZE=$(FW_DESC_SIZE)
|
||||
|
||||
# Place project-specific -D and/or -U options for
|
||||
# Assembler with preprocessor here.
|
||||
#ADEFS = -DUSE_IRQ_ASM_WRAPPER
|
||||
@ -242,8 +242,9 @@ CFLAGS += -O$(OPT)
|
||||
ifeq ($(DEBUG),NO)
|
||||
CFLAGS += -fdata-sections -ffunction-sections
|
||||
endif
|
||||
CFLAGS += -mcpu=$(MCU) -mthumb
|
||||
CFLAGS += -mcpu=$(MCU)
|
||||
CFLAGS += $(CDEFS)
|
||||
CFLAGS += $(BLONLY_CDEFS)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -I.
|
||||
|
||||
CFLAGS += -mapcs-frame
|
||||
@ -265,7 +266,7 @@ CONLYFLAGS += $(CSTANDARD)
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlns: create listing
|
||||
ASFLAGS = -mcpu=$(MCU) -mthumb -I. -x assembler-with-cpp
|
||||
ASFLAGS = -mcpu=$(MCU) -I. -x assembler-with-cpp
|
||||
ASFLAGS += $(ADEFS)
|
||||
ASFLAGS += -Wa,-adhlns=$(addprefix $(OUTDIR)/, $(notdir $(addsuffix .lst, $(basename $<))))
|
||||
ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
@ -290,20 +291,8 @@ LDFLAGS += -lc -lgcc
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld
|
||||
|
||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||
# Program
|
||||
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin"
|
||||
# Verify
|
||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin"
|
||||
# reset target
|
||||
OOCD_CL+=-c "reset run"
|
||||
# terminate OOCD after programming
|
||||
OOCD_CL+=-c shutdown
|
||||
|
||||
# Define programs and commands.
|
||||
REMOVE = $(REMOVE_CMD) -f
|
||||
###SHELL = sh
|
||||
###COPY = cp
|
||||
|
||||
# List of all source files.
|
||||
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
|
||||
@ -335,14 +324,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Program the device.
|
||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||
program: $(OUTDIR)/$(TARGET).bin
|
||||
@echo "Programming with OPENOCD"
|
||||
$(OOCD_EXE) $(OOCD_CL)
|
||||
endif
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||
|
||||
@ -372,6 +353,9 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
# Add jtag targets (program and wipe)
|
||||
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE)))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
elf: $(OUTDIR)/$(TARGET).elf
|
||||
lss: $(OUTDIR)/$(TARGET).lss
|
||||
@ -382,8 +366,6 @@ bino: $(OUTDIR)/$(TARGET).bin.o
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
.PHONY: size
|
||||
size: $(OUTDIR)/$(TARGET).elf_size
|
||||
|
||||
# Generate Doxygen documents
|
||||
docs:
|
||||
@ -436,4 +418,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program install
|
||||
.PHONY : all build clean clean_list install
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
/* OpenPilot Includes */
|
||||
#include "ahrs_bl.h"
|
||||
#include <pios_board_info.h>
|
||||
#include "pios_opahrs_proto.h"
|
||||
#include "bl_fsm.h" /* lfsm_state */
|
||||
#include "stm32f10x_flash.h"
|
||||
@ -108,6 +109,7 @@ static struct opahrs_msg_v0 link_rx_v0;
|
||||
static struct opahrs_msg_v0 user_tx_v0;
|
||||
static struct opahrs_msg_v0 user_rx_v0;
|
||||
void process_spi_request(void) {
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
bool msg_to_process = FALSE;
|
||||
|
||||
PIOS_IRQ_Disable();
|
||||
@ -166,15 +168,15 @@ void process_spi_request(void) {
|
||||
break;
|
||||
case OPAHRS_MSG_V0_REQ_MEM_MAP:
|
||||
opahrs_msg_v0_init_user_tx(&user_tx_v0, OPAHRS_MSG_V0_RSP_MEM_MAP);
|
||||
user_tx_v0.payload.user.v.rsp.mem_map.density = HW_TYPE;
|
||||
user_tx_v0.payload.user.v.rsp.mem_map.density = bdinfo->hw_type;
|
||||
user_tx_v0.payload.user.v.rsp.mem_map.rw_flags = (BOARD_READABLE
|
||||
| (BOARD_WRITABLA << 1));
|
||||
| (BOARD_WRITABLE << 1));
|
||||
user_tx_v0.payload.user.v.rsp.mem_map.size_of_code_memory
|
||||
= SIZE_OF_CODE;
|
||||
= bdinfo->fw_size;
|
||||
user_tx_v0.payload.user.v.rsp.mem_map.size_of_description
|
||||
= SIZE_OF_DESCRIPTION;
|
||||
= bdinfo->desc_size;
|
||||
user_tx_v0.payload.user.v.rsp.mem_map.start_of_user_code
|
||||
= START_OF_USER_CODE;
|
||||
= bdinfo->fw_base;
|
||||
lfsm_user_set_tx_v0(&user_tx_v0);
|
||||
break;
|
||||
case OPAHRS_MSG_V0_REQ_SERIAL:
|
||||
@ -192,7 +194,7 @@ void process_spi_request(void) {
|
||||
PIOS_LED_On(LED1);
|
||||
opahrs_msg_v0_init_user_tx(&user_tx_v0, OPAHRS_MSG_V0_RSP_FWUP_STATUS);
|
||||
if (!(user_rx_v0.payload.user.v.req.fwup_data.adress
|
||||
< START_OF_USER_CODE)) {
|
||||
< bdinfo->fw_base)) {
|
||||
for (uint8_t x = 0; x
|
||||
< user_rx_v0.payload.user.v.req.fwup_data.size; ++x) {
|
||||
if (FLASH_ProgramWord(
|
||||
@ -250,13 +252,10 @@ void process_spi_request(void) {
|
||||
return;
|
||||
}
|
||||
void jump_to_app() {
|
||||
//while(TRUE)
|
||||
//{
|
||||
// PIOS_LED_Toggle(LED1);
|
||||
// PIOS_DELAY_WaitmS(1000);
|
||||
//}
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
|
||||
PIOS_LED_On(LED1);
|
||||
if (((*(__IO uint32_t*) START_OF_USER_CODE) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */
|
||||
if (((*(__IO uint32_t*) bdinfo->fw_base) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */
|
||||
FLASH_Lock();
|
||||
RCC_APB2PeriphResetCmd(0xffffffff, ENABLE);
|
||||
RCC_APB1PeriphResetCmd(0xffffffff, ENABLE);
|
||||
@ -265,10 +264,10 @@ void jump_to_app() {
|
||||
//_SetCNTR(0); // clear interrupt mask
|
||||
//_SetISTR(0); // clear all requests
|
||||
|
||||
JumpAddress = *(__IO uint32_t*) (START_OF_USER_CODE + 4);
|
||||
JumpAddress = *(__IO uint32_t*) (bdinfo->fw_base + 4);
|
||||
Jump_To_Application = (pFunction) JumpAddress;
|
||||
/* Initialize user application's Stack Pointer */
|
||||
__set_MSP(*(__IO uint32_t*) START_OF_USER_CODE);
|
||||
__set_MSP(*(__IO uint32_t*) bdinfo->fw_base);
|
||||
Jump_To_Application();
|
||||
} else {
|
||||
boot_status = jump_failed;
|
||||
|
@ -25,6 +25,13 @@
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
TOP := $(realpath $(WHEREAMI)/../../../)
|
||||
include $(TOP)/make/firmware-defs.mk
|
||||
include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = bu_$(BOARD_NAME)
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR := $(TOP)/build/$(TARGET)
|
||||
|
||||
# Set developer code and compile options
|
||||
# Set to YES to compile for debugging
|
||||
@ -51,21 +58,6 @@ endif
|
||||
|
||||
FLASH_TOOL = OPENOCD
|
||||
|
||||
# MCU name, submodel and board
|
||||
# - MCU used for compiler-option (-mcpu)
|
||||
# - MODEL used for linker-script name (-T) and passed as define
|
||||
# - BOARD just passed as define (optional)
|
||||
MCU = cortex-m3
|
||||
CHIP = STM32F103CBT
|
||||
BOARD ?= NULL
|
||||
MODEL ?= NULL
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR = ../../../build/bootloaders/BootloaderUpdater
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = BL_Updater
|
||||
|
||||
# Paths
|
||||
OPSYSTEM = .
|
||||
OPSYSTEMINC = $(OPSYSTEM)/inc
|
||||
@ -224,7 +216,6 @@ endif
|
||||
ifeq ($(ENABLE_AUX_UART), YES)
|
||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||
endif
|
||||
CDEFS += -DUSE_BOOTLOADER
|
||||
|
||||
# Place project-specific -D and/or -U options for
|
||||
# Assembler with preprocessor here.
|
||||
@ -309,9 +300,9 @@ LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld
|
||||
|
||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||
# Program
|
||||
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08003000 bin"
|
||||
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) $(START_OF_FW_CODE) bin"
|
||||
# Verify
|
||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08003000 bin"
|
||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) $(START_OF_FW_CODE) bin"
|
||||
# reset target
|
||||
OOCD_CL+=-c "reset run"
|
||||
# terminate OOCD after programming
|
||||
@ -364,6 +355,7 @@ program: $(OUTDIR)/$(TARGET).bin
|
||||
endif
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
BLOBJ := $(TOP)/build/bl_$(BOARD_NAME)/bl_$(BOARD_NAME).bin.o
|
||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ) $(BLOBJ)))
|
||||
|
||||
# Assemble: create object files from assembler source files.
|
||||
@ -392,14 +384,16 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION)))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino opfw
|
||||
elf: $(OUTDIR)/$(TARGET).elf
|
||||
elf.stripped: $(OUTDIR)/$(TARGET).elf.stripped
|
||||
lss: $(OUTDIR)/$(TARGET).lss
|
||||
sym: $(OUTDIR)/$(TARGET).sym
|
||||
hex: $(OUTDIR)/$(TARGET).hex
|
||||
bin: $(OUTDIR)/$(TARGET).bin
|
||||
bino: $(OUTDIR)/$(TARGET).bin.o
|
||||
opfw: $(OUTDIR)/$(TARGET).opfw
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
@ -411,11 +405,11 @@ docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
install: $(OUTDIR)/$(TARGET).opfw
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opfw
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
|
@ -25,6 +25,13 @@
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
TOP := $(realpath $(WHEREAMI)/../../../)
|
||||
include $(TOP)/make/firmware-defs.mk
|
||||
include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET := bl_$(BOARD_NAME)
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR := $(TOP)/build/$(TARGET)
|
||||
|
||||
# Set developer code and compile options
|
||||
# Set to YES to compile for debugging
|
||||
@ -48,21 +55,6 @@ endif
|
||||
|
||||
FLASH_TOOL = OPENOCD
|
||||
|
||||
# MCU name, submodel and board
|
||||
# - MCU used for compiler-option (-mcpu)
|
||||
# - MODEL used for linker-script name (-T) and passed as define
|
||||
# - BOARD just passed as define (optional)
|
||||
MCU = cortex-m3
|
||||
CHIP = STM32F103CBT
|
||||
BOARD = STM32103CB_CC_Rev1
|
||||
MODEL = MD
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR = $(TOP)/build/bl_coptercontrol
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = CopterControl_BL
|
||||
|
||||
# Paths
|
||||
OPSYSTEM = .
|
||||
OPSYSTEMINC = $(OPSYSTEM)/inc
|
||||
@ -123,6 +115,7 @@ SRC += $(PIOSSTM32F10X)/pios_usb_hid_prop.c
|
||||
SRC += $(PIOSSTM32F10X)/pios_usb_hid_pwr.c
|
||||
|
||||
## PIOS Hardware (Common)
|
||||
SRC += $(PIOSCOMMON)/pios_board_info.c
|
||||
SRC += $(PIOSCOMMON)/pios_com.c
|
||||
SRC += $(PIOSCOMMON)/pios_bl_helper.c
|
||||
SRC += $(PIOSCOMMON)/pios_iap.c
|
||||
@ -180,7 +173,7 @@ CPPSRCARM =
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
|
||||
|
||||
# List Assembler source files here which must be assembled in ARM-Mode..
|
||||
ASRCARM =
|
||||
@ -259,6 +252,15 @@ ifeq ($(ENABLE_AUX_UART), YES)
|
||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||
endif
|
||||
|
||||
# Provide (only) the bootloader with board-specific defines
|
||||
BLONLY_CDEFS += -DBOARD_TYPE=$(BOARD_TYPE)
|
||||
BLONLY_CDEFS += -DBOARD_REVISION=$(BOARD_REVISION)
|
||||
BLONLY_CDEFS += -DHW_TYPE=$(HW_TYPE)
|
||||
BLONLY_CDEFS += -DBOOTLOADER_VERSION=$(BOOTLOADER_VERSION)
|
||||
BLONLY_CDEFS += -DFW_BANK_BASE=$(FW_BANK_BASE)
|
||||
BLONLY_CDEFS += -DFW_BANK_SIZE=$(FW_BANK_SIZE)
|
||||
BLONLY_CDEFS += -DFW_DESC_SIZE=$(FW_DESC_SIZE)
|
||||
|
||||
# Place project-specific -D and/or -U options for
|
||||
# Assembler with preprocessor here.
|
||||
#ADEFS = -DUSE_IRQ_ASM_WRAPPER
|
||||
@ -294,8 +296,9 @@ ifeq ($(DEBUG),NO)
|
||||
CFLAGS += -ffunction-sections
|
||||
endif
|
||||
|
||||
CFLAGS += -mcpu=$(MCU) -mthumb
|
||||
CFLAGS += -mcpu=$(MCU)
|
||||
CFLAGS += $(CDEFS)
|
||||
CFLAGS += $(BLONLY_CDEFS)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -I.
|
||||
|
||||
CFLAGS += -mapcs-frame
|
||||
@ -315,7 +318,7 @@ CONLYFLAGS += $(CSTANDARD)
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlns: create listing
|
||||
ASFLAGS = -mcpu=$(MCU) -mthumb -I. -x assembler-with-cpp
|
||||
ASFLAGS = -mcpu=$(MCU) -I. -x assembler-with-cpp
|
||||
ASFLAGS += $(ADEFS)
|
||||
ASFLAGS += -Wa,-adhlns=$(addprefix $(OUTDIR)/, $(notdir $(addsuffix .lst, $(basename $<))))
|
||||
ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
@ -340,20 +343,8 @@ LDFLAGS += -lc -lgcc
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld
|
||||
|
||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||
# Program
|
||||
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin"
|
||||
# Verify
|
||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin"
|
||||
# reset target
|
||||
OOCD_CL+=-c "reset run"
|
||||
# terminate OOCD after programming
|
||||
OOCD_CL+=-c shutdown
|
||||
|
||||
# Define programs and commands.
|
||||
REMOVE = $(REMOVE_CMD) -f
|
||||
###SHELL = sh
|
||||
###COPY = cp
|
||||
|
||||
# List of all source files.
|
||||
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
|
||||
@ -393,14 +384,6 @@ ${OUTDIR}/InitMods.c: Makefile
|
||||
@echo ${quote}${foreach MOD, ${MODNAMES}, ${MOD}Initialize();}${quote} >> ${OUTDIR}/InitMods.c
|
||||
@echo ${quote}}${quote} >> ${OUTDIR}/InitMods.c
|
||||
|
||||
# Program the device.
|
||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||
program: $(OUTDIR)/$(TARGET).bin
|
||||
@echo ${quote}Programming with OPENOCD${quote}
|
||||
$(OOCD_EXE) $(OOCD_CL)
|
||||
endif
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||
|
||||
@ -430,6 +413,9 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
# Add jtag targets (program and wipe)
|
||||
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE)))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
elf: $(OUTDIR)/$(TARGET).elf
|
||||
lss: $(OUTDIR)/$(TARGET).lss
|
||||
@ -440,8 +426,6 @@ bino: $(OUTDIR)/$(TARGET).bin.o
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
.PHONY: size
|
||||
size: $(OUTDIR)/$(TARGET).elf_size
|
||||
|
||||
# Generate Doxygen documents
|
||||
docs:
|
||||
@ -494,4 +478,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program install
|
||||
.PHONY : all build clean clean_list install
|
||||
|
@ -27,6 +27,7 @@
|
||||
*/
|
||||
/* Bootloader Includes */
|
||||
#include <pios.h>
|
||||
#include <pios_board_info.h>
|
||||
#include "stopwatch.h"
|
||||
#include "op_dfu.h"
|
||||
#include "usb_lib.h"
|
||||
@ -163,7 +164,9 @@ int main() {
|
||||
}
|
||||
|
||||
void jump_to_app() {
|
||||
if (((*(__IO uint32_t*) START_OF_USER_CODE) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
|
||||
if (((*(__IO uint32_t*) bdinfo->fw_base) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */
|
||||
FLASH_Lock();
|
||||
RCC_APB2PeriphResetCmd(0xffffffff, ENABLE);
|
||||
RCC_APB1PeriphResetCmd(0xffffffff, ENABLE);
|
||||
@ -171,10 +174,10 @@ void jump_to_app() {
|
||||
RCC_APB1PeriphResetCmd(0xffffffff, DISABLE);
|
||||
_SetCNTR(0); // clear interrupt mask
|
||||
_SetISTR(0); // clear all requests
|
||||
JumpAddress = *(__IO uint32_t*) (START_OF_USER_CODE + 4);
|
||||
JumpAddress = *(__IO uint32_t*) (bdinfo->fw_base + 4);
|
||||
Jump_To_Application = (pFunction) JumpAddress;
|
||||
/* Initialize user application's Stack Pointer */
|
||||
__set_MSP(*(__IO uint32_t*) START_OF_USER_CODE);
|
||||
__set_MSP(*(__IO uint32_t*) bdinfo->fw_base);
|
||||
Jump_To_Application();
|
||||
} else {
|
||||
DeviceState = failed_jump;
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "pios.h"
|
||||
#include "op_dfu.h"
|
||||
#include "pios_bl_helper.h"
|
||||
#include <pios_board_info.h>
|
||||
//programmable devices
|
||||
Device devicesTable[10];
|
||||
uint8_t numberOfDevices = 0;
|
||||
@ -382,16 +383,18 @@ void processComand(uint8_t *xReceive_Buffer) {
|
||||
return;
|
||||
}
|
||||
void OPDfuIni(uint8_t discover) {
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
Device dev;
|
||||
|
||||
dev.programmingType = Self_flash;
|
||||
dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLA << 1));
|
||||
dev.startOfUserCode = START_OF_USER_CODE;
|
||||
dev.sizeOfCode = SIZE_OF_CODE;
|
||||
dev.sizeOfDescription = SIZE_OF_DESCRIPTION;
|
||||
dev.BL_Version = BOOTLOADER_VERSION;
|
||||
dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLE << 1));
|
||||
dev.startOfUserCode = bdinfo->fw_base;
|
||||
dev.sizeOfCode = bdinfo->fw_size;
|
||||
dev.sizeOfDescription = bdinfo->desc_size;
|
||||
dev.BL_Version = bdinfo->bl_rev;
|
||||
dev.FW_Crc = CalcFirmCRC();
|
||||
dev.devID = (BOARD_TYPE << 8) | BOARD_REVISION;
|
||||
dev.devType = HW_TYPE;
|
||||
dev.devID = (bdinfo->board_type << 8) | (bdinfo->board_rev);
|
||||
dev.devType = bdinfo->hw_type;
|
||||
numberOfDevices = 1;
|
||||
devicesTable[0] = dev;
|
||||
if (discover) {
|
||||
|
@ -25,6 +25,13 @@
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
TOP := $(realpath $(WHEREAMI)/../../../)
|
||||
include $(TOP)/make/firmware-defs.mk
|
||||
include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET := bl_$(BOARD_NAME)
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR := $(TOP)/build/$(TARGET)
|
||||
|
||||
# Set developer code and compile options
|
||||
# Set to YES to compile for debugging
|
||||
@ -48,21 +55,6 @@ endif
|
||||
|
||||
FLASH_TOOL = OPENOCD
|
||||
|
||||
# MCU name, submodel and board
|
||||
# - MCU used for compiler-option (-mcpu)
|
||||
# - MODEL used for linker-script name (-T) and passed as define
|
||||
# - BOARD just passed as define (optional)
|
||||
MCU = cortex-m3
|
||||
CHIP = STM32F103RET
|
||||
BOARD = STM3210E_OP
|
||||
MODEL = HD
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR = $(TOP)/build/bl_openpilot
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = OpenPilot_BL
|
||||
|
||||
# Paths
|
||||
OPSYSTEM = .
|
||||
OPSYSTEMINC = $(OPSYSTEM)/inc
|
||||
@ -124,6 +116,7 @@ SRC += $(PIOSSTM32F10X)/pios_usb_hid_prop.c
|
||||
SRC += $(PIOSSTM32F10X)/pios_usb_hid_pwr.c
|
||||
|
||||
## PIOS Hardware (Common)
|
||||
SRC += $(PIOSCOMMON)/pios_board_info.c
|
||||
SRC += $(PIOSCOMMON)/pios_com.c
|
||||
SRC += $(PIOSCOMMON)/pios_opahrs_v0.c
|
||||
SRC += $(PIOSCOMMON)/pios_bl_helper.c
|
||||
@ -183,7 +176,7 @@ CPPSRCARM =
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)_OP.S
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
|
||||
|
||||
# List Assembler source files here which must be assembled in ARM-Mode..
|
||||
ASRCARM =
|
||||
@ -262,6 +255,15 @@ ifeq ($(ENABLE_AUX_UART), YES)
|
||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||
endif
|
||||
|
||||
# Provide (only) the bootloader with board-specific defines
|
||||
BLONLY_CDEFS += -DBOARD_TYPE=$(BOARD_TYPE)
|
||||
BLONLY_CDEFS += -DBOARD_REVISION=$(BOARD_REVISION)
|
||||
BLONLY_CDEFS += -DHW_TYPE=$(HW_TYPE)
|
||||
BLONLY_CDEFS += -DBOOTLOADER_VERSION=$(BOOTLOADER_VERSION)
|
||||
BLONLY_CDEFS += -DFW_BANK_BASE=$(FW_BANK_BASE)
|
||||
BLONLY_CDEFS += -DFW_BANK_SIZE=$(FW_BANK_SIZE)
|
||||
BLONLY_CDEFS += -DFW_DESC_SIZE=$(FW_DESC_SIZE)
|
||||
|
||||
# Place project-specific -D and/or -U options for
|
||||
# Assembler with preprocessor here.
|
||||
#ADEFS = -DUSE_IRQ_ASM_WRAPPER
|
||||
@ -299,6 +301,7 @@ endif
|
||||
|
||||
CFLAGS += -mcpu=$(MCU)
|
||||
CFLAGS += $(CDEFS)
|
||||
CFLAGS += $(BLONLY_CDEFS)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -I.
|
||||
|
||||
CFLAGS += -mapcs-frame
|
||||
@ -343,20 +346,8 @@ LDFLAGS += -lc -lgcc
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld
|
||||
|
||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||
# Program
|
||||
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin"
|
||||
# Verify
|
||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin"
|
||||
# reset target
|
||||
OOCD_CL+=-c "reset run"
|
||||
# terminate OOCD after programming
|
||||
OOCD_CL+=-c shutdown
|
||||
|
||||
# Define programs and commands.
|
||||
REMOVE = $(REMOVE_CMD) -f
|
||||
###SHELL = sh
|
||||
###COPY = cp
|
||||
|
||||
# List of all source files.
|
||||
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
|
||||
@ -396,14 +387,6 @@ ${OUTDIR}/InitMods.c: Makefile
|
||||
@echo ${quote}${foreach MOD, ${MODNAMES}, ${MOD}Initialize();}${quote} >> ${OUTDIR}/InitMods.c
|
||||
@echo ${quote}}${quote} >> ${OUTDIR}/InitMods.c
|
||||
|
||||
# Program the device.
|
||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||
program: $(OUTDIR)/$(TARGET).bin
|
||||
@echo ${quote}Programming with OPENOCD${quote}
|
||||
$(OOCD_EXE) $(OOCD_CL)
|
||||
endif
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||
|
||||
@ -433,6 +416,9 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
# Add jtag targets (program and wipe)
|
||||
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE)))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
elf: $(OUTDIR)/$(TARGET).elf
|
||||
lss: $(OUTDIR)/$(TARGET).lss
|
||||
@ -443,8 +429,6 @@ bino: $(OUTDIR)/$(TARGET).bin.o
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
.PHONY: size
|
||||
size: $(OUTDIR)/$(TARGET).elf_size
|
||||
|
||||
# Generate Doxygen documents
|
||||
docs:
|
||||
@ -497,4 +481,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program install
|
||||
.PHONY : all build clean clean_list install
|
||||
|
@ -27,6 +27,7 @@
|
||||
*/
|
||||
/* Bootloader Includes */
|
||||
#include <pios.h>
|
||||
#include <pios_board_info.h>
|
||||
#include "pios_opahrs.h"
|
||||
#include "stopwatch.h"
|
||||
#include "op_dfu.h"
|
||||
@ -216,7 +217,9 @@ int main() {
|
||||
}
|
||||
|
||||
void jump_to_app() {
|
||||
if (((*(__IO uint32_t*) START_OF_USER_CODE) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
|
||||
if (((*(__IO uint32_t*) bdinfo->fw_base) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */
|
||||
FLASH_Lock();
|
||||
RCC_APB2PeriphResetCmd(0xffffffff, ENABLE);
|
||||
RCC_APB1PeriphResetCmd(0xffffffff, ENABLE);
|
||||
@ -225,10 +228,10 @@ void jump_to_app() {
|
||||
_SetCNTR(0); // clear interrupt mask
|
||||
_SetISTR(0); // clear all requests
|
||||
|
||||
JumpAddress = *(__IO uint32_t*) (START_OF_USER_CODE + 4);
|
||||
JumpAddress = *(__IO uint32_t*) (bdinfo->fw_base + 4);
|
||||
Jump_To_Application = (pFunction) JumpAddress;
|
||||
/* Initialize user application's Stack Pointer */
|
||||
__set_MSP(*(__IO uint32_t*) START_OF_USER_CODE);
|
||||
__set_MSP(*(__IO uint32_t*) bdinfo->fw_base);
|
||||
Jump_To_Application();
|
||||
} else {
|
||||
DeviceState = failed_jump;
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "pios.h"
|
||||
#include "op_dfu.h"
|
||||
#include "pios_bl_helper.h"
|
||||
#include <pios_board_info.h>
|
||||
#include "pios_opahrs.h"
|
||||
#include "ssp.h"
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@ -447,16 +448,18 @@ void processComand(uint8_t *xReceive_Buffer) {
|
||||
return;
|
||||
}
|
||||
void OPDfuIni(uint8_t discover) {
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
Device dev;
|
||||
|
||||
dev.programmingType = Self_flash;
|
||||
dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLA << 1));
|
||||
dev.startOfUserCode = START_OF_USER_CODE;
|
||||
dev.sizeOfCode = SIZE_OF_CODE;
|
||||
dev.sizeOfDescription = SIZE_OF_DESCRIPTION;
|
||||
dev.BL_Version = BOOTLOADER_VERSION;
|
||||
dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLE << 1));
|
||||
dev.startOfUserCode = bdinfo->fw_base;
|
||||
dev.sizeOfCode = bdinfo->fw_size;
|
||||
dev.sizeOfDescription = bdinfo->desc_size;
|
||||
dev.BL_Version = bdinfo->bl_rev;
|
||||
dev.FW_Crc = CalcFirmCRC();
|
||||
dev.devID = (BOARD_TYPE << 8) | BOARD_REVISION;
|
||||
dev.devType = HW_TYPE;
|
||||
dev.devID = (bdinfo->board_type << 8) | (bdinfo->board_rev);
|
||||
dev.devType = bdinfo->hw_type;
|
||||
numberOfDevices = 1;
|
||||
devicesTable[0] = dev;
|
||||
if (discover) {
|
||||
|
@ -25,6 +25,13 @@
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
TOP := $(realpath $(WHEREAMI)/../../../)
|
||||
include $(TOP)/make/firmware-defs.mk
|
||||
include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET := bl_$(BOARD_NAME)
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR := $(TOP)/build/$(TARGET)
|
||||
|
||||
# Set developer code and compile options
|
||||
# Set to YES to compile for debugging
|
||||
@ -48,21 +55,6 @@ endif
|
||||
|
||||
FLASH_TOOL = OPENOCD
|
||||
|
||||
# MCU name, submodel and board
|
||||
# - MCU used for compiler-option (-mcpu)
|
||||
# - MODEL used for linker-script name (-T) and passed as define
|
||||
# - BOARD just passed as define (optional)
|
||||
MCU = cortex-m3
|
||||
CHIP = STM32F103CBT
|
||||
BOARD = STM32103CB_PIPXTREME
|
||||
MODEL = MD
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR = $(TOP)/build/bl_pipxtreme
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = PipXtreme_BL
|
||||
|
||||
# Paths
|
||||
OPSYSTEM = .
|
||||
OPSYSTEMINC = $(OPSYSTEM)/inc
|
||||
@ -122,6 +114,7 @@ SRC += $(PIOSSTM32F10X)/pios_usb_hid_prop.c
|
||||
SRC += $(PIOSSTM32F10X)/pios_usb_hid_pwr.c
|
||||
|
||||
## PIOS Hardware (Common)
|
||||
SRC += $(PIOSCOMMON)/pios_board_info.c
|
||||
SRC += $(PIOSCOMMON)/pios_com.c
|
||||
SRC += $(PIOSCOMMON)/pios_bl_helper.c
|
||||
SRC += $(PIOSCOMMON)/pios_iap.c
|
||||
@ -179,7 +172,7 @@ CPPSRCARM =
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
|
||||
|
||||
# List Assembler source files here which must be assembled in ARM-Mode..
|
||||
ASRCARM =
|
||||
@ -258,6 +251,17 @@ ifeq ($(ENABLE_AUX_UART), YES)
|
||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||
endif
|
||||
|
||||
# Provide (only) the bootloader with board-specific defines
|
||||
BLONLY_CDEFS += -DBOARD_TYPE=$(BOARD_TYPE)
|
||||
BLONLY_CDEFS += -DBOARD_REVISION=$(BOARD_REVISION)
|
||||
BLONLY_CDEFS += -DHW_TYPE=$(HW_TYPE)
|
||||
BLONLY_CDEFS += -DBOOTLOADER_VERSION=$(BOOTLOADER_VERSION)
|
||||
BLONLY_CDEFS += -DFW_BANK_BASE=$(FW_BANK_BASE)
|
||||
BLONLY_CDEFS += -DFW_BANK_SIZE=$(FW_BANK_SIZE)
|
||||
BLONLY_CDEFS += -DFW_DESC_SIZE=$(FW_DESC_SIZE)
|
||||
BLONLY_CDEFS += -DEE_BANK_BASE=$(EE_BANK_BASE)
|
||||
BLONLY_CDEFS += -DEE_BANK_SIZE=$(EE_BANK_SIZE)
|
||||
|
||||
# Place project-specific -D and/or -U options for
|
||||
# Assembler with preprocessor here.
|
||||
#ADEFS = -DUSE_IRQ_ASM_WRAPPER
|
||||
@ -293,8 +297,9 @@ ifeq ($(DEBUG),NO)
|
||||
CFLAGS += -ffunction-sections
|
||||
endif
|
||||
|
||||
CFLAGS += -mcpu=$(MCU) -mthumb
|
||||
CFLAGS += -mcpu=$(MCU)
|
||||
CFLAGS += $(CDEFS)
|
||||
CFLAGS += $(BLONLY_CDEFS)
|
||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) -I.
|
||||
|
||||
CFLAGS += -mapcs-frame
|
||||
@ -314,7 +319,7 @@ CONLYFLAGS += $(CSTANDARD)
|
||||
# Assembler flags.
|
||||
# -Wa,...: tell GCC to pass this to the assembler.
|
||||
# -ahlns: create listing
|
||||
ASFLAGS = -mcpu=$(MCU) -mthumb -I. -x assembler-with-cpp
|
||||
ASFLAGS = -mcpu=$(MCU) -I. -x assembler-with-cpp
|
||||
ASFLAGS += $(ADEFS)
|
||||
ASFLAGS += -Wa,-adhlns=$(addprefix $(OUTDIR)/, $(notdir $(addsuffix .lst, $(basename $<))))
|
||||
ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
|
||||
@ -339,20 +344,8 @@ LDFLAGS += -lc -lgcc
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_BL_sections.ld
|
||||
|
||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||
# Program
|
||||
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08000000 bin"
|
||||
# Verify
|
||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08000000 bin"
|
||||
# reset target
|
||||
OOCD_CL+=-c "reset run"
|
||||
# terminate OOCD after programming
|
||||
OOCD_CL+=-c shutdown
|
||||
|
||||
# Define programs and commands.
|
||||
REMOVE = $(REMOVE_CMD) -f
|
||||
###SHELL = sh
|
||||
###COPY = cp
|
||||
|
||||
# List of all source files.
|
||||
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
|
||||
@ -392,14 +385,6 @@ ${OUTDIR}/InitMods.c: Makefile
|
||||
@echo ${quote}${foreach MOD, ${MODNAMES}, ${MOD}Initialize();}${quote} >> ${OUTDIR}/InitMods.c
|
||||
@echo ${quote}}${quote} >> ${OUTDIR}/InitMods.c
|
||||
|
||||
# Program the device.
|
||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||
program: $(OUTDIR)/$(TARGET).bin
|
||||
@echo ${quote}Programming with OPENOCD${quote}
|
||||
$(OOCD_EXE) $(OOCD_CL)
|
||||
endif
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||
|
||||
@ -429,6 +414,9 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
# Add jtag targets (program and wipe)
|
||||
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE)))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
elf: $(OUTDIR)/$(TARGET).elf
|
||||
lss: $(OUTDIR)/$(TARGET).lss
|
||||
@ -439,8 +427,6 @@ bino: $(OUTDIR)/$(TARGET).bin.o
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
.PHONY: size
|
||||
size: $(OUTDIR)/$(TARGET).elf_size
|
||||
|
||||
# Generate Doxygen documents
|
||||
docs:
|
||||
@ -493,4 +479,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program install
|
||||
.PHONY : all build clean clean_list install
|
||||
|
@ -27,6 +27,7 @@
|
||||
*/
|
||||
/* Bootloader Includes */
|
||||
#include <pios.h>
|
||||
#include <pios_board_info.h>
|
||||
#include "stopwatch.h"
|
||||
#include "op_dfu.h"
|
||||
#include "usb_lib.h"
|
||||
@ -170,7 +171,9 @@ int main() {
|
||||
}
|
||||
|
||||
void jump_to_app() {
|
||||
if (((*(__IO uint32_t*) START_OF_USER_CODE) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
|
||||
if (((*(__IO uint32_t*) bdinfo->fw_base) & 0x2FFE0000) == 0x20000000) { /* Jump to user application */
|
||||
FLASH_Lock();
|
||||
RCC_APB2PeriphResetCmd(0xffffffff, ENABLE);
|
||||
RCC_APB1PeriphResetCmd(0xffffffff, ENABLE);
|
||||
@ -179,10 +182,10 @@ void jump_to_app() {
|
||||
_SetCNTR(0); // clear interrupt mask
|
||||
_SetISTR(0); // clear all requests
|
||||
|
||||
JumpAddress = *(__IO uint32_t*) (START_OF_USER_CODE + 4);
|
||||
JumpAddress = *(__IO uint32_t*) (bdinfo->fw_base + 4);
|
||||
Jump_To_Application = (pFunction) JumpAddress;
|
||||
/* Initialize user application's Stack Pointer */
|
||||
__set_MSP(*(__IO uint32_t*) START_OF_USER_CODE);
|
||||
__set_MSP(*(__IO uint32_t*) bdinfo->fw_base);
|
||||
Jump_To_Application();
|
||||
} else {
|
||||
DeviceState = failed_jump;
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "pios.h"
|
||||
#include "op_dfu.h"
|
||||
#include "pios_bl_helper.h"
|
||||
#include <pios_board_info.h>
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
@ -414,16 +415,18 @@ void processComand(uint8_t *xReceive_Buffer) {
|
||||
return;
|
||||
}
|
||||
void OPDfuIni(uint8_t discover) {
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
Device dev;
|
||||
|
||||
dev.programmingType = Self_flash;
|
||||
dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLA << 1));
|
||||
dev.startOfUserCode = START_OF_USER_CODE;
|
||||
dev.sizeOfCode = SIZE_OF_CODE;
|
||||
dev.sizeOfDescription = SIZE_OF_DESCRIPTION;
|
||||
dev.BL_Version = BOOTLOADER_VERSION;
|
||||
dev.readWriteFlags = (BOARD_READABLE | (BOARD_WRITABLE << 1));
|
||||
dev.startOfUserCode = bdinfo->fw_base;
|
||||
dev.sizeOfCode = bdinfo->fw_size;
|
||||
dev.sizeOfDescription = bdinfo->desc_size;
|
||||
dev.BL_Version = bdinfo->bl_rev;
|
||||
dev.FW_Crc = CalcFirmCRC();
|
||||
dev.devID = (BOARD_TYPE << 8) | BOARD_REVISION;
|
||||
dev.devType = HW_TYPE;
|
||||
dev.devID = (bdinfo->board_type << 8) | (bdinfo->board_rev);
|
||||
dev.devType = bdinfo->hw_type;
|
||||
numberOfDevices = 1;
|
||||
devicesTable[0] = dev;
|
||||
if (discover) {
|
||||
|
@ -25,6 +25,13 @@
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
TOP := $(realpath $(WHEREAMI)/../../)
|
||||
include $(TOP)/make/firmware-defs.mk
|
||||
include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET := fw_$(BOARD_NAME)
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR := $(TOP)/build/$(TARGET)
|
||||
|
||||
# Set developer code and compile options
|
||||
# Set to YES to compile for debugging
|
||||
@ -57,21 +64,6 @@ FLASH_TOOL = OPENOCD
|
||||
# List of modules to include
|
||||
MODULES = Telemetry Attitude Stabilization Actuator ManualControl FirmwareIAP
|
||||
|
||||
# MCU name, submodel and board
|
||||
# - MCU used for compiler-option (-mcpu)
|
||||
# - MODEL used for linker-script name (-T) and passed as define
|
||||
# - BOARD just passed as define (optional)
|
||||
MCU = cortex-m3
|
||||
CHIP = STM32F103CBT
|
||||
BOARD = STM32103CB_CC_Rev1
|
||||
MODEL = MD
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR = $(TOP)/build/coptercontrol
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = CopterControl
|
||||
|
||||
# Paths
|
||||
OPSYSTEM = ./System
|
||||
OPSYSTEMINC = $(OPSYSTEM)/inc
|
||||
@ -299,7 +291,7 @@ CPPSRCARM =
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)_CC.S
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
|
||||
|
||||
# List Assembler source files here which must be assembled in ARM-Mode..
|
||||
ASRCARM =
|
||||
@ -381,7 +373,6 @@ endif
|
||||
ifeq ($(ENABLE_AUX_UART), YES)
|
||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||
endif
|
||||
CDEFS += -DUSE_BOOTLOADER
|
||||
ifeq ($(ERASE_FLASH), YES)
|
||||
CDEFS += -DERASE_FLASH
|
||||
endif
|
||||
@ -420,9 +411,10 @@ CSTANDARD = -std=gnu99
|
||||
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
|
||||
|
||||
ifeq ($(DEBUG),YES)
|
||||
CFLAGS = -g$(DEBUGF) -DDEBUG
|
||||
CFLAGS = -DDEBUG
|
||||
endif
|
||||
|
||||
CFLAGS += -g$(DEBUGF)
|
||||
CFLAGS += -O$(OPT)
|
||||
CFLAGS += -mcpu=$(MCU)
|
||||
CFLAGS += $(CDEFS)
|
||||
@ -474,21 +466,9 @@ LDFLAGS += -lc -lgcc
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld
|
||||
|
||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||
# Program
|
||||
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08003000 bin"
|
||||
# Verify
|
||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08003000 bin"
|
||||
# reset target
|
||||
OOCD_CL+=-c "reset run"
|
||||
# terminate OOCD after programming
|
||||
OOCD_CL+=-c shutdown
|
||||
|
||||
# Define programs and commands.
|
||||
REMOVE = $(REMOVE_CMD) -f
|
||||
PYTHON = python
|
||||
###SHELL = sh
|
||||
###COPY = cp
|
||||
|
||||
# List of all source files.
|
||||
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
|
||||
@ -539,13 +519,6 @@ ${OUTDIR}/InitMods.c: Makefile
|
||||
# @$(PYTHON) $(PYMITETOOLS)/pmGenPmFeatures.py $(PYMITEPLAT)/pmfeatures.py > $(OUTDIR)/pmfeatures.h
|
||||
# @$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -u -o $(OUTDIR)/pmlibusr_img.c --native-file=$(OUTDIR)/pmlibusr_nat.c $(FLIGHTPLANS)/test.py
|
||||
|
||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||
program: $(OUTDIR)/$(TARGET).bin
|
||||
@echo ${quote}Programming with OPENOCD${quote}
|
||||
$(OOCD_EXE) $(OOCD_CL)
|
||||
endif
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||
|
||||
@ -575,29 +548,33 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION)))
|
||||
|
||||
# Add jtag targets (program and wipe)
|
||||
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE)))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino opfw
|
||||
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
|
||||
opfw: $(OUTDIR)/$(TARGET).opfw
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
.PHONY: size
|
||||
size: $(OUTDIR)/$(TARGET).elf_size
|
||||
|
||||
# Generate Doxygen documents
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
install: $(OUTDIR)/$(TARGET).opfw
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opfw
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
@ -641,4 +618,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program gencode install
|
||||
.PHONY : all build clean clean_list gencode install
|
||||
|
@ -25,11 +25,17 @@
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
TOP := $(realpath $(WHEREAMI)/../../)
|
||||
include $(TOP)/make/firmware-defs.mk
|
||||
include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET := fw_$(BOARD_NAME)
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR := $(TOP)/build/$(TARGET)
|
||||
|
||||
# Set developer code and compile options
|
||||
# Set to YES for debugging
|
||||
DEBUG ?= YES
|
||||
USE_BOOTLOADER ?= NO
|
||||
|
||||
# Set to YES when using Code Sourcery toolchain
|
||||
CODE_SOURCERY ?= YES
|
||||
@ -42,26 +48,6 @@ endif
|
||||
|
||||
FLASH_TOOL = OPENOCD
|
||||
|
||||
# MCU name, submodel and board
|
||||
# - MCU used for compiler-option (-mcpu)
|
||||
# - MODEL used for linker-script name (-T) and passed as define
|
||||
# - BOARD just passed as define (optional)
|
||||
MCU = cortex-m3
|
||||
CHIP = STM32F103RET
|
||||
BOARD = STM3210E_INS
|
||||
MODEL = HD
|
||||
ifeq ($(USE_BOOTLOADER), YES)
|
||||
BOOT_MODEL = $(MODEL)_BL
|
||||
else
|
||||
BOOT_MODEL = $(MODEL)_NB
|
||||
endif
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR = $(TOP)/build/ins
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = INS
|
||||
|
||||
# Paths
|
||||
INS = ./
|
||||
INSINC = $(INS)/inc
|
||||
@ -168,7 +154,7 @@ CPPSRCARM =
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
|
||||
|
||||
# List Assembler source files here which must be assembled in ARM-Mode..
|
||||
ASRCARM =
|
||||
@ -231,9 +217,7 @@ CDEFS = -DSTM32F10X_$(MODEL)
|
||||
CDEFS += -DUSE_STDPERIPH_DRIVER
|
||||
CDEFS += -DUSE_$(BOARD)
|
||||
CDEFS += -DIN_INS
|
||||
ifeq ($(USE_BOOTLOADER), YES)
|
||||
CDEFS += -DUSE_BOOTLOADER
|
||||
endif
|
||||
|
||||
# Place project-specific -D and/or -U options for
|
||||
# Assembler with preprocessor here.
|
||||
#ADEFS = -DUSE_IRQ_ASM_WRAPPER
|
||||
@ -311,22 +295,11 @@ LDFLAGS += $(MATH_LIB)
|
||||
LDFLAGS += -lc -lgcc
|
||||
|
||||
# Set linker-script name depending on selected submodel name
|
||||
LDFLAGS +=-T$(LINKERSCRIPTPATH)/link_$(BOARD)_$(BOOT_MODEL).ld
|
||||
|
||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).elf
|
||||
# Program
|
||||
OOCD_CL+=-c "flash write_image $(OOCD_LOADFILE)"
|
||||
# Verify
|
||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE)"
|
||||
# reset target
|
||||
OOCD_CL+=-c "reset run"
|
||||
# # terminate OOCD after programming
|
||||
OOCD_CL+=-c shutdown
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld
|
||||
|
||||
# Define programs and commands.
|
||||
REMOVE = $(REMOVE_CMD) -f
|
||||
###SHELL = sh
|
||||
###COPY = cp
|
||||
|
||||
# List of all source files.
|
||||
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
|
||||
@ -358,21 +331,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Program the device.
|
||||
ifeq ($(USE_BOOTLOADER), YES)
|
||||
# Program the device with OP Upload Tool".
|
||||
program: $(OUTDIR)/$(TARGET).bin
|
||||
@echo ${quote}Programming with OP Upload Tool${quote}
|
||||
../../ground/src/experimental/upload-build-desktop/debug/OPUploadTool -d 1 -p $(OUTDIR)/$(TARGET).bin
|
||||
else
|
||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||
program: $(OUTDIR)/$(TARGET).elf
|
||||
@echo ${quote}Programming with OPENOCD${quote}
|
||||
$(OOCD_EXE) $(OOCD_CL)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||
|
||||
@ -400,28 +358,35 @@ $(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 OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION)))
|
||||
|
||||
# Add jtag targets (program and wipe)
|
||||
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE)))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino opfw
|
||||
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
|
||||
opfw: $(OUTDIR)/$(TARGET).opfw
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
.PHONY: size
|
||||
size: $(OUTDIR)/$(TARGET).elf_size
|
||||
|
||||
# Generate Doxygen documents
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
install: $(OUTDIR)/$(TARGET).opfw
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opfw
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
@ -461,4 +426,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program install
|
||||
.PHONY : all build clean clean_list install
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "pios.h"
|
||||
#include <pios_board_info.h>
|
||||
#include "openpilot.h"
|
||||
#include "firmwareiap.h"
|
||||
#include "firmwareiapobj.h"
|
||||
@ -90,10 +91,12 @@ static void resetTask(UAVObjEvent *);
|
||||
|
||||
int32_t FirmwareIAPInitialize()
|
||||
{
|
||||
data.BoardType= BOARD_TYPE;
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
|
||||
data.BoardType= bdinfo->board_type;
|
||||
PIOS_BL_HELPER_FLASH_Read_Description(data.Description,FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM);
|
||||
PIOS_SYS_SerialNumberGetBinary(data.CPUSerial);
|
||||
data.BoardRevision= BOARD_REVISION;
|
||||
data.BoardRevision= bdinfo->board_rev;
|
||||
data.ArmReset=0;
|
||||
data.crc = 0;
|
||||
FirmwareIAPObjSet( &data );
|
||||
@ -112,6 +115,7 @@ int32_t FirmwareIAPInitialize()
|
||||
static uint8_t iap_state = IAP_STATE_READY;
|
||||
static void FirmwareIAPCallback(UAVObjEvent* ev)
|
||||
{
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
static uint32_t last_time = 0;
|
||||
uint32_t this_time;
|
||||
uint32_t delta;
|
||||
@ -125,11 +129,11 @@ static void FirmwareIAPCallback(UAVObjEvent* ev)
|
||||
this_time = get_time();
|
||||
delta = this_time - last_time;
|
||||
last_time = this_time;
|
||||
if((data.BoardType==BOARD_TYPE)&&(data.crc != PIOS_BL_HELPER_CRC_Memory_Calc()))
|
||||
if((data.BoardType==bdinfo->board_type)&&(data.crc != PIOS_BL_HELPER_CRC_Memory_Calc()))
|
||||
{
|
||||
PIOS_BL_HELPER_FLASH_Read_Description(data.Description,FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM);
|
||||
PIOS_SYS_SerialNumberGetBinary(data.CPUSerial);
|
||||
data.BoardRevision=BOARD_REVISION;
|
||||
data.BoardRevision=bdinfo->board_rev;
|
||||
data.crc = PIOS_BL_HELPER_CRC_Memory_Calc();
|
||||
FirmwareIAPObjSet( &data );
|
||||
}
|
||||
|
@ -268,8 +268,8 @@ static void manualControlTask(void *parameters)
|
||||
|
||||
// Set accessory channels
|
||||
cmd.Accessory1 = (settings.Accessory1 != MANUALCONTROLSETTINGS_ACCESSORY1_NONE) ? scaledChannel[settings.Accessory1] : 0;
|
||||
cmd.Accessory2 = (settings.Accessory1 != MANUALCONTROLSETTINGS_ACCESSORY2_NONE) ? scaledChannel[settings.Accessory2] : 0;
|
||||
cmd.Accessory3 = (settings.Accessory1 != MANUALCONTROLSETTINGS_ACCESSORY3_NONE) ? scaledChannel[settings.Accessory3] : 0;
|
||||
cmd.Accessory2 = (settings.Accessory2 != MANUALCONTROLSETTINGS_ACCESSORY2_NONE) ? scaledChannel[settings.Accessory2] : 0;
|
||||
cmd.Accessory3 = (settings.Accessory3 != MANUALCONTROLSETTINGS_ACCESSORY3_NONE) ? scaledChannel[settings.Accessory3] : 0;
|
||||
|
||||
processFlightMode(&settings, flightMode);
|
||||
processArm(&cmd, &settings);
|
||||
|
@ -25,6 +25,13 @@
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
TOP := $(realpath $(WHEREAMI)/../../)
|
||||
include $(TOP)/make/firmware-defs.mk
|
||||
include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET := fw_$(BOARD_NAME)
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR := $(TOP)/build/$(TARGET)
|
||||
|
||||
# Set developer code and compile options
|
||||
# Set to YES to compile for debugging
|
||||
@ -59,21 +66,6 @@ PYMODULES = FlightPlan
|
||||
#MODULES = Telemetry
|
||||
#MODULES += Osd/OsdEtStd
|
||||
|
||||
# MCU name, submodel and board
|
||||
# - MCU used for compiler-option (-mcpu)
|
||||
# - MODEL used for linker-script name (-T) and passed as define
|
||||
# - BOARD just passed as define (optional)
|
||||
MCU = cortex-m3
|
||||
CHIP = STM32F103RET
|
||||
BOARD = STM3210E_OP
|
||||
MODEL = HD
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR = $(TOP)/build/openpilot
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = OpenPilot
|
||||
|
||||
# Paths
|
||||
OPSYSTEM = ./System
|
||||
OPSYSTEMINC = $(OPSYSTEM)/inc
|
||||
@ -287,7 +279,7 @@ CPPSRCARM =
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)_OP.S
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
|
||||
|
||||
# List Assembler source files here which must be assembled in ARM-Mode..
|
||||
ASRCARM =
|
||||
@ -369,7 +361,6 @@ endif
|
||||
ifeq ($(ENABLE_AUX_UART), YES)
|
||||
CDEFS += -DPIOS_ENABLE_AUX_UART
|
||||
endif
|
||||
CDEFS += -DUSE_BOOTLOADER
|
||||
|
||||
ifeq ($(USE_SPEKTRUM), YES)
|
||||
CDEFS += -DUSE_SPEKTRUM
|
||||
@ -451,22 +442,9 @@ LDFLAGS += -lc -lgcc
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld
|
||||
|
||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||
# Program
|
||||
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08005000 bin"
|
||||
# Verify
|
||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08005000 bin"
|
||||
# reset target
|
||||
OOCD_CL+=-c "reset run"
|
||||
# terminate OOCD after programming
|
||||
OOCD_CL+=-c shutdown
|
||||
|
||||
|
||||
# Define programs and commands.
|
||||
REMOVE = $(REMOVE_CMD) -f
|
||||
PYTHON = python
|
||||
###SHELL = sh
|
||||
###COPY = cp
|
||||
|
||||
# List of all source files.
|
||||
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
|
||||
@ -519,14 +497,6 @@ ${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/p
|
||||
@$(PYTHON) $(PYMITETOOLS)/pmGenPmFeatures.py $(PYMITEPLAT)/pmfeatures.py > $(OUTDIR)/pmfeatures.h
|
||||
@$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -u -o $(OUTDIR)/pmlibusr_img.c --native-file=$(OUTDIR)/pmlibusr_nat.c $(FLIGHTPLANS)/test.py
|
||||
|
||||
# Program the device.
|
||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||
program: $(OUTDIR)/$(TARGET).bin
|
||||
@echo ${quote}Programming with OPENOCD${quote}
|
||||
$(OOCD_EXE) $(OOCD_CL)
|
||||
endif
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||
|
||||
@ -556,29 +526,33 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION)))
|
||||
|
||||
# Add jtag targets (program and wipe)
|
||||
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE)))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino opfw
|
||||
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
|
||||
opfw: $(OUTDIR)/$(TARGET).opfw
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
.PHONY: size
|
||||
size: $(OUTDIR)/$(TARGET).elf_size
|
||||
|
||||
# Generate Doxygen documents
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
install: $(OUTDIR)/$(TARGET).opfw
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opfw
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
@ -622,4 +596,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program gencode install
|
||||
.PHONY : all build clean clean_list gencode install
|
||||
|
@ -64,25 +64,8 @@ TIM8 | | | |
|
||||
//------------------------
|
||||
// BOOTLOADER_SETTINGS
|
||||
//------------------------
|
||||
//#define FUNC_ID 2
|
||||
//#define HW_VERSION 69
|
||||
|
||||
#define BOOTLOADER_VERSION 0
|
||||
#define BOARD_TYPE 0x02
|
||||
#define BOARD_REVISION 0x01
|
||||
//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION
|
||||
|
||||
#define MEM_SIZE 0x20000 //128K
|
||||
#define SIZE_OF_DESCRIPTION 100
|
||||
#define START_OF_USER_CODE (uint32_t)0x08002000
|
||||
#define SIZE_OF_CODE (uint32_t)(MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION)
|
||||
#ifdef STM32F10X_HD
|
||||
#define HW_TYPE 0 //0=high_density 1=medium_density;
|
||||
#elif STM32F10X_MD
|
||||
#define HW_TYPE 1 //0=high_density 1=medium_density;
|
||||
#endif
|
||||
#define BOARD_READABLE TRUE
|
||||
#define BOARD_WRITABLA TRUE
|
||||
#define BOARD_WRITABLE TRUE
|
||||
#define MAX_DEL_RETRYS 3
|
||||
|
||||
//------------------------
|
||||
@ -107,11 +90,6 @@ TIM8 | | | |
|
||||
//-------------------------
|
||||
#define PIOS_MASTER_CLOCK 72000000
|
||||
#define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2)
|
||||
#if defined(USE_BOOTLOADER)
|
||||
#define PIOS_NVIC_VECTTAB_FLASH (START_OF_USER_CODE)
|
||||
#else
|
||||
#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08000000)
|
||||
#endif
|
||||
|
||||
//-------------------------
|
||||
// Interrupt Priorities
|
||||
|
@ -60,25 +60,8 @@ TIM4 | RC In 1 | Servo 3 | Servo 2 | Servo 1
|
||||
//------------------------
|
||||
// BOOTLOADER_SETTINGS
|
||||
//------------------------
|
||||
//#define FUNC_ID 2
|
||||
//#define HW_VERSION 69
|
||||
|
||||
#define BOOTLOADER_VERSION 0
|
||||
#define BOARD_TYPE 0x04
|
||||
#define BOARD_REVISION 0x01
|
||||
//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION
|
||||
|
||||
#define MEM_SIZE 0x20000 //128K
|
||||
#define SIZE_OF_DESCRIPTION 100
|
||||
#define START_OF_USER_CODE (uint32_t)0x08003000
|
||||
#define SIZE_OF_CODE (uint32_t)(MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION)
|
||||
#ifdef STM32F10X_HD
|
||||
#define HW_TYPE 0 //0=high_density 1=medium_density;
|
||||
#elif STM32F10X_MD
|
||||
#define HW_TYPE 1 //0=high_density 1=medium_density;
|
||||
#endif
|
||||
#define BOARD_READABLE TRUE
|
||||
#define BOARD_WRITABLA TRUE
|
||||
#define BOARD_WRITABLE TRUE
|
||||
#define MAX_DEL_RETRYS 3
|
||||
|
||||
|
||||
@ -119,11 +102,6 @@ TIM4 | RC In 1 | Servo 3 | Servo 2 | Servo 1
|
||||
//-------------------------
|
||||
#define PIOS_MASTER_CLOCK 72000000
|
||||
#define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2)
|
||||
#if defined(USE_BOOTLOADER)
|
||||
#define PIOS_NVIC_VECTTAB_FLASH (START_OF_USER_CODE)
|
||||
#else
|
||||
#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08000000)
|
||||
#endif
|
||||
|
||||
//-------------------------
|
||||
// Interrupt Priorities
|
||||
|
@ -58,20 +58,8 @@ TIM4 | STOPWATCH |
|
||||
//------------------------
|
||||
// BOOTLOADER_SETTINGS
|
||||
//------------------------
|
||||
#define BOOTLOADER_VERSION 0
|
||||
#define BOARD_TYPE 0x03
|
||||
#define BOARD_REVISION 0x01
|
||||
#define MEM_SIZE ((uint32_t)(*((volatile uint16_t *)(0x1FFFF7E0))) * 1024 - 1024) //128K
|
||||
#define SIZE_OF_DESCRIPTION 100
|
||||
#define START_OF_USER_CODE (uint32_t)0x08003000
|
||||
#define SIZE_OF_CODE (uint32_t)(MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION)
|
||||
#ifdef STM32F10X_HD
|
||||
#define HW_TYPE 0 //0=high_density 1=medium_density;
|
||||
#elif STM32F10X_MD
|
||||
#define HW_TYPE 1 //0=high_density 1=medium_density;
|
||||
#endif
|
||||
#define BOARD_READABLE TRUE
|
||||
#define BOARD_WRITABLA TRUE
|
||||
#define BOARD_WRITABLE TRUE
|
||||
#define MAX_DEL_RETRYS 3
|
||||
|
||||
|
||||
@ -81,12 +69,6 @@ TIM4 | STOPWATCH |
|
||||
#define PIOS_MASTER_CLOCK 72000000ul
|
||||
#define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2)
|
||||
|
||||
#if defined(USE_BOOTLOADER)
|
||||
#define PIOS_NVIC_VECTTAB_FLASH (START_OF_USER_CODE)
|
||||
#else
|
||||
#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08000000)
|
||||
#endif
|
||||
|
||||
// *****************************************************************
|
||||
// Interrupt Priorities
|
||||
|
||||
|
@ -69,27 +69,8 @@ TIM8 | | | |
|
||||
//------------------------
|
||||
// BOOTLOADER_SETTINGS
|
||||
//------------------------
|
||||
|
||||
//#define FUNC_ID 1
|
||||
//#define HW_VERSION 01
|
||||
|
||||
#define BOOTLOADER_VERSION 0
|
||||
#define BOARD_TYPE 0x05 // INS board
|
||||
#define BOARD_REVISION 0x01 // Beta version
|
||||
//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION
|
||||
|
||||
#define MEM_SIZE 524288 //512K
|
||||
#define SIZE_OF_DESCRIPTION (uint8_t) 100
|
||||
#define START_OF_USER_CODE (uint32_t)0x08005000//REMEMBER SET ALSO IN link_stm32f10x_HD_BL.ld
|
||||
#define SIZE_OF_CODE (uint32_t) (MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION)
|
||||
|
||||
#ifdef STM32F10X_HD
|
||||
#define HW_TYPE 0 //0=high_density 1=medium_density;
|
||||
#elif STM32F10X_MD
|
||||
#define HW_TYPE 1 //0=high_density 1=medium_density;
|
||||
#endif
|
||||
#define BOARD_READABLE TRUE
|
||||
#define BOARD_WRITABLA TRUE
|
||||
#define BOARD_WRITABLE TRUE
|
||||
#define MAX_DEL_RETRYS 3
|
||||
|
||||
//------------------------
|
||||
@ -176,11 +157,6 @@ extern uint32_t pios_com_aux_id;
|
||||
//-------------------------
|
||||
#define PIOS_MASTER_CLOCK 72000000
|
||||
#define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2)
|
||||
#if defined(USE_BOOTLOADER)
|
||||
#define PIOS_NVIC_VECTTAB_FLASH (START_OF_USER_CODE)
|
||||
#else
|
||||
#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08000000)
|
||||
#endif
|
||||
|
||||
//-------------------------
|
||||
// Interrupt Priorities
|
||||
|
@ -68,27 +68,8 @@ TIM8 | Servo 5 | Servo 6 | Servo 7 | Servo 8
|
||||
//------------------------
|
||||
// BOOTLOADER_SETTINGS
|
||||
//------------------------
|
||||
|
||||
//#define FUNC_ID 1
|
||||
//#define HW_VERSION 01
|
||||
|
||||
#define BOOTLOADER_VERSION 0
|
||||
#define BOARD_TYPE 0x01 // OpenPilot board
|
||||
#define BOARD_REVISION 0x01 // Beta version
|
||||
//#define HW_VERSION (BOARD_TYPE << 8) | BOARD_REVISION
|
||||
|
||||
#define MEM_SIZE 524288 //512K
|
||||
#define SIZE_OF_DESCRIPTION (uint8_t) 100
|
||||
#define START_OF_USER_CODE (uint32_t)0x08005000//REMEMBER SET ALSO IN link_stm32f10x_HD_BL.ld
|
||||
#define SIZE_OF_CODE (uint32_t) (MEM_SIZE-(START_OF_USER_CODE-0x08000000)-SIZE_OF_DESCRIPTION)
|
||||
|
||||
#ifdef STM32F10X_HD
|
||||
#define HW_TYPE 0 //0=high_density 1=medium_density;
|
||||
#elif STM32F10X_MD
|
||||
#define HW_TYPE 1 //0=high_density 1=medium_density;
|
||||
#endif
|
||||
#define BOARD_READABLE TRUE
|
||||
#define BOARD_WRITABLA TRUE
|
||||
#define BOARD_WRITABLE TRUE
|
||||
#define MAX_DEL_RETRYS 3
|
||||
|
||||
//------------------------
|
||||
@ -203,11 +184,6 @@ extern uint32_t pios_com_spektrum_id;
|
||||
//-------------------------
|
||||
#define PIOS_MASTER_CLOCK 72000000
|
||||
#define PIOS_PERIPHERAL_CLOCK (PIOS_MASTER_CLOCK / 2)
|
||||
#if defined(USE_BOOTLOADER)
|
||||
#define PIOS_NVIC_VECTTAB_FLASH (START_OF_USER_CODE)
|
||||
#else
|
||||
#define PIOS_NVIC_VECTTAB_FLASH ((uint32_t)0x08000000)
|
||||
#endif
|
||||
|
||||
//-------------------------
|
||||
// Interrupt Priorities
|
||||
|
@ -31,6 +31,7 @@
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
#if defined(PIOS_INCLUDE_BL_HELPER)
|
||||
#include <pios_board_info.h>
|
||||
#include "stm32f10x_flash.h"
|
||||
|
||||
uint8_t *PIOS_BL_HELPER_FLASH_If_Read(uint32_t SectorAddress)
|
||||
@ -47,10 +48,10 @@ uint8_t PIOS_BL_HELPER_FLASH_Ini()
|
||||
|
||||
uint8_t PIOS_BL_HELPER_FLASH_Start()
|
||||
{
|
||||
uint32_t pageAdress;
|
||||
pageAdress = START_OF_USER_CODE;
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
uint32_t pageAdress = bdinfo->fw_base;
|
||||
uint8_t fail = FALSE;
|
||||
while ((pageAdress < START_OF_USER_CODE + SIZE_OF_CODE + SIZE_OF_DESCRIPTION)
|
||||
while ((pageAdress < (bdinfo->fw_base + bdinfo->fw_size + bdinfo->desc_size))
|
||||
|| (fail == TRUE)) {
|
||||
for (int retry = 0; retry < MAX_DEL_RETRYS; ++retry) {
|
||||
if (FLASH_ErasePage(pageAdress) == FLASH_COMPLETE) {
|
||||
@ -75,17 +76,20 @@ uint8_t PIOS_BL_HELPER_FLASH_Start()
|
||||
|
||||
uint32_t PIOS_BL_HELPER_CRC_Memory_Calc()
|
||||
{
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
|
||||
PIOS_BL_HELPER_CRC_Ini();
|
||||
CRC_ResetDR();
|
||||
CRC_CalcBlockCRC((uint32_t *) START_OF_USER_CODE, (SIZE_OF_CODE) >> 2);
|
||||
CRC_CalcBlockCRC((uint32_t *) bdinfo->fw_base, (bdinfo->fw_size) >> 2);
|
||||
return CRC_GetCRC();
|
||||
}
|
||||
|
||||
void PIOS_BL_HELPER_FLASH_Read_Description(uint8_t * array, uint8_t size)
|
||||
{
|
||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||
uint8_t x = 0;
|
||||
if (size>SIZE_OF_DESCRIPTION) size = SIZE_OF_DESCRIPTION;
|
||||
for (uint32_t i = START_OF_USER_CODE + SIZE_OF_CODE; i < START_OF_USER_CODE + SIZE_OF_CODE + size; ++i) {
|
||||
if (size > bdinfo->desc_size) size = bdinfo->desc_size;
|
||||
for (uint32_t i = bdinfo->fw_base + bdinfo->fw_size; i < bdinfo->fw_base + bdinfo->fw_size + size; ++i) {
|
||||
array[x] = *PIOS_BL_HELPER_FLASH_If_Read(i);
|
||||
++x;
|
||||
}
|
||||
|
20
flight/PiOS/Common/pios_board_info.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <pios.h>
|
||||
#include <pios_board.h>
|
||||
|
||||
#include "pios_board_info.h"
|
||||
|
||||
const struct pios_board_info __attribute__((__used__)) __attribute__((__section__(".boardinfo"))) pios_board_info_blob = {
|
||||
.magic = PIOS_BOARD_INFO_BLOB_MAGIC,
|
||||
.board_type = BOARD_TYPE,
|
||||
.board_rev = BOARD_REVISION,
|
||||
.bl_rev = BOOTLOADER_VERSION,
|
||||
.hw_type = HW_TYPE,
|
||||
.fw_base = FW_BANK_BASE,
|
||||
.fw_size = FW_BANK_SIZE - FW_DESC_SIZE,
|
||||
.desc_base = FW_BANK_BASE + FW_BANK_SIZE - FW_DESC_SIZE,
|
||||
.desc_size = FW_DESC_SIZE,
|
||||
#ifdef EE_BANK_BASE
|
||||
.ee_base = EE_BANK_BASE,
|
||||
.ee_size = EE_BANK_SIZE,
|
||||
#endif
|
||||
};
|
@ -5,6 +5,7 @@ SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
PROVIDE (pios_isr_vector_table_base = .);
|
||||
KEEP(*(.isr_vector .isr_vector.*))
|
||||
*(.text .text.* .gnu.linkonce.t.*)
|
||||
*(.glue_7t) *(.glue_7)
|
||||
@ -45,4 +46,11 @@ SECTIONS
|
||||
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
|
||||
.boardinfo :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.boardinfo))
|
||||
. = ALIGN(4);
|
||||
} > BD_INFO
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
MEMORY
|
||||
{
|
||||
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 8K
|
||||
FLASH (rx) : ORIGIN = 0x08000000 + 8K, LENGTH = 128K - 8K
|
||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
|
||||
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x02000 - 0x00080
|
||||
BD_INFO (r) : ORIGIN = 0x08002000 - 0x80, LENGTH = 0x00080
|
||||
FLASH (rx) : ORIGIN = 0x08002000, LENGTH = 0x20000 - 0x02000
|
||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x05000
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
PROVIDE(pios_board_info_blob = ORIGIN(BD_INFO));
|
||||
|
||||
_estack = 0x20004FF0;
|
||||
|
||||
/* Section Definitions */
|
||||
@ -5,6 +7,7 @@ SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
PROVIDE (pios_isr_vector_table_base = .);
|
||||
KEEP(*(.isr_vector .isr_vector.*))
|
||||
*(.text .text.* .gnu.linkonce.t.*)
|
||||
*(.glue_7t) *(.glue_7)
|
||||
|
@ -10,6 +10,7 @@ SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
PROVIDE (pios_isr_vector_table_base = .);
|
||||
KEEP(*(.isr_vector .isr_vector.*))
|
||||
*(.text .text.* .gnu.linkonce.t.*)
|
||||
*(.glue_7t) *(.glue_7)
|
||||
@ -61,6 +62,12 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
|
||||
.boardinfo :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.boardinfo))
|
||||
} > BD_INFO
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
|
@ -1,6 +1,7 @@
|
||||
MEMORY
|
||||
{
|
||||
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 12K
|
||||
FLASH (rx) : ORIGIN = 0x08000000 + 12K, LENGTH = 128K - 12K
|
||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
|
||||
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x03000 - 0x00080
|
||||
BD_INFO (r) : ORIGIN = 0x08003000 - 0x80, LENGTH = 0x00080
|
||||
FLASH (rx) : ORIGIN = 0x08003000, LENGTH = 0x20000 - 0x03000
|
||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x05000
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ PROVIDE ( vPortSVCHandler = 0 ) ;
|
||||
PROVIDE ( xPortPendSVHandler = 0 ) ;
|
||||
PROVIDE ( xPortSysTickHandler = 0 ) ;
|
||||
|
||||
PROVIDE(pios_board_info_blob = ORIGIN(BD_INFO));
|
||||
|
||||
_estack = 0x20004FF0;
|
||||
|
||||
/* Section Definitions */
|
||||
@ -10,6 +12,7 @@ SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
PROVIDE (pios_isr_vector_table_base = .);
|
||||
KEEP(*(.isr_vector .isr_vector.*))
|
||||
*(.text .text.* .gnu.linkonce.t.*)
|
||||
*(.glue_7t) *(.glue_7)
|
||||
|
@ -10,6 +10,7 @@ SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
PROVIDE (pios_isr_vector_table_base = .);
|
||||
KEEP(*(.isr_vector .isr_vector.*))
|
||||
*(.text .text.* .gnu.linkonce.t.*)
|
||||
*(.glue_7t) *(.glue_7)
|
||||
@ -50,4 +51,11 @@ SECTIONS
|
||||
|
||||
. = ALIGN(4);
|
||||
_end = . ;
|
||||
|
||||
.boardinfo :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.boardinfo))
|
||||
. = ALIGN(4);
|
||||
} > BD_INFO
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
MEMORY
|
||||
{
|
||||
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 12K
|
||||
FLASH (rx) : ORIGIN = 0x08000000 + 12K, LENGTH = 128K - 12K
|
||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
|
||||
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x03000 - 0x00080
|
||||
BD_INFO (r) : ORIGIN = 0x08003000 - 0x80, LENGTH = 0x00080
|
||||
FLASH (rx) : ORIGIN = 0x08003000, LENGTH = 0x20000 - 0x03000 - 0x00400
|
||||
EE_FLASH (rw) : ORIGIN = 0x0801FC00, LENGTH = 0x00400
|
||||
SRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x05000
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ PROVIDE ( vPortSVCHandler = 0 ) ;
|
||||
PROVIDE ( xPortPendSVHandler = 0 ) ;
|
||||
PROVIDE ( xPortSysTickHandler = 0 ) ;
|
||||
|
||||
PROVIDE(pios_board_info_blob = ORIGIN(BD_INFO));
|
||||
|
||||
_estack = 0x20004FF0;
|
||||
|
||||
/* Section Definitions */
|
||||
@ -10,6 +12,7 @@ SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
PROVIDE (pios_isr_vector_table_base = .);
|
||||
KEEP(*(.isr_vector .isr_vector.*))
|
||||
*(.text .text.* .gnu.linkonce.t.*)
|
||||
*(.glue_7t) *(.glue_7)
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
*
|
||||
* @file link_STM3210E_INS_HD_BL.ld
|
||||
* @file link_STM3210E_INS_HD_NB.ld
|
||||
* @author David "Buzz" Carlson (buzz@chebuzz.com)
|
||||
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011.
|
||||
* @brief PiOS linker for the OpenPilot INS board
|
||||
@ -24,26 +24,11 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* Memory Spaces Definitions */
|
||||
MEMORY
|
||||
{
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
FLASH (rx) : ORIGIN = 0x08005000, LENGTH = 492K
|
||||
FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
}
|
||||
|
||||
_estack = 0x20004FF0;
|
||||
|
||||
/* This is the size of the stack for early init and for all FreeRTOS IRQs */
|
||||
_irq_stack_size = 0x400;
|
||||
|
||||
/* Check valid alignment for VTOR */
|
||||
ASSERT(ORIGIN(FLASH) == ALIGN(ORIGIN(FLASH), 0x80), "Start of memory region flash not aligned for startup vector table");
|
||||
ASSERT(ORIGIN(BL_FLASH) == ALIGN(ORIGIN(BL_FLASH), 0x80), "Start of memory region flash not aligned for startup vector table");
|
||||
|
||||
/*
|
||||
this sends all unreferenced IRQHandlers to reset
|
||||
@ -208,9 +193,10 @@ SECTIONS
|
||||
/* for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, which goes to FLASH */
|
||||
.isr_vector :
|
||||
{
|
||||
PROVIDE (pios_isr_vector_table_base = .);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
} > BL_FLASH
|
||||
|
||||
/* for some STRx devices, the beginning of the startup code is stored in the .flashtext section, which goes to FLASH */
|
||||
.flashtext :
|
||||
@ -218,7 +204,7 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
*(.flashtext) /* Startup code */
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
} > BL_FLASH
|
||||
|
||||
|
||||
/* init sections */
|
||||
@ -229,7 +215,7 @@ SECTIONS
|
||||
KEEP(*(.initcalluavobj.init))
|
||||
. = ALIGN(4);
|
||||
__uavobj_initcall_end = .;
|
||||
} >FLASH
|
||||
} > BL_FLASH
|
||||
|
||||
/* the program code is stored in the .text section, which goes to Flash */
|
||||
.text :
|
||||
@ -247,7 +233,7 @@ SECTIONS
|
||||
_etext = .;
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
_sidata = _etext;
|
||||
} >FLASH
|
||||
} > BL_FLASH
|
||||
|
||||
|
||||
/*
|
||||
@ -354,6 +340,13 @@ SECTIONS
|
||||
__exidx_start = .;
|
||||
__exidx_end = .;
|
||||
|
||||
.boardinfo :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.boardinfo))
|
||||
. = ALIGN(4);
|
||||
} > BD_INFO
|
||||
|
||||
/* after that it's only debugging information. */
|
||||
|
||||
/* remove the debugging information from the standard libraries */
|
13
flight/PiOS/STM32F10x/link_STM3210E_INS_memory.ld
Normal file
@ -0,0 +1,13 @@
|
||||
/* Memory Spaces Definitions */
|
||||
MEMORY
|
||||
{
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x10000
|
||||
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x05000 - 0x00080
|
||||
BD_INFO (r) : ORIGIN = 0x08005000 - 0x80, LENGTH = 0x00080
|
||||
FLASH (rx) : ORIGIN = 0x08005000, LENGTH = 0x80000 - 0x05000
|
||||
FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
}
|
@ -24,21 +24,6 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* Memory Spaces Definitions */
|
||||
MEMORY
|
||||
{
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
|
||||
FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
}
|
||||
|
||||
_estack = 0x20004FF0;
|
||||
|
||||
/* This is the size of the stack for early init and for all FreeRTOS IRQs */
|
||||
_irq_stack_size = 0x400;
|
||||
|
||||
@ -62,10 +47,10 @@ PROVIDE ( HardFault_Handler = 0 ) ;
|
||||
PROVIDE ( MemManage_Handler = 0 ) ;
|
||||
PROVIDE ( BusFault_Handler = 0 ) ;
|
||||
PROVIDE ( UsageFault_Handler = 0 ) ;
|
||||
PROVIDE ( SVC_Handler = 0 ) ;
|
||||
PROVIDE ( vPortSVCHandler = 0 ) ;
|
||||
PROVIDE ( DebugMon_Handler = 0 ) ;
|
||||
PROVIDE ( PendSV_Handler = 0 ) ;
|
||||
PROVIDE ( SysTick_Handler = 0 ) ;
|
||||
PROVIDE ( xPortPendSVHandler = 0 ) ;
|
||||
PROVIDE ( xPortSysTickHandler = 0 ) ;
|
||||
|
||||
PROVIDE ( WWDG_IRQHandler = 0 ) ;
|
||||
PROVIDE ( PVD_IRQHandler = 0 ) ;
|
||||
@ -199,18 +184,19 @@ PROVIDE ( SysTick = (SCS_BASE + 0x0010) ) ;
|
||||
PROVIDE ( NVIC = (SCS_BASE + 0x0100) ) ;
|
||||
PROVIDE ( SCB = (SCS_BASE + 0x0D00) ) ;
|
||||
|
||||
PROVIDE(pios_board_info_blob = ORIGIN(BD_INFO));
|
||||
|
||||
/* Sections Definitions */
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
/* for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, which goes to FLASH */
|
||||
.isr_vector :
|
||||
{
|
||||
PROVIDE (pios_isr_vector_table_base = .);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
} > FLASH
|
||||
|
||||
/* for some STRx devices, the beginning of the startup code is stored in the .flashtext section, which goes to FLASH */
|
||||
.flashtext :
|
||||
@ -218,7 +204,7 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
*(.flashtext) /* Startup code */
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
} > FLASH
|
||||
|
||||
|
||||
/* init sections */
|
||||
@ -229,7 +215,7 @@ SECTIONS
|
||||
KEEP(*(.initcalluavobj.init))
|
||||
. = ALIGN(4);
|
||||
__uavobj_initcall_end = .;
|
||||
} >FLASH
|
||||
} > FLASH
|
||||
|
||||
/* the program code is stored in the .text section, which goes to Flash */
|
||||
.text :
|
||||
@ -247,7 +233,7 @@ SECTIONS
|
||||
_etext = .;
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
_sidata = _etext;
|
||||
} >FLASH
|
||||
} > FLASH
|
||||
|
||||
|
||||
/*
|
@ -2,7 +2,7 @@
|
||||
_irq_stack_size = 0x400;
|
||||
|
||||
/* Check valid alignment for VTOR */
|
||||
ASSERT(ORIGIN(FLASH) == ALIGN(ORIGIN(FLASH), 0x80), "Start of memory region flash not aligned for startup vector table");
|
||||
ASSERT(ORIGIN(BL_FLASH) == ALIGN(ORIGIN(BL_FLASH), 0x80), "Start of memory region flash not aligned for startup vector table");
|
||||
|
||||
/*
|
||||
this sends all unreferenced IRQHandlers to reset
|
||||
@ -163,10 +163,10 @@ PROVIDE ( SCB = (SCS_BASE + 0x0D00) ) ;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
/* for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, which goes to FLASH */
|
||||
.isr_vector :
|
||||
{
|
||||
PROVIDE (pios_isr_vector_table_base = .);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
. = ALIGN(4);
|
||||
} > BL_FLASH
|
||||
@ -313,6 +313,13 @@ SECTIONS
|
||||
__exidx_start = .;
|
||||
__exidx_end = .;
|
||||
|
||||
.boardinfo :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.boardinfo))
|
||||
. = ALIGN(4);
|
||||
} > BD_INFO
|
||||
|
||||
/* after that it's only debugging information. */
|
||||
|
||||
/* remove the debugging information from the standard libraries */
|
||||
|
@ -1,8 +1,9 @@
|
||||
MEMORY
|
||||
{
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
|
||||
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 20K
|
||||
FLASH (rx) : ORIGIN = 0x08000000 + 20K, LENGTH = 512K - 20K
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x10000
|
||||
BL_FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 0x05000 - 0x00080
|
||||
BD_INFO (r) : ORIGIN = 0x08005000 - 0x80, LENGTH = 0x00080
|
||||
FLASH (rx) : ORIGIN = 0x08005000, LENGTH = 0x80000 - 0x05000
|
||||
FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
|
||||
|
@ -158,15 +158,16 @@ PROVIDE ( SysTick = (SCS_BASE + 0x0010) ) ;
|
||||
PROVIDE ( NVIC = (SCS_BASE + 0x0100) ) ;
|
||||
PROVIDE ( SCB = (SCS_BASE + 0x0D00) ) ;
|
||||
|
||||
PROVIDE(pios_board_info_blob = ORIGIN(BD_INFO));
|
||||
|
||||
/* Sections Definitions */
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
/* for Cortex devices, the beginning of the startup code is stored in the .isr_vector section, which goes to FLASH */
|
||||
.isr_vector :
|
||||
{
|
||||
PROVIDE (pios_isr_vector_table_base = .);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
@ -208,7 +209,6 @@ SECTIONS
|
||||
_sidata = _etext;
|
||||
} >FLASH
|
||||
|
||||
|
||||
/*
|
||||
* This stack is used both as the initial sp during early init as well as ultimately
|
||||
* being used as the STM32's MSP (Main Stack Pointer) which is the same stack that
|
||||
|
@ -104,6 +104,28 @@ int32_t PIOS_DELAY_WaitmS(uint16_t mS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Query the Delay timer for the current uS
|
||||
* @return A microsecond value
|
||||
*/
|
||||
uint16_t PIOS_DELAY_GetuS()
|
||||
{
|
||||
return PIOS_DELAY_TIMER->CNT;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Compute the difference between now and a reference time
|
||||
* @param[in] the reference time to compare now to
|
||||
* @return The number of uS since the delay
|
||||
*
|
||||
* @note the user is responsible for worrying about rollover on the 16 bit uS counter
|
||||
*/
|
||||
int32_t PIOS_DELAY_DiffuS(uint16_t ref)
|
||||
{
|
||||
int32_t ret_t = ref;
|
||||
return (int16_t) (PIOS_DELAY_GetuS() - ret_t);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -186,7 +186,8 @@ int32_t PIOS_SYS_SerialNumberGet(char *str)
|
||||
void NVIC_Configuration(void)
|
||||
{
|
||||
/* Set the Vector Table base address as specified in .ld file */
|
||||
NVIC_SetVectorTable(PIOS_NVIC_VECTTAB_FLASH, 0x0);
|
||||
extern void pios_isr_vector_table_base;
|
||||
NVIC_SetVectorTable((uint32_t)&pios_isr_vector_table_base, 0x0);
|
||||
|
||||
/* 4 bits for Interrupt priorities so no sub priorities */
|
||||
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
|
||||
|
17
flight/PiOS/inc/pios_board_info.h
Normal file
@ -0,0 +1,17 @@
|
||||
#define PIOS_BOARD_INFO_BLOB_MAGIC 0xBDBDBDBD
|
||||
|
||||
struct pios_board_info {
|
||||
uint32_t magic;
|
||||
uint8_t board_type;
|
||||
uint8_t board_rev;
|
||||
uint8_t bl_rev;
|
||||
uint8_t hw_type;
|
||||
uint32_t fw_base;
|
||||
uint32_t fw_size;
|
||||
uint32_t desc_base;
|
||||
uint32_t desc_size;
|
||||
uint32_t ee_base;
|
||||
uint32_t ee_size;
|
||||
} __attribute__((packed));
|
||||
|
||||
extern const struct pios_board_info pios_board_info_blob;
|
@ -36,6 +36,8 @@
|
||||
extern int32_t PIOS_DELAY_Init(void);
|
||||
extern int32_t PIOS_DELAY_WaituS(uint16_t uS);
|
||||
extern int32_t PIOS_DELAY_WaitmS(uint16_t mS);
|
||||
extern uint16_t PIOS_DELAY_GetuS();
|
||||
extern int32_t PIOS_DELAY_DiffuS(uint16_t ref);
|
||||
|
||||
#endif /* PIOS_DELAY_H */
|
||||
|
||||
|
@ -25,6 +25,13 @@
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
TOP := $(realpath $(WHEREAMI)/../../)
|
||||
include $(TOP)/make/firmware-defs.mk
|
||||
include $(TOP)/make/boards/$(BOARD_NAME)/board-info.mk
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET := fw_$(BOARD_NAME)
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR := $(TOP)/build/$(TARGET)
|
||||
|
||||
# Debugging (YES/NO) ?
|
||||
DEBUG ?= NO
|
||||
@ -43,23 +50,6 @@ FLASH_TOOL = OPENOCD
|
||||
# Include the USB files (YES/NO) ?
|
||||
USE_USB = YES
|
||||
|
||||
# MCU name, submodel and board
|
||||
# - MCU used for compiler-option (-mcpu)
|
||||
# - MODEL used for linker-script name (-T) and passed as define
|
||||
# - BOARD just passed as define (optional)
|
||||
MCU = cortex-m3
|
||||
CHIP = STM32F103CBT
|
||||
BOARD = STM32103CB_PIPXTREME
|
||||
#CHIP = STM32F103C8T
|
||||
#BOARD = STM32103C8_PIPXTREME
|
||||
MODEL = MD
|
||||
|
||||
# Directory for output files (lst, obj, dep, elf, sym, map, hex, bin etc.)
|
||||
OUTDIR = $(TOP)/build/pipxtreme
|
||||
|
||||
# Target file name (without extension).
|
||||
TARGET = PipXtreme
|
||||
|
||||
# Paths
|
||||
HOME_DIR = ./
|
||||
HOME_DIR_INC = $(HOME_DIR)/inc
|
||||
@ -192,7 +182,7 @@ CPPSRCARM =
|
||||
# Even though the DOS/Win* filesystem matches both .s and .S the same,
|
||||
# it will preserve the spelling of the filenames, and gcc itself does
|
||||
# care about how the name is spelled on its command-line.
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL).S
|
||||
ASRC = $(PIOSSTM32F10X)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
|
||||
|
||||
# List Assembler source files here which must be assembled in ARM-Mode..
|
||||
ASRCARM =
|
||||
@ -257,7 +247,6 @@ DEBUGF = dwarf-2
|
||||
CDEFS = -DSTM32F10X_$(MODEL)
|
||||
CDEFS += -DUSE_STDPERIPH_DRIVER
|
||||
CDEFS += -DUSE_$(BOARD)
|
||||
CDEFS += -DUSE_BOOTLOADER
|
||||
|
||||
# Place project-specific -D and/or -U options for
|
||||
# Assembler with preprocessor here.
|
||||
@ -340,20 +329,8 @@ LDFLAGS += -lc -lgcc
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_memory.ld
|
||||
LDFLAGS += -T$(LINKERSCRIPTPATH)/link_$(BOARD)_sections.ld
|
||||
|
||||
OOCD_LOADFILE+=$(OUTDIR)/$(TARGET).bin
|
||||
# Program
|
||||
OOCD_CL+=-c "flash write_image erase $(OOCD_LOADFILE) 0x08003000 bin"
|
||||
# Verify
|
||||
OOCD_CL+=-c "verify_image $(OOCD_LOADFILE) 0x08003000 bin"
|
||||
# reset target
|
||||
OOCD_CL+=-c "reset run"
|
||||
# terminate OOCD after programming
|
||||
OOCD_CL+=-c shutdown
|
||||
|
||||
# Define programs and commands.
|
||||
REMOVE = $(REMOVE_CMD) -f
|
||||
###SHELL = sh
|
||||
###COPY = cp
|
||||
|
||||
# List of all source files.
|
||||
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
|
||||
@ -385,14 +362,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Program the device.
|
||||
ifeq ($(FLASH_TOOL),OPENOCD)
|
||||
# Program the device with Dominic Rath's OPENOCD in "batch-mode", needs cfg and "reset-script".
|
||||
program: $(OUTDIR)/$(TARGET).bin
|
||||
@echo ${quote}Programming with OPENOCD${quote}
|
||||
$(OOCD_EXE) $(OOCD_CL)
|
||||
endif
|
||||
|
||||
# Link: create ELF output file from object files.
|
||||
$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ)))
|
||||
|
||||
@ -422,29 +391,33 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION)))
|
||||
|
||||
# Add jtag targets (program and wipe)
|
||||
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE)))
|
||||
|
||||
.PHONY: elf lss sym hex bin bino opfw
|
||||
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
|
||||
opfw: $(OUTDIR)/$(TARGET).opfw
|
||||
|
||||
# Display sizes of sections.
|
||||
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
.PHONY: size
|
||||
size: $(OUTDIR)/$(TARGET).elf_size
|
||||
|
||||
# Generate Doxygen documents
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
install: $(OUTDIR)/$(TARGET).opfw
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opfw
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
@ -486,4 +459,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program install
|
||||
.PHONY : all build clean clean_list install
|
||||
|
@ -1,7 +1,6 @@
|
||||
include(../openpilotgcs.pri)
|
||||
include(openpilotgcs.pri)
|
||||
|
||||
TEMPLATE = subdirs
|
||||
SUBDIRS = winx86
|
||||
|
||||
# Copy Qt runtime libraries into the build directory (to run or package)
|
||||
equals(copydata, 1) {
|
||||
@ -53,11 +52,21 @@ equals(copydata, 1) {
|
||||
data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_PLUGINS]/sqldrivers/$$dll\") $$targetPath(\"$$GCS_APP_PATH/sqldrivers/$$dll\") $$addNewline()
|
||||
}
|
||||
|
||||
# copy SDL (if available) - Simple DirectMedia Layer (www.libsdl.org)
|
||||
# copy SDL - Simple DirectMedia Layer (www.libsdl.org)
|
||||
# Check the wiki for SDL installation, it should be copied first
|
||||
# (make sure that the Qt installation path below is correct)
|
||||
#
|
||||
# - For qt-sdk-win-opensource-2010.05.exe:
|
||||
# xcopy /s /e <SDL>\bin\SDL.dll C:\Qt\2010.05\mingw\bin\SDL.dll
|
||||
# xcopy /s /e <SDL>\include\SDL\* C:\Qt\2010.05\mingw\include\SDL
|
||||
# xcopy /s /e <SDL>\lib\* C:\Qt\2010.05\mingw\lib
|
||||
#
|
||||
# - For Qt_SDK_Win_offline_v1_1_1_en.exe:
|
||||
# xcopy /s /e <SDL>\bin\SDL.dll C:\QtSDK\Desktop\Qt\4.7.3\mingw\bin\SDL.dll
|
||||
# xcopy /s /e <SDL>\include\SDL\* C:\QtSDK\Desktop\Qt\4.7.3\mingw\include\SDL
|
||||
# xcopy /s /e <SDL>\lib\* C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib
|
||||
SDL_DLL = SDL.dll
|
||||
exists($$targetPath(\"$$[QT_INSTALL_BINS]/../../mingw/bin/$$SDL_DLL\")) {
|
||||
data_copy.commands += $(COPY_FILE) $$targetPath(\"$$[QT_INSTALL_BINS]/../../mingw/bin/$$SDL_DLL\") $$targetPath(\"$$GCS_APP_PATH/$$SDL_DLL\") $$addNewline()
|
||||
}
|
||||
|
||||
data_copy.target = FORCE
|
||||
QMAKE_EXTRA_TARGETS += data_copy
|
@ -9,5 +9,7 @@ include(openpilotgcs.pri)
|
||||
TEMPLATE = subdirs
|
||||
CONFIG += ordered
|
||||
|
||||
SUBDIRS = src share packaging
|
||||
SUBDIRS = src share copydata
|
||||
unix:!macx:!isEmpty(copydata):SUBDIRS += bin
|
||||
|
||||
copydata.file = copydata.pro
|
||||
|
@ -1,86 +0,0 @@
|
||||
@echo off
|
||||
rem
|
||||
rem make_header - a workaround to build NSIS version info header from
|
||||
rem Makefile using different environments (Windows cmd or Unix-like sh)
|
||||
rem still being more or less portable.
|
||||
rem
|
||||
rem This script tries to find any git command line utility on the system.
|
||||
rem First, it looks at the predefined location of git.exe installed by
|
||||
rem msysgit package available at http://code.google.com/p/msysgit/
|
||||
rem If not found, it searches for git executables in the system PATH.
|
||||
rem If also not found, then it gives up and no commit info will be available.
|
||||
rem
|
||||
rem Expected parameters:
|
||||
rem %1: repository source path
|
||||
rem %2: header file full path and name
|
||||
rem
|
||||
|
||||
rem FIXME: we should have product version info somewhere else
|
||||
set OUT_FILE=OpenPilotGCS-%%%%ad-%%%%h-install.exe
|
||||
set PRODUCT_VERSION=0.0.0.0
|
||||
set FILE_VERSION=%%%%ad %%BRANCH%%:%%%%h
|
||||
set BUILD_DESCRIPTION=Built using %%ORIGIN%% as origin, branch %%BRANCH%%, commit %%%%H, committed %%%%ci
|
||||
|
||||
set REPO=%1
|
||||
set HEADER=%2
|
||||
if "%REPO%" == "" goto NoRepo
|
||||
if "%HEADER%" == "" goto NoHeader
|
||||
goto OK
|
||||
|
||||
:NoRepo
|
||||
:NoHeader
|
||||
echo This script should be called from Makefile only
|
||||
goto :eof
|
||||
|
||||
:Ok
|
||||
rem Looking for git command line utility at the predefined msysgit location
|
||||
rem first, and in the PATH last. Also note that we use call command which is
|
||||
rem required if we execute a .cmd or .bat file instead of .exe
|
||||
|
||||
set GIT=%ProgramFiles%\Git\bin\git.exe
|
||||
if exist "%GIT%" goto Found
|
||||
|
||||
for %%G in (git.exe) do set GIT=%%~$PATH:G
|
||||
if exist "%GIT%" goto Found
|
||||
|
||||
for %%G in (git.cmd) do set GIT=%%~$PATH:G
|
||||
if exist "%GIT%" goto Found
|
||||
|
||||
for %%G in (git.bat) do set GIT=%%~$PATH:G
|
||||
if exist "%GIT%" goto Found
|
||||
|
||||
:NotFound
|
||||
echo git not found, no version info available
|
||||
goto :eof
|
||||
|
||||
:Found
|
||||
echo Using "%GIT%" to extract version info from "%REPO%"...
|
||||
|
||||
rem Getting remote origin name
|
||||
for /F "usebackq tokens=1-3" %%G in (`call "%GIT%" remote -v`) do (
|
||||
if "%%G" == "origin" if "%%I" == "(fetch)" set ORIGIN=%%H
|
||||
)
|
||||
|
||||
rem Getting branch name
|
||||
for /F "usebackq tokens=1,2" %%G in (`call "%GIT%" branch --no-color`) do (
|
||||
if "%%G" == "*" set BRANCH=%%H
|
||||
)
|
||||
|
||||
rem Getting commit info
|
||||
set OPTS=-1 --no-color --date=short
|
||||
set OPTS=%OPTS% "--format=format:
|
||||
set OPTS=%OPTS%;%%%%n
|
||||
set OPTS=%OPTS%; AUTOGENERATED HEADER FILE%%%%n
|
||||
set OPTS=%OPTS%;%%%%n
|
||||
set OPTS=%OPTS%%%%%n
|
||||
set OPTS=%OPTS%; Installer file name%%%%n
|
||||
set OPTS=%OPTS%!define OUT_FILE \"%OUT_FILE%\"%%%%n
|
||||
set OPTS=%OPTS%%%%%n
|
||||
set OPTS=%OPTS%; Installer version info%%%%n
|
||||
set OPTS=%OPTS%!define PRODUCT_VERSION \"%PRODUCT_VERSION%\"%%%%n
|
||||
set OPTS=%OPTS%!define FILE_VERSION \"%FILE_VERSION%\"%%%%n
|
||||
set OPTS=%OPTS%!define BUILD_DESCRIPTION \"%BUILD_DESCRIPTION%\"%%%%n"
|
||||
|
||||
pushd "%REPO%"
|
||||
call "%GIT%" log %OPTS% >%HEADER%
|
||||
popd
|
@ -1,19 +0,0 @@
|
||||
@echo off
|
||||
rem
|
||||
rem NSIS installer script file for OpenPilot GCS
|
||||
rem The OpenPilot Team, http://www.openpilot.org, Copyright (C) 2010-2011.
|
||||
rem
|
||||
rem This script requires Unicode NSIS 2.46 or higher:
|
||||
rem http://www.scratchpaper.com/
|
||||
rem
|
||||
|
||||
rem Set path to NSIS compiler
|
||||
set NSIS=%ProgramFiles%/NSIS/Unicode
|
||||
set NSISC=%NSIS%/makensis.exe
|
||||
|
||||
rem Input script file (in the same directory as this batch file)
|
||||
for %%D in (%0) do set NSI=%%~dD%%~pD\openpilotgcs.nsi
|
||||
|
||||
rem Build installer
|
||||
echo Generating Windows installer...
|
||||
"%NSISC%" /V3 %NSI%
|
@ -1,11 +0,0 @@
|
||||
#
|
||||
# git not found, default values used instead.
|
||||
#
|
||||
|
||||
; Installer file name
|
||||
!define OUT_FILE "OpenPilotGCS-unreleased-install.exe"
|
||||
|
||||
; Installer version info
|
||||
!define PRODUCT_VERSION "0.0.0.0"
|
||||
!define FILE_VERSION "0.0.0.0"
|
||||
!define BUILD_DESCRIPTION "Unreleased version."
|
@ -1,50 +0,0 @@
|
||||
include(../../openpilotgcs.pri)
|
||||
|
||||
TEMPLATE = subdirs
|
||||
|
||||
# Some Windows packaging magic (for release build only)
|
||||
equals(copydata, 1):win32:CONFIG(release, debug|release) {
|
||||
|
||||
# We need this Windows macro since building under Unix-like shell the top level
|
||||
# targetPath macro will use forward slashes which don't work for such Windows
|
||||
# commands like pushd, etc. But note that we still use targetPath for $(COPY_FILE)
|
||||
# parameters because this command is different under native Windows and Unix-like
|
||||
# build environments.
|
||||
defineReplace(winTargetPath) {
|
||||
return($$replace(1, /, \\))
|
||||
}
|
||||
|
||||
# Some file locations
|
||||
WINX86_PATH = packaging/winx86
|
||||
NSIS_HEADER = openpilotgcs.nsh
|
||||
HEADER_MAKER = make_header.cmd
|
||||
INSTALLER_MAKER = make_installer.cmd
|
||||
|
||||
# copy defaults first (will be used if no git available)
|
||||
git.commands += @echo Copying default version info... $$addNewline()
|
||||
git.commands += $(COPY_FILE)
|
||||
git.commands += $$targetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$NSIS_HEADER)
|
||||
git.commands += $$targetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$NSIS_HEADER)
|
||||
git.commands += $$addNewline()
|
||||
|
||||
# extract repository info if command line git is available
|
||||
git.commands += $$winTargetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$HEADER_MAKER)
|
||||
git.commands += $$winTargetPath($$GCS_SOURCE_TREE)
|
||||
git.commands += $$winTargetPath($$GCS_BUILD_TREE/$$WINX86_PATH/$$NSIS_HEADER)
|
||||
git.commands += $$addNewline()
|
||||
|
||||
git.target = git.dummy
|
||||
QMAKE_EXTRA_TARGETS += git
|
||||
force.depends += git
|
||||
|
||||
# Redefine FORCE target to collect data every time
|
||||
force.target = FORCE
|
||||
QMAKE_EXTRA_TARGETS += force
|
||||
|
||||
# Create installer build target - this WILL NOT run during build, run it by hand
|
||||
message("Run \"make gcs_installer\" in $$GCS_BUILD_TREE/$$WINX86_PATH to build Windows installer (Unicode NSIS 2.46+ required)")
|
||||
nsis.target = gcs_installer
|
||||
nsis.depends = git
|
||||
nsis.commands += @$$winTargetPath($$GCS_SOURCE_TREE/$$WINX86_PATH/$$INSTALLER_MAKER)
|
||||
QMAKE_EXTRA_TARGETS += nsis
|
||||
}
|
@ -324,13 +324,5 @@ int main(int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
// OP_DFU dfu(true);
|
||||
// //dfu.findDevices();
|
||||
// dfu.enterDFU(1);
|
||||
// dfu.UploadFirmware("c:/ahrs.bin",true,1);
|
||||
// // dfu.UploadDescription("josemanuel");
|
||||
// // QString str=dfu.DownloadDescription(12);
|
||||
// dfu.JumpToApp();
|
||||
// qDebug()<<"Description="<<str;
|
||||
return a.exec();
|
||||
}
|
||||
|
@ -56,7 +56,9 @@ OP_DFU::OP_DFU(bool _debug,bool _use_serial,QString portname,bool umodereset): d
|
||||
{
|
||||
cout<<".";
|
||||
delay::msleep(500);
|
||||
numDevices = hidHandle.open(1,0x20a0,0x4117,0,0); //0xff9c,0x0001);
|
||||
numDevices = hidHandle.open(1,0x20a0,0x415A,0,0); //0xff9c,0x0001);
|
||||
if(numDevices==0)
|
||||
numDevices = hidHandle.open(1,0x20a0,0x415B,0,0); //0xff9c,0x0001);
|
||||
if(++count==10)
|
||||
{
|
||||
cout<<"\r";
|
||||
|
@ -138,7 +138,7 @@ struct PortSettings
|
||||
#include <windows.h>
|
||||
#include <QThread>
|
||||
#include <QReadWriteLock>
|
||||
#include <QtCore/private/qwineventnotifier_p.h>
|
||||
#include "utils/qwineventnotifier_p.h"
|
||||
#endif
|
||||
|
||||
/*!
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QTemporaryFile>
|
||||
#include <QtCore/QAbstractEventDispatcher>
|
||||
#include <QtCore/private/qwineventnotifier_p.h>
|
||||
#include "qwineventnotifier_p.h"
|
||||
|
||||
#include <QtNetwork/QLocalSocket>
|
||||
|
||||
|
94
ground/openpilotgcs/src/libs/utils/qwineventnotifier_p.h
Normal file
@ -0,0 +1,94 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the QtCore module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QWINEVENTNOTIFIER_P_H
|
||||
#define QWINEVENTNOTIFIER_P_H
|
||||
|
||||
//
|
||||
// W A R N I N G
|
||||
// -------------
|
||||
//
|
||||
// This file is not part of the Qt API. It exists for the convenience
|
||||
// of other Qt classes. This header file may change from version to
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
#include "QtCore/qobject.h"
|
||||
#include "QtCore/qt_windows.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Q_CORE_EXPORT QWinEventNotifier : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DECLARE_PRIVATE(QObject)
|
||||
|
||||
public:
|
||||
explicit QWinEventNotifier(QObject *parent = 0);
|
||||
explicit QWinEventNotifier(HANDLE hEvent, QObject *parent = 0);
|
||||
~QWinEventNotifier();
|
||||
|
||||
void setHandle(HANDLE hEvent);
|
||||
HANDLE handle() const;
|
||||
|
||||
bool isEnabled() const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void setEnabled(bool enable);
|
||||
|
||||
Q_SIGNALS:
|
||||
void activated(HANDLE hEvent);
|
||||
|
||||
protected:
|
||||
bool event(QEvent * e);
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QWinEventNotifier)
|
||||
|
||||
HANDLE handleToEvent;
|
||||
bool enabled;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QWINEVENTNOTIFIER_P_H
|
@ -17,7 +17,7 @@
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabWidgetPage1">
|
||||
<attribute name="title">
|
||||
@ -102,7 +102,7 @@
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="airframesWidget">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="fixedWing">
|
||||
<property name="enabled">
|
||||
|
Before Width: | Height: | Size: 436 KiB After Width: | Height: | Size: 438 KiB |
@ -17,7 +17,7 @@
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
@ -993,8 +993,8 @@ Neutral should be put at the bottom of the slider for the throttle.</string>
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt; font-weight:600; color:#ff0000;">BEWARE: make sure your engines are not connected when running calibration!</span></p></body></html></string>
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:10pt; font-weight:600; color:#ff0000;">BEWARE: make sure your engines are not connected when running calibration!</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSlider" name="inSlider0">
|
||||
|
@ -1,8 +1,8 @@
|
||||
<html>
|
||||
<p>This is a credits file of people that are or have been key contributors to the OpenPilot project.
|
||||
Without the work of the people in this file OpenPilot would not be what it is today.
|
||||
Without the work of the people in this file OpenPilot would not be what it is today.</p>
|
||||
|
||||
<p>It is sorted alphabetically by name and formatted so that it allows for easy grepping and beautification by scripts.
|
||||
<p>It is sorted alphabetically by name and formatted so that it allows for easy grepping and beautification by scripts.</p>
|
||||
|
||||
<pre>
|
||||
The fields are:
|
||||
@ -40,11 +40,6 @@ E: chebuzz (plus) openpilot (at) gmail (dot) com
|
||||
D: 3D ModelView GCS Plugin, sponsor of HITL merge work and XPlane addition
|
||||
M: 3D Modelview
|
||||
|
||||
N: Eric Price
|
||||
E: corvus (dot) corax (at) cybertrench (dot) com
|
||||
D: IL2 HITL GCS Plugin, Posix OpenPilot, Advanced stabilisation module
|
||||
M: SITL Posix
|
||||
|
||||
N: James Cotton
|
||||
E: peabody124 (plus) openpilot (at) gmail (dot) com
|
||||
D: Multiplatform HID implementation (firmware & GCS), GCS Joystick control
|
||||
@ -85,16 +80,25 @@ D: Creator of http://pythononachip.org
|
||||
|
||||
N: Joe Hlebasko
|
||||
E: joe (dot) hlebasko(plus) openpilot (at) gmail (dot) com
|
||||
D: Version 3 Main Board routing
|
||||
D: Production Main Board & Production OP GPS
|
||||
M: Hardware Architecture Team
|
||||
|
||||
N: Mark James
|
||||
E: mjames (plus) openpilot (at) gmail (dot) com
|
||||
D: Some of Silk Icon set used in GCS - http://www.famfamfam.com/lab/icons/silk
|
||||
|
||||
N: Sami Korhonen
|
||||
E: samik (dot) korhonen (plus) openpilot (at) gmail (dot) com
|
||||
D: GPS Module, Spektrum RC Module
|
||||
D: GPS Module, Spektrum RC Module, OSD work
|
||||
|
||||
N: Thorsten Klose
|
||||
E: thorsten.klose (at) dmx (dot) de
|
||||
E: thorsten (dot) klose (at) dmx (dot) de
|
||||
D: Embedded STM32 infrastructure
|
||||
|
||||
N: Hallvard Kristiansen
|
||||
E: hal (at) fleshmx (dot) com
|
||||
D: GCS Artwork, Quad layout diagrams
|
||||
|
||||
N: Edouard Lafargue
|
||||
E: edouard (at) lafargue (dot) name
|
||||
D: GCS Dial Plugins, GCS PFD Plugin, GCS GPS plugin, GCS Config plugin
|
||||
@ -121,7 +125,7 @@ N: Cathy Moss
|
||||
E: cmoss296 (at) blueyonder (dot) co (dot) uk
|
||||
D: Hardware design Lead: Gen 2 Mainboard, PipXtreme, Current Sensor
|
||||
D: Lead dev PipXtreme, creator OP Map Plugin
|
||||
M: PipX Modems
|
||||
M: Hardware Architecture Team / PipX Modem
|
||||
|
||||
N: Angus Peart
|
||||
E: gussy (at) openpilot (dot) org
|
||||
@ -129,6 +133,11 @@ D: Co-founder, Principal hardware architect.
|
||||
D: Hardware design of OpenPilot, AHRS, GPS and other hardware
|
||||
D: Core developer embedded code
|
||||
|
||||
N: Eric Price
|
||||
E: corvus (dot) corax (at) cybertrench (dot) com
|
||||
D: IL2 HITL GCS Plugin, Posix OpenPilot, Advanced stabilisation module
|
||||
M: SITL Posix
|
||||
|
||||
N: Richard Querin
|
||||
E: rfquerin (plus) openpilot (at) gmail (dot) com
|
||||
D: Graphic Design, OpenPilot Logo
|
||||
@ -139,7 +148,7 @@ D: The GLC_lib as used in the ModelView Plugin
|
||||
D: See: http://www.glc-lib.net/
|
||||
|
||||
N: Julien Rouviere
|
||||
E: julien.rouviere (plus) openpilot (at) gmail (dot) com
|
||||
E: julien (dot) rouviere (plus) openpilot (at) gmail (dot) com
|
||||
D: GCS Core Developer
|
||||
D: GCS Framework and Plugins for the GCS
|
||||
|
||||
@ -152,6 +161,13 @@ E: dales (at) ksu (dot) edu
|
||||
D: Lead AHRS Developer
|
||||
D: Creator of the OpenPilot INS / EKF
|
||||
|
||||
N: Oleg Semyonov
|
||||
E: os-openpilot-org (at) os-propo (dot) info
|
||||
D: Core tester & Project organisation
|
||||
M: Common part of multi-platform packaging system
|
||||
M: Windows NSIS Installer
|
||||
M: Russian Documentation Lead
|
||||
|
||||
N: Stacey Sheldon
|
||||
E: stac (at) solidgoldbomb (dot) org
|
||||
D: Core Embedded Developer
|
||||
@ -160,6 +176,7 @@ D: SPI protocol for AHRS, I2C rewrite and much core work
|
||||
N: Troy Schultz
|
||||
E: troy (dot) schultz (at) rogers (dot) com
|
||||
D: INS design review and optimisation
|
||||
M: Hardware Architecture Team
|
||||
|
||||
N: Dr. Erhard Siegl
|
||||
E: Erhard (dot) Siegl (at) zogazoga (dot) at
|
||||
@ -186,7 +203,7 @@ D: Module architecture and UAVTalk/UAVObjects implementation.
|
||||
M: Architecture co-lead
|
||||
|
||||
N: Alex Vrubel
|
||||
E: alex.vrubel (plus) openpilot (at) gmail (dot) com
|
||||
E: alex (dot) vrubel (plus) openpilot (at) gmail (dot) com
|
||||
D: Russian translation of the GCS
|
||||
</pre>
|
||||
|
||||
|
@ -42,6 +42,8 @@ deviceWidget::deviceWidget(QWidget *parent) :
|
||||
|
||||
QPixmap pix = QPixmap(QString(":uploader/images/view-refresh.svg"));
|
||||
myDevice->statusIcon->setPixmap(pix);
|
||||
|
||||
myDevice->certifiedFW->setText("");
|
||||
}
|
||||
|
||||
|
||||
@ -123,6 +125,9 @@ void deviceWidget::populate()
|
||||
QString str = m_dfu->DownloadDescription(size);
|
||||
myDevice->description->setMaxLength(size);
|
||||
myDevice->description->setText(str.left(str.indexOf(QChar(255))));
|
||||
QPixmap pix = QPixmap(QString(":uploader/images/gtk-info.svg"));
|
||||
myDevice->certifiedFW->setPixmap(pix);
|
||||
myDevice->certifiedFW->setToolTip(tr("Custom Firmware Build"));
|
||||
myDevice->buildDate->setText("Warning: development firmware");
|
||||
myDevice->commitTag->setText("");
|
||||
}
|
||||
@ -182,6 +187,9 @@ bool deviceWidget::populateStructuredDescription(QByteArray desc)
|
||||
QString dscText = QString(desc.mid(14,26));
|
||||
myDevice->description->setText(dscText);
|
||||
|
||||
QPixmap pix = QPixmap(QString(":uploader/images/application-certificate.svg"));
|
||||
myDevice->certifiedFW->setPixmap(pix);
|
||||
myDevice->certifiedFW->setToolTip(tr("Official Firmware Build"));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -268,12 +276,7 @@ void deviceWidget::uploadFirmware()
|
||||
if (firmwareBoard != board) {
|
||||
status("Error: firmware does not match board", STATUSICON_FAIL);
|
||||
return;
|
||||
} else {
|
||||
// Not a structured description: warn user
|
||||
myDevice->buildDate->setText("Warning: development firmware");
|
||||
myDevice->commitTag->setText("");
|
||||
}
|
||||
|
||||
// Check the firmware embedded in the file:
|
||||
QByteArray firmwareHash = desc.mid(40,20);
|
||||
QByteArray fileHash = QCryptographicHash::hash(arr.left(arr.length()-100), QCryptographicHash::Sha1);
|
||||
@ -281,9 +284,6 @@ void deviceWidget::uploadFirmware()
|
||||
status("Error: firmware file corrupt", STATUSICON_FAIL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
// The firmware is not packaged, just upload the text in the description field
|
||||
// if it is there.
|
||||
@ -291,8 +291,6 @@ void deviceWidget::uploadFirmware()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
status("Starting firmware upload", STATUSICON_RUNNING);
|
||||
// We don't know which device was used previously, so we
|
||||
// are cautious and reenter DFU for this deviceID:
|
||||
@ -416,7 +414,7 @@ QString deviceWidget::setOpenFileName()
|
||||
QString fileName = QFileDialog::getOpenFileName(this,
|
||||
tr("Select firmware file"),
|
||||
"",
|
||||
tr("Firmware Files (*.bin)"),
|
||||
tr("Firmware Files (*.bin *.opfw)"),
|
||||
&selectedFilter,
|
||||
options);
|
||||
return fileName;
|
||||
|
@ -137,13 +137,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QLabel" name="buildDate">
|
||||
<property name="text">
|
||||
<string>Build Date</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="commitTag">
|
||||
<property name="text">
|
||||
@ -151,6 +144,30 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="certifiedFW">
|
||||
<property name="text">
|
||||
<string>certified</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="buildDate">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>buildDate</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -291,7 +291,10 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success)
|
||||
/*
|
||||
m_config->haltButton->setEnabled(false);
|
||||
m_config->resetButton->setEnabled(false);
|
||||
*/
|
||||
// Need to re-enable in case we were not connected
|
||||
m_config->bootButton->setEnabled(true);
|
||||
/*
|
||||
m_config->telemetryLink->setEnabled(false);
|
||||
m_config->rescueButton->setEnabled(false);
|
||||
*/
|
||||
@ -359,6 +362,7 @@ void UploaderGadgetWidget::systemBoot()
|
||||
delete dfu;
|
||||
dfu = NULL;
|
||||
m_config->bootButton->setEnabled(true);
|
||||
m_config->rescueButton->setEnabled(true); // Boot not possible, maybe Rescue OK?
|
||||
return;
|
||||
}
|
||||
log("Booting system...");
|
||||
@ -503,7 +507,7 @@ void UploaderGadgetWidget::systemRescue()
|
||||
}
|
||||
m_config->haltButton->setEnabled(false);
|
||||
m_config->resetButton->setEnabled(false);
|
||||
//m_config->bootButton->setEnabled(true);
|
||||
m_config->bootButton->setEnabled(true);
|
||||
m_config->rescueButton->setEnabled(false);
|
||||
currentStep = IAP_STATE_BOOTLOADER; // So that we can boot from the GUI afterwards.
|
||||
}
|
||||
|
18
make/boards/ahrs/board-info.mk
Normal file
@ -0,0 +1,18 @@
|
||||
BOARD_TYPE := 0x02
|
||||
BOARD_REVISION := 0x01
|
||||
BOOTLOADER_VERSION := 0x00
|
||||
HW_TYPE := 0x00
|
||||
|
||||
MCU := cortex-m3
|
||||
CHIP := STM32F103CBT
|
||||
BOARD := STM32103CB_AHRS
|
||||
MODEL := MD
|
||||
MODEL_SUFFIX :=
|
||||
|
||||
# Note: These must match the values in link_$(BOARD)_memory.ld
|
||||
BL_BANK_BASE := 0x08000000 # Start of bootloader flash
|
||||
BL_BANK_SIZE := 0x00002000 # Should include BD_INFO region
|
||||
FW_BANK_BASE := 0x08002000 # Start of firmware flash
|
||||
FW_BANK_SIZE := 0x0001E000 # Should include FW_DESC_SIZE
|
||||
|
||||
FW_DESC_SIZE := 0x00000064
|
18
make/boards/coptercontrol/board-info.mk
Normal file
@ -0,0 +1,18 @@
|
||||
BOARD_TYPE := 0x04
|
||||
BOARD_REVISION := 0x01
|
||||
BOOTLOADER_VERSION := 0x00
|
||||
HW_TYPE := 0x01
|
||||
|
||||
MCU := cortex-m3
|
||||
CHIP := STM32F103CBT
|
||||
BOARD := STM32103CB_CC_Rev1
|
||||
MODEL := MD
|
||||
MODEL_SUFFIX := _CC
|
||||
|
||||
# Note: These must match the values in link_$(BOARD)_memory.ld
|
||||
BL_BANK_BASE := 0x08000000 # Start of bootloader flash
|
||||
BL_BANK_SIZE := 0x00003000 # Should include BD_INFO region
|
||||
FW_BANK_BASE := 0x08003000 # Start of firmware flash
|
||||
FW_BANK_SIZE := 0x0001D000 # Should include FW_DESC_SIZE
|
||||
|
||||
FW_DESC_SIZE := 0x00000064
|
18
make/boards/ins/board-info.mk
Normal file
@ -0,0 +1,18 @@
|
||||
BOARD_TYPE := 0x05
|
||||
BOARD_REVISION := 0x01
|
||||
BOOTLOADER_VERSION := 0x00
|
||||
HW_TYPE := 0x00
|
||||
|
||||
MCU := cortex-m3
|
||||
CHIP := STM32F103RET
|
||||
BOARD := STM3210E_INS
|
||||
MODEL := HD
|
||||
MODEL_SUFFIX := _OP
|
||||
|
||||
# Note: These must match the values in link_$(BOARD)_memory.ld
|
||||
BL_BANK_BASE := 0x08000000 # Start of bootloader flash
|
||||
BL_BANK_SIZE := 0x00002000 # Should include BD_INFO region
|
||||
FW_BANK_BASE := 0x08002000 # Start of firmware flash
|
||||
FW_BANK_SIZE := 0x0001E000 # Should include FW_DESC_SIZE
|
||||
|
||||
FW_DESC_SIZE := 0x00000064
|
18
make/boards/openpilot/board-info.mk
Normal file
@ -0,0 +1,18 @@
|
||||
BOARD_TYPE := 0x01
|
||||
BOARD_REVISION := 0x01
|
||||
BOOTLOADER_VERSION := 0x00
|
||||
HW_TYPE := 0x00
|
||||
|
||||
MCU := cortex-m3
|
||||
CHIP := STM32F103RET
|
||||
BOARD := STM3210E_OP
|
||||
MODEL := HD
|
||||
MODEL_SUFFIX := _OP
|
||||
|
||||
# Note: These must match the values in link_$(BOARD)_memory.ld
|
||||
BL_BANK_BASE := 0x08000000 # Start of bootloader flash
|
||||
BL_BANK_SIZE := 0x00005000 # Should include BD_INFO region
|
||||
FW_BANK_BASE := 0x08005000 # Start of firmware flash
|
||||
FW_BANK_SIZE := 0x0007B000 # Should include FW_DESC_SIZE
|
||||
|
||||
FW_DESC_SIZE := 0x00000064
|
20
make/boards/pipxtreme/board-info.mk
Normal file
@ -0,0 +1,20 @@
|
||||
BOARD_TYPE := 0x03
|
||||
BOARD_REVISION := 0x01
|
||||
BOOTLOADER_VERSION := 0x00
|
||||
HW_TYPE := 0x01
|
||||
|
||||
MCU := cortex-m3
|
||||
CHIP := STM32F103CBT
|
||||
BOARD := STM32103CB_PIPXTREME
|
||||
MODEL := MD
|
||||
MODEL_SUFFIX :=
|
||||
|
||||
# Note: These must match the values in link_$(BOARD)_memory.ld
|
||||
BL_BANK_BASE := 0x08000000 # Start of bootloader flash
|
||||
BL_BANK_SIZE := 0x00003000 # Should include BD_INFO region
|
||||
FW_BANK_BASE := 0x08003000 # Start of firmware flash
|
||||
FW_BANK_SIZE := 0x0001CC00 # Should include FW_DESC_SIZE
|
||||
EE_BANK_BASE := 0x0801FC00 # EEPROM storage area
|
||||
EE_BANK_SIZE := 0x00000400 # Size of EEPROM storage area
|
||||
|
||||
FW_DESC_SIZE := 0x00000064
|
@ -45,6 +45,10 @@ 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} OPFW ${quote}
|
||||
MSG_FWINFO := ${quote} FWINFO ${quote}
|
||||
MSG_JTAG_PROGRAM := ${quote} JTAG-PGM ${quote}
|
||||
MSG_JTAG_WIPE := ${quote} JTAG-WIPE ${quote}
|
||||
|
||||
toprel = $(subst $(realpath $(TOP))/,,$(abspath $(1)))
|
||||
|
||||
@ -68,6 +72,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 \
|
||||
@ -90,12 +98,39 @@ gccversion :
|
||||
$(V1) $(NM) -n $< > $@
|
||||
|
||||
define SIZE_TEMPLATE
|
||||
.PHONY: size
|
||||
size: $(1)_size
|
||||
|
||||
.PHONY: $(1)_size
|
||||
$(1)_size: $(1)
|
||||
@echo $(MSG_SIZE) $$(call toprel, $$<)
|
||||
$(V1) $(SIZE) -A $$<
|
||||
endef
|
||||
|
||||
# OpenPilot firmware image template
|
||||
# $(1) = path to bin file
|
||||
# $(2) = boardtype in hex
|
||||
# $(3) = board revision in hex
|
||||
define OPFW_TEMPLATE
|
||||
FORCE:
|
||||
|
||||
$(1).firmwareinfo.c: $(1) $(TOP)/make/templates/firmwareinfotemplate.c FORCE
|
||||
@echo $(MSG_FWINFO) $$(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))).opfw : $(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)
|
||||
@ -163,21 +198,48 @@ $($(1):.c=.s) : %.s : %.c
|
||||
$(V1) $(CC) -S $$(CFLAGS) $$(CONLYFLAGS) $$< -o $$@
|
||||
endef
|
||||
|
||||
# $(1) = Name of binary image to write
|
||||
# $(2) = Base of flash region to write/wipe
|
||||
# $(3) = Size of flash region to write/wipe
|
||||
define JTAG_TEMPLATE
|
||||
# ---------------------------------------------------------------------------
|
||||
# Options for OpenOCD flash-programming
|
||||
# see openocd.pdf/openocd.texi for further information
|
||||
|
||||
# if OpenOCD is in the $PATH just set OPENOCDEXE=openocd
|
||||
OOCD_EXE=openocd
|
||||
OOCD_EXE ?= openocd
|
||||
|
||||
# debug level
|
||||
OOCD_CL=-d0
|
||||
OOCD_JTAG_SETUP = -d0
|
||||
# interface and board/target settings (using the OOCD target-library here)
|
||||
OOCD_CL+=-s $(TOP)/flight/Project/OpenOCD
|
||||
OOCD_CL+=-f foss-jtag.revb.cfg -f stm32.cfg
|
||||
OOCD_JTAG_SETUP += -s $(TOP)/flight/Project/OpenOCD
|
||||
OOCD_JTAG_SETUP += -f foss-jtag.revb.cfg -f stm32.cfg
|
||||
|
||||
# initialize
|
||||
OOCD_CL+=-c init
|
||||
OOCD_BOARD_RESET = -c init
|
||||
# show the targets
|
||||
OOCD_CL+=-c targets
|
||||
#OOCD_BOARD_RESET += -c targets
|
||||
# commands to prepare flash-write
|
||||
OOCD_CL+= -c "reset halt"
|
||||
OOCD_BOARD_RESET += -c "reset halt"
|
||||
|
||||
.PHONY: program
|
||||
program: $(1)
|
||||
@echo $(MSG_JTAG_PROGRAM) $$(call toprel, $$<)
|
||||
$(V1) $(OOCD_EXE) \
|
||||
$$(OOCD_JTAG_SETUP) \
|
||||
$$(OOCD_BOARD_RESET) \
|
||||
-c "flash write_image erase $$< $(2) bin" \
|
||||
-c "verify_image $$< $(2) bin" \
|
||||
-c "reset run" \
|
||||
-c "shutdown"
|
||||
|
||||
.PHONY: wipe
|
||||
wipe:
|
||||
@echo $(MSG_JTAG_WIPE) wiping $(3) bytes starting from $(2)
|
||||
$(V1) $(OOCD_EXE) \
|
||||
$$(OOCD_JTAG_SETUP) \
|
||||
$$(OOCD_BOARD_RESET) \
|
||||
-c "flash erase_address pad $(2) $(3)" \
|
||||
-c "reset run" \
|
||||
-c "shutdown"
|
||||
endef
|
@ -11,7 +11,7 @@ from subprocess import Popen, PIPE
|
||||
from re import search, MULTILINE
|
||||
from datetime import datetime
|
||||
from string import Template
|
||||
import argparse
|
||||
import optparse
|
||||
import hashlib
|
||||
import sys
|
||||
|
||||
@ -47,7 +47,7 @@ class Repo:
|
||||
self._rc = git.poll()
|
||||
|
||||
def _get_origin(self):
|
||||
"""Get and store the repository origin URL"""
|
||||
"""Get and store the repository fetch origin path"""
|
||||
self._origin = None
|
||||
self._exec('remote -v')
|
||||
if self._rc == 0:
|
||||
@ -69,7 +69,7 @@ class Repo:
|
||||
def _get_tag(self):
|
||||
"""Get and store git tag for the HEAD commit"""
|
||||
self._tag = None
|
||||
self._exec('describe --exact-match HEAD')
|
||||
self._exec('describe --tags --exact-match HEAD')
|
||||
if self._rc == 0:
|
||||
self._tag = self._out.strip(' \t\n\r')
|
||||
|
||||
@ -82,6 +82,14 @@ class Repo:
|
||||
if m:
|
||||
self._branch = m.group(1)
|
||||
|
||||
def _get_dirty(self):
|
||||
"""Check for dirty state of repository"""
|
||||
self._dirty = False
|
||||
self._exec('update-index --refresh --unmerged')
|
||||
self._exec('diff-index --name-only --exit-code --quiet HEAD')
|
||||
if self._rc:
|
||||
self._dirty = True
|
||||
|
||||
def __init__(self, path = "."):
|
||||
"""Initialize object instance and read repo info"""
|
||||
self._path = path
|
||||
@ -92,12 +100,14 @@ class Repo:
|
||||
self._get_time()
|
||||
self._get_tag()
|
||||
self._get_branch()
|
||||
self._get_dirty()
|
||||
else:
|
||||
self._hash = None
|
||||
self._origin = None
|
||||
self._time = None
|
||||
self._tag = None
|
||||
self._branch = None
|
||||
self._dirty = None
|
||||
|
||||
def path(self):
|
||||
"""Return the repository path"""
|
||||
@ -141,6 +151,13 @@ class Repo:
|
||||
else:
|
||||
return self._branch
|
||||
|
||||
def dirty(self, dirty = "-dirty", clean = ""):
|
||||
"""Return git repository dirty state or empty string"""
|
||||
if self._dirty:
|
||||
return dirty
|
||||
else:
|
||||
return clean
|
||||
|
||||
def info(self):
|
||||
"""Print some repository info"""
|
||||
print "path: ", self.path()
|
||||
@ -151,6 +168,7 @@ class Repo:
|
||||
print "short hash: ", self.hash(8)
|
||||
print "branch: ", self.branch()
|
||||
print "commit tag: ", self.tag()
|
||||
print "dirty: ", self.dirty('yes', 'no')
|
||||
|
||||
def file_from_template(tpl_name, out_name, dict):
|
||||
"""Create or update file from template using dictionary
|
||||
@ -206,7 +224,7 @@ def file_from_template(tpl_name, out_name, dict):
|
||||
of.close()
|
||||
|
||||
def sha1(file):
|
||||
"""Provides C source representation of sha1 sum of file."""
|
||||
"""Provides C source representation of sha1 sum of file"""
|
||||
if file == None:
|
||||
return ""
|
||||
else:
|
||||
@ -217,6 +235,21 @@ def sha1(file):
|
||||
hex_stream = lambda s:",".join(['0x'+hex(ord(c))[2:].zfill(2) for c in s])
|
||||
return hex_stream(sha1.digest())
|
||||
|
||||
def xtrim(string, suffix, length):
|
||||
"""Return string+suffix concatenated and trimmed up to length characters
|
||||
|
||||
This function appends suffix to the end of string and returns the result
|
||||
up to length characters. If it does not fit then the string will be
|
||||
truncated and the '+' will be put between it and the suffix.
|
||||
"""
|
||||
|
||||
if len(string) + len(suffix) <= length:
|
||||
return ''.join([string, suffix])
|
||||
else:
|
||||
n = length-1-len(suffix)
|
||||
assert n > 0, "length of truncated string+suffix exceeds maximum length"
|
||||
return ''.join([string[:n], '+', suffix])
|
||||
|
||||
def main():
|
||||
"""This utility uses git repository in the current working directory
|
||||
or from the given path to extract some info about it and HEAD commit.
|
||||
@ -240,29 +273,39 @@ dependent targets.
|
||||
"""
|
||||
|
||||
# Parse command line.
|
||||
parser = argparse.ArgumentParser(
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
class RawDescriptionHelpFormatter(optparse.IndentedHelpFormatter):
|
||||
"""optparse formatter function to pretty print raw epilog"""
|
||||
def format_epilog(self, epilog):
|
||||
if epilog:
|
||||
return "\n" + epilog + "\n"
|
||||
else:
|
||||
return ""
|
||||
|
||||
parser = optparse.OptionParser(
|
||||
formatter=RawDescriptionHelpFormatter(),
|
||||
description = "Performs variable substitution in template file or string.",
|
||||
epilog = main.__doc__);
|
||||
|
||||
parser.add_argument('--path', default='.',
|
||||
parser.add_option('--path', default='.',
|
||||
help='path to the git repository');
|
||||
parser.add_argument('--info', action='store_true',
|
||||
parser.add_option('--info', action='store_true',
|
||||
help='print repository info to stdout');
|
||||
parser.add_argument('--format',
|
||||
parser.add_option('--format',
|
||||
help='format string to print to stdout');
|
||||
parser.add_argument('--template',
|
||||
parser.add_option('--template',
|
||||
help='name of template file');
|
||||
parser.add_argument('--outfile',
|
||||
parser.add_option('--outfile',
|
||||
help='name of output file');
|
||||
parser.add_argument('--image',
|
||||
parser.add_option('--image',
|
||||
help='name of image file for sha1 calculation');
|
||||
parser.add_argument('--type', default="",
|
||||
parser.add_option('--type', default="",
|
||||
help='board type, for example, 0x04 for CopterControl');
|
||||
parser.add_argument('--revision', default = "",
|
||||
parser.add_option('--revision', default = "",
|
||||
help='board revision, for example, 0x01');
|
||||
|
||||
args = parser.parse_args()
|
||||
(args, positional_args) = parser.parse_args()
|
||||
if len(positional_args) != 0:
|
||||
parser.error("incorrect number of arguments, try --help for help")
|
||||
|
||||
# Process arguments. No advanced error handling is here.
|
||||
# Any error will raise an exception and terminate process
|
||||
@ -277,8 +320,11 @@ dependent targets.
|
||||
HASH8 = r.hash(8),
|
||||
TAG_OR_BRANCH = r.tag(r.branch('unreleased')),
|
||||
TAG_OR_HASH8 = r.tag(r.hash(8, 'untagged')),
|
||||
DIRTY = r.dirty(),
|
||||
FWTAG = xtrim(r.tag(r.branch('unreleased')), r.dirty(), 25),
|
||||
UNIXTIME = r.time(),
|
||||
DATE = r.time('%Y%m%d'),
|
||||
DATETIME = r.time('%Y%m%d %H:%M'),
|
||||
BOARD_TYPE = args.type,
|
||||
BOARD_REVISION = args.revision,
|
||||
SHA1 = sha1(args.image),
|
||||
|
@ -38,7 +38,7 @@
|
||||
* 4 bytes: GIT commit tag (short version of SHA1).
|
||||
* 4 bytes: Unix timestamp of compile time.
|
||||
* 2 bytes: target platform. Should follow same rule as BOARD_TYPE and BOARD_REVISION in board define files.
|
||||
* 26 bytes: commit tag if it is there, otherwise branch name. Zero-padded.
|
||||
* 26 bytes: commit tag if it is there, otherwise branch name. '-dirty' may be added if needed. Zero-padded.
|
||||
* ---- 40 bytes limit ---
|
||||
* 20 bytes: SHA1 sum of the firmware.
|
||||
* 40 bytes: free for now.
|
||||
@ -62,7 +62,7 @@ const struct fw_version_info fw_version_blob __attribute__((used)) __attribute__
|
||||
.timestamp = ${UNIXTIME},
|
||||
.board_type = ${BOARD_TYPE},
|
||||
.board_revision = ${BOARD_REVISION},
|
||||
.commit_tag_name = "${TAG_OR_BRANCH}",
|
||||
.commit_tag_name = "${FWTAG}",
|
||||
.sha1sum = { ${SHA1} },
|
||||
};
|
||||
|
||||
|
@ -33,11 +33,14 @@ It is expected that you have the following tools installed into the listed
|
||||
locations (but any other locations are fine as well):
|
||||
|
||||
- Python in C:\Python27
|
||||
- CodeSourcery G++ in C:\CodeSourcery
|
||||
- QtSDK in C:\Qt\2010.05
|
||||
- QtSDK in C:\Qt\2010.05 or C:\QtSDK (depending on SDK version)
|
||||
- CodeSourcery G++ in %ProgramFiles%\CodeSourcery\Sourcery G++ Lite
|
||||
- msysGit in %ProgramFiles%\Git
|
||||
- Unicode NSIS in %ProgramFiles%\NSIS\Unicode
|
||||
- OpenOCD in C:\OpenOCD\0.4.0\bin
|
||||
- OpenOCD in C:\OpenOCD\0.4.0\bin (optional)
|
||||
|
||||
The SDL library and headers should be installed into Qt directories to build
|
||||
the GCS. Check the wiki or ground/openpilotgcs/copydata.pro for details.
|
||||
|
||||
Also it is assumed that you have the C:\Program Files\Git\cmd\ directory in
|
||||
the PATH. Usually this is the case for msysGit installation if you have chosen
|
||||
@ -55,6 +58,10 @@ accordingly. Also if you have tools installed into different directories and
|
||||
they are not in the PATH, then you may want to update paths in the sh.cmd
|
||||
script too (it is self-documented).
|
||||
|
||||
Note for Windows 64-bit users: 64-bit systems use %ProgramFiles(x86)% folder
|
||||
as default for program files instead of %ProgramFiles%. You have to check where
|
||||
your tools are installed and update paths above accordingly.
|
||||
|
||||
|
||||
3. How to use it?
|
||||
-----------------
|
||||
|
@ -38,6 +38,9 @@ rem As a result, the SDL headers will not be found, if they were copied into
|
||||
rem QtSDK's MinGW directory. In that case make sure that you have correct
|
||||
rem directories specified here.
|
||||
rem
|
||||
rem Also the SDL should be installed into Qt directories to build the GCS.
|
||||
rem Check the wiki or ground/openpilotgcs/copydata.pro for details.
|
||||
rem
|
||||
rem Also you can add any paths below just by adding extra 'call :which'
|
||||
rem lines with the following parameters:
|
||||
rem - environment variable which will be set to the tool location, if found;
|
||||
@ -51,9 +54,13 @@ set NOT_FOUND=
|
||||
set PATH_DIRS=
|
||||
|
||||
call :which MSYSGIT "%ProgramFiles%\Git\bin" git.exe
|
||||
rem These two lines for qt-sdk-win-opensource-2010.05.exe:
|
||||
call :which QTMINGW "C:\Qt\2010.05\mingw\bin" mingw32-make.exe
|
||||
call :which QTSDK "C:\Qt\2010.05\qt\bin" qmake.exe
|
||||
call :which CODESOURCERY "C:\CodeSourcery\bin" cs-make.exe
|
||||
rem These two lines for Qt_SDK_Win_offline_v1_1_1_en.exe:
|
||||
rem call :which QTMINGW "C:\QtSDK\mingw\bin" mingw32-make.exe
|
||||
rem call :which QTSDK "C:\QtSDK\Desktop\Qt\4.7.3\mingw\bin" qmake.exe
|
||||
call :which CODESOURCERY "%ProgramFiles%\CodeSourcery\Sourcery G++ Lite\bin" cs-make.exe
|
||||
call :which PYTHON "C:\Python27" python.exe
|
||||
call :which UNSIS "%ProgramFiles%\NSIS\Unicode" makensis.exe
|
||||
call :which OPENOCDBIN "C:\OpenOCD\0.4.0\bin" openocd.exe
|
||||
|
168
package/Makefile
Normal file
@ -0,0 +1,168 @@
|
||||
# Set up a default goal
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
# Tried the best to support parallel (-j) builds. But since this Makefile
|
||||
# uses other Makefiles to build few targets which in turn have similar
|
||||
# dependencies on uavobjects and other generated files, it is difficult
|
||||
# to support parallel builds perfectly. But at least it was tested with
|
||||
# -j (unlimited job number) on Windows and Linux.
|
||||
|
||||
# Locate the root of the tree
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
ROOT_DIR := $(realpath $(WHEREAMI)/../)
|
||||
|
||||
# Set up some macros
|
||||
BUILD_DIR := $(ROOT_DIR)/build
|
||||
VERSION_CMD := python $(ROOT_DIR)/make/scripts/version-info.py --path="$(ROOT_DIR)"
|
||||
PACKAGE_LBL := $(shell $(VERSION_CMD) --format=\$${DATE}-\$${TAG_OR_HASH8}\$${DIRTY})
|
||||
PACKAGE_DIR := $(BUILD_DIR)/package-$(PACKAGE_LBL)
|
||||
FW_DIR := $(PACKAGE_DIR)/firmware-$(PACKAGE_LBL)
|
||||
BL_DIR := $(FW_DIR)/bootloaders
|
||||
BU_DIR := $(FW_DIR)/bootloader-updaters
|
||||
FE_DIR := $(FW_DIR)/flash-erase-tools
|
||||
|
||||
# Clean build options (recommended for package testing only)
|
||||
ifeq ($(CLEAN_BUILD), NO)
|
||||
CLEAN_GROUND := NO
|
||||
CLEAN_FLIGHT := YES
|
||||
else ifeq ($(CLEAN_BUILD), NEVER)
|
||||
CLEAN_GROUND := NO
|
||||
CLEAN_FLIGHT := NO
|
||||
else
|
||||
CLEAN_GROUND := YES
|
||||
CLEAN_FLIGHT := YES
|
||||
endif
|
||||
|
||||
# Set up targets
|
||||
FW_STEMS_COMMON := ahrs pipxtreme
|
||||
FW_STEMS_INPUT := coptercontrol openpilot
|
||||
FW_STEMS_TOOLS := coptercontrol
|
||||
FW_STEMS_ALL := $(FW_STEMS_COMMON) $(FW_STEMS_INPUT)
|
||||
FW_TARGETS_COMMON := $(addprefix fw_, $(FW_STEMS_COMMON))
|
||||
FW_TARGETS_INPUT := $(addprefix fw_, $(FW_STEMS_INPUT))
|
||||
FW_TARGETS_TOOLS := $(addprefix fw_, $(FW_STEMS_TOOLS))
|
||||
BL_TARGETS := $(addprefix bl_, $(FW_STEMS_ALL))
|
||||
BU_TARGETS := $(addprefix bu_, $(FW_STEMS_ALL))
|
||||
|
||||
help:
|
||||
@echo
|
||||
@echo " This Makefile is known to work on Linux and Mac in a standard shell environment."
|
||||
@echo " It also works on Windows by following the instructions in ../make/winx86/README.txt."
|
||||
@echo
|
||||
@echo " Here is a summary of the available targets:"
|
||||
@echo
|
||||
@echo " [Packaging]"
|
||||
@echo " package - Build and package the OpenPilot distributable"
|
||||
@echo " package_flight - Build and package the OpenPilot flight firmware only"
|
||||
@echo
|
||||
@echo " Notes:"
|
||||
@echo " - package will be placed in $(PACKAGE_DIR)"
|
||||
@echo
|
||||
@echo " - the build directory will be removed first on every run unless one"
|
||||
@echo " of CLEAN_BUILD=NO or CLEAN_BUILD=NEVER options is defined."
|
||||
@echo
|
||||
@echo " CLEAN_BUILD=NO means no clean before build except for multi-input"
|
||||
@echo " firmware binaries like CopterControl or OpenPilot. This usually is"
|
||||
@echo " safe."
|
||||
@echo
|
||||
@echo " CLEAN_BUILD=NEVER means no clean will be done at all. This will,"
|
||||
@echo " probably, give invalid multi-input firmware and is recommended"
|
||||
@echo " for package testing only. Do not use for release builds."
|
||||
@echo
|
||||
|
||||
# Clean and build uavobjects since all parts depend on them
|
||||
uavobjects: all_clean
|
||||
$(V1) $(MAKE) -C $(ROOT_DIR) $@
|
||||
|
||||
all_clean:
|
||||
ifneq ($(CLEAN_GROUND), NO)
|
||||
$(V1) $(MAKE) -C $(ROOT_DIR) $@
|
||||
endif
|
||||
|
||||
# Install template:
|
||||
# $1 = target
|
||||
# $2 = dependencies
|
||||
# $3 = install directory (must be defined)
|
||||
# $4 = installed file name prefix (optional)
|
||||
# $5 = installed file name suffix (optional)
|
||||
# $6 = extra make options (for instance, USE_SPEKTRUM=YES)
|
||||
# $7 = optional 'clean' string to clean target before rebuild
|
||||
# $8 = list of targets to install (without _install suffix)
|
||||
# $9 = inner make target (usually install, but can be other to just build)
|
||||
define INSTALL_TEMPLATE
|
||||
$(1): $(2)
|
||||
ifeq ($(7),clean)
|
||||
ifneq ($$(CLEAN_FLIGHT), NO)
|
||||
$$(V1) +$(MAKE) -C $(ROOT_DIR) $(6) $(addsuffix _$(7), $(8))
|
||||
endif
|
||||
endif
|
||||
$$(V1) +$(MAKE) -C $(ROOT_DIR) INSTALL_DIR=$(3) INSTALL_PFX=$(4) INSTALL_SFX=$(5) $(6) $(addsuffix _$(9), $(8))
|
||||
.PHONY: $(1)
|
||||
endef
|
||||
|
||||
# Firmware for different input drivers
|
||||
$(eval $(call INSTALL_TEMPLATE,fw_common,uavobjects,$(FW_DIR),,-$(PACKAGE_LBL),,,$(FW_TARGETS_COMMON),install))
|
||||
$(eval $(call INSTALL_TEMPLATE,fw_pwm,uavobjects,$(FW_DIR),,-pwm-$(PACKAGE_LBL),,clean,$(FW_TARGETS_INPUT),install))
|
||||
$(eval $(call INSTALL_TEMPLATE,fw_spektrum,uavobjects,$(FW_DIR),,-spektrum-$(PACKAGE_LBL),USE_SPEKTRUM=YES,clean,$(FW_TARGETS_INPUT),install))
|
||||
$(eval $(call INSTALL_TEMPLATE,fw_ppm,uavobjects,$(FW_DIR),,-ppm-$(PACKAGE_LBL),USE_PPM=YES,clean,$(FW_TARGETS_INPUT),install))
|
||||
|
||||
# Bootloaders (change 'install' to 'bin' if you don't want to install bootloaders)
|
||||
$(eval $(call INSTALL_TEMPLATE,all_bl,uavobjects,$(BL_DIR),,-$(PACKAGE_LBL),,,$(BL_TARGETS),install))
|
||||
|
||||
# Bootloader updaters
|
||||
$(eval $(call INSTALL_TEMPLATE,all_bu,all_bl,$(BU_DIR),,-$(PACKAGE_LBL),,,$(BU_TARGETS),install))
|
||||
|
||||
# CopterControl flash eraser tool
|
||||
$(eval $(call INSTALL_TEMPLATE,fw_tools,uavobjects,$(FE_DIR),,-flash-erase-$(PACKAGE_LBL),ERASE_FLASH=YES,clean,$(FW_TARGETS_TOOLS),install))
|
||||
|
||||
# Order-only dependencies
|
||||
# They are bit complicated to support parallel (-j) builds and to create
|
||||
# the pwm/ppm/spektrum and CC flash eraser targets in some fixed order
|
||||
|
||||
fw_pwm: | # default dependencies, will be built first
|
||||
|
||||
fw_spektrum: | fw_pwm # ordered build
|
||||
|
||||
fw_ppm: | fw_spektrum # ordered build
|
||||
|
||||
fw_tools: | fw_spektrum # ordered build, replace fw_spektrum by fw_ppm if uncommented below
|
||||
|
||||
package_fw: | fw_common fw_pwm fw_spektrum # fw_ppm
|
||||
|
||||
package_bu: | all_bu
|
||||
|
||||
package_flight: | package_fw package_bu fw_tools
|
||||
|
||||
package_ground: | ground_package
|
||||
|
||||
package: | package_flight package_ground
|
||||
|
||||
.PHONY: help uavobjects all_clean package package_flight package_fw package_bu package_ground
|
||||
|
||||
# Decide on a verbosity level based on the V= parameter
|
||||
export AT := @
|
||||
|
||||
ifndef V
|
||||
export V0 :=
|
||||
export V1 := $(AT)
|
||||
else ifeq ($(V), 0)
|
||||
export V0 := $(AT)
|
||||
export V1 := $(AT)
|
||||
else ifeq ($(V), 1)
|
||||
endif
|
||||
|
||||
ifneq ($(V),1)
|
||||
MAKEFLAGS += --no-print-directory
|
||||
endif
|
||||
|
||||
# Platform-dependent stuff
|
||||
PLATFORM := winx86
|
||||
UNAME := $(shell uname)
|
||||
ifeq ($(UNAME), Linux)
|
||||
PLATFORM := linux
|
||||
endif
|
||||
ifeq ($(UNAME), Darwin)
|
||||
PLATFORM := osx
|
||||
endif
|
||||
|
||||
include $(WHEREAMI)/Makefile.$(PLATFORM)
|
20
package/Makefile.osx
Normal file
@ -0,0 +1,20 @@
|
||||
#
|
||||
# MacOSX-specific packaging
|
||||
#
|
||||
|
||||
osx_package: gcs package_flight
|
||||
( \
|
||||
ROOT_DIR="$(ROOT_DIR)" \
|
||||
BUILD_DIR="$(BUILD_DIR)" \
|
||||
PACKAGE_LBL="$(PACKAGE_LBL)" \
|
||||
PACKAGE_DIR="$(PACKAGE_DIR)" \
|
||||
FW_DIR="$(FW_DIR)" \
|
||||
"$(ROOT_DIR)/package/osx/package" \
|
||||
)
|
||||
|
||||
gcs: uavobjects
|
||||
$(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@
|
||||
|
||||
ground_package: | osx_package
|
||||
|
||||
.PHONY: gcs ground_package osx_package
|
25
package/Makefile.winx86
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# Windows-specific packaging
|
||||
#
|
||||
|
||||
NSIS_CMD := makensis.exe
|
||||
NSIS_OPTS := /V3
|
||||
NSIS_DIR := $(ROOT_DIR)/package/winx86
|
||||
NSIS_SCRIPT := $(NSIS_DIR)/openpilotgcs.nsi
|
||||
NSIS_TEMPLATE := $(NSIS_DIR)/openpilotgcs.tpl
|
||||
NSIS_HEADER := $(BUILD_DIR)/ground/openpilotgcs/openpilotgcs.nsh
|
||||
|
||||
win_package: gcs package_flight
|
||||
$(V1) mkdir -p "$(dir $(NSIS_HEADER))"
|
||||
$(VERSION_CMD) --template="$(NSIS_TEMPLATE)" --outfile="$(NSIS_HEADER)"
|
||||
$(V1) echo "Building Windows installer, please wait..."
|
||||
$(V1) echo "If you have a script error in line 1 - use Unicode NSIS 2.46+"
|
||||
$(V1) echo " http://www.scratchpaper.com"
|
||||
$(NSIS_CMD) $(NSIS_OPTS) $(NSIS_SCRIPT)
|
||||
|
||||
gcs: uavobjects
|
||||
$(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@
|
||||
|
||||
ground_package: | win_package
|
||||
|
||||
.PHONY: gcs ground_package win_package
|
BIN
package/osx/OpenPilot.dmg
Normal file
47
package/osx/libraries
Executable file
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
APP="${1?}"
|
||||
PLUGINS="${APP}/Contents/PlugIns"
|
||||
OP_PLUGINS="${APP}/Contents/PlugIns/OpenPilot"
|
||||
QT_LIBS="QtGui QtCore QtSvg QtSql QtOpenGL QtNetwork QtXml QtDBus QtScript phonon"
|
||||
|
||||
echo "Processing Qt libraries in $1"
|
||||
macdeployqt "${APP}"
|
||||
|
||||
for f in "${PLUGINS}/"*.dylib "${OP_PLUGINS}/"*.dylib
|
||||
do
|
||||
for g in $QT_LIBS
|
||||
do
|
||||
install_name_tool -change \
|
||||
${g}.framework/Versions/4/${g} \
|
||||
@executable_path/../Frameworks/${g}.framework/Versions/4/${g} \
|
||||
"${f}"
|
||||
done
|
||||
done
|
||||
|
||||
# should be redundant but some libs missed by main app and macdeployqt
|
||||
for f in ${QT_LIBS}
|
||||
do
|
||||
echo "Copying ${f}"
|
||||
cp -r /Library/Frameworks/${f}.framework "${APP}/Contents/Frameworks/"
|
||||
|
||||
echo "Changing package identification of ${f}"
|
||||
install_name_tool -id \
|
||||
@executable_path/../Frameworks/${f}.framework/Versions/4/QtCore \
|
||||
"${APP}/Contents/Frameworks/${f}.framework/Versions/4/${f}"
|
||||
|
||||
echo "Changing package linkages"
|
||||
for g in $QT_LIBS
|
||||
do
|
||||
install_name_tool -change \
|
||||
${g}.framework/Versions/4/${g} \
|
||||
@executable_path/../Frameworks/${g}.framework/Versions/4/${g} \
|
||||
"${APP}/Contents/Frameworks/${f}.framework/Versions/4/${f}"
|
||||
done
|
||||
done
|
||||
|
||||
# deleting unnecessary files
|
||||
echo "Deleting unnecessary files"
|
||||
find "${APP}/Contents/Frameworks" -iname "current" -exec rm -rf \{\} \;
|
||||
find "${APP}/Contents/Frameworks" -iname "4.0" -exec rm -rf \{\} \;
|
||||
find "${APP}/Contents/Frameworks" -iname "*_debug" -exec rm -rf \{\} \;
|
32
package/osx/package
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# the following environment variables must be set
|
||||
: ${ROOT_DIR?} ${BUILD_DIR?} ${PACKAGE_LBL?} ${PACKAGE_DIR?} ${FW_DIR?}
|
||||
|
||||
# more variables
|
||||
APP_PATH="${BUILD_DIR}/ground/openpilotgcs/bin/OpenPilot GCS.app"
|
||||
TEMP_FILE="${PACKAGE_DIR}/OpenPilot-temp.dmg"
|
||||
OUT_FILE="${PACKAGE_DIR}/OpenPilot-${PACKAGE_LBL}.dmg"
|
||||
VOL_NAME="OpenPilot"
|
||||
|
||||
# prepare the stage
|
||||
rm -f "${TEMP_FILE}"
|
||||
rm -f "${OUT_FILE}"
|
||||
|
||||
hdiutil convert "${ROOT_DIR}/package/osx/OpenPilot.dmg" \
|
||||
-format UDRW -o "${TEMP_FILE}"
|
||||
device=$(hdiutil attach "${TEMP_FILE}" | \
|
||||
egrep '^/dev/' | sed 1q | awk '{print $1}')
|
||||
|
||||
# packaging goes here
|
||||
cp -r "${APP_PATH}" "/Volumes/${VOL_NAME}"
|
||||
cp -r "${FW_DIR}" "/Volumes/${VOL_NAME}/firmware"
|
||||
|
||||
"${ROOT_DIR}/package/osx/libraries" \
|
||||
"/Volumes/${VOL_NAME}/OpenPilot GCS.app" || exit 1
|
||||
|
||||
hdiutil detach ${device}
|
||||
hdiutil convert "${TEMP_FILE}" -format UDZO -o "${OUT_FILE}"
|
||||
|
||||
# cleanup
|
||||
rm "${TEMP_FILE}"
|
@ -34,8 +34,7 @@
|
||||
|
||||
; Tree root locations (relative to this script location)
|
||||
!define NSIS_DATA_TREE "."
|
||||
!define GCS_BUILD_TREE "..\..\..\..\build\ground\openpilotgcs"
|
||||
!define WINX86_PATH "packaging\winx86"
|
||||
!define GCS_BUILD_TREE "..\..\build\ground\openpilotgcs"
|
||||
|
||||
; Default installation folder
|
||||
InstallDir "$LOCALAPPDATA\OpenPilot"
|
||||
@ -51,14 +50,17 @@
|
||||
!define INSTALLER_NAME "OpenPilot GCS Installer"
|
||||
|
||||
; Read automatically generated version info
|
||||
; !define OUT_FILE "OpenPilotGCS-XXXX-install.exe"
|
||||
; !define PACKAGE_LBL "${DATE}-${TAG_OR_HASH8}"
|
||||
; !define PACKAGE_DIR "..\..\build\package-$${PACKAGE_LBL}"
|
||||
; !define OUT_FILE "OpenPilotGCS-$${PACKAGE_LBL}-install.exe"
|
||||
; !define FIRMWARE_DIR "firmware-$${PACKAGE_LBL}"
|
||||
; !define PRODUCT_VERSION "0.0.0.0"
|
||||
; !define FILE_VERSION "0.0.0.0"
|
||||
; !define BUILD_DESCRIPTION "Unknown revision."
|
||||
!include "${GCS_BUILD_TREE}\${WINX86_PATH}\openpilotgcs.nsh"
|
||||
; !define FILE_VERSION "${TAG_OR_BRANCH}:${HASH8} ${DATETIME}"
|
||||
; !define BUILD_DESCRIPTION "${TAG_OR_BRANCH}:${HASH8} built using ${ORIGIN} as origin, committed ${DATETIME} as ${HASH}"
|
||||
!include "${GCS_BUILD_TREE}\openpilotgcs.nsh"
|
||||
|
||||
Name "${PRODUCT_NAME}"
|
||||
OutFile "${GCS_BUILD_TREE}\${WINX86_PATH}\${OUT_FILE}"
|
||||
OutFile "${PACKAGE_DIR}\${OUT_FILE}"
|
||||
|
||||
VIProductVersion ${PRODUCT_VERSION}
|
||||
VIAddVersionKey "ProductName" "${INSTALLER_NAME}"
|
||||
@ -181,6 +183,11 @@ Section "Localization" InSecLocalization
|
||||
File /r "${GCS_BUILD_TREE}\share\openpilotgcs\translations\*.qm"
|
||||
SectionEnd
|
||||
|
||||
Section "Firmware" InSecFirmware
|
||||
SetOutPath "$INSTDIR\firmware\${FIRMWARE_DIR}"
|
||||
File /r "${PACKAGE_DIR}\${FIRMWARE_DIR}\*"
|
||||
SectionEnd
|
||||
|
||||
Section "Shortcuts" InSecShortcuts
|
||||
; Create desktop and start menu shortcuts
|
||||
SetOutPath "$INSTDIR"
|
||||
@ -215,6 +222,7 @@ SectionEnd
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${InSecResources} $(DESC_InSecResources)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${InSecSounds} $(DESC_InSecSounds)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${InSecLocalization} $(DESC_InSecLocalization)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${InSecFirmware} $(DESC_InSecFirmware)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${InSecShortcuts} $(DESC_InSecShortcuts)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
||||
@ -235,6 +243,7 @@ Section "un.OpenPilot GCS" UnSecProgram
|
||||
RMDir /r /rebootok "$INSTDIR\bin"
|
||||
RMDir /r /rebootok "$INSTDIR\lib"
|
||||
RMDir /r /rebootok "$INSTDIR\share"
|
||||
RMDir /r /rebootok "$INSTDIR\firmware"
|
||||
Delete /rebootok "$INSTDIR\Uninstall.exe"
|
||||
|
||||
; Remove directory
|
23
package/winx86/openpilotgcs.tpl
Normal file
@ -0,0 +1,23 @@
|
||||
#
|
||||
# *****************************************************************************
|
||||
#
|
||||
# @file ${OUTFILENAME}
|
||||
# @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011.
|
||||
# @brief Autogenerated NSIS header file, built using template
|
||||
# ${TEMPLATE}
|
||||
#
|
||||
# @see The GNU Public License (GPL) Version 3
|
||||
#
|
||||
# *****************************************************************************
|
||||
#
|
||||
|
||||
; Some names, paths and constants
|
||||
!define PACKAGE_LBL "${DATE}-${TAG_OR_HASH8}${DIRTY}"
|
||||
!define PACKAGE_DIR "..\..\build\package-$${PACKAGE_LBL}"
|
||||
!define OUT_FILE "OpenPilot-$${PACKAGE_LBL}-install.exe"
|
||||
!define FIRMWARE_DIR "firmware-$${PACKAGE_LBL}"
|
||||
|
||||
; Installer version info
|
||||
!define PRODUCT_VERSION "0.0.0.0"
|
||||
!define FILE_VERSION "${TAG_OR_BRANCH}:${HASH8}${DIRTY} ${DATETIME}"
|
||||
!define BUILD_DESCRIPTION "${TAG_OR_BRANCH}:${HASH8}${DIRTY} built using ${ORIGIN} as origin, committed ${DATETIME} as ${HASH}"
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
@ -30,6 +30,7 @@
|
||||
LangString DESC_InSecResources ${LANG_GERMAN} "GCS Resourcen (Diagramme, Ziffernblätter, Kartensymbole, 3d-Modelle, PFD)."
|
||||
LangString DESC_InSecSounds ${LANG_GERMAN} "GCS Sounddateien (benötigt für akustische Ereignisbenachrichtigungen)."
|
||||
LangString DESC_InSecLocalization ${LANG_GERMAN} "GCS Lokalisierung (für unterstützte Sprachen)."
|
||||
LangString DESC_InSecFirmware ${LANG_GERMAN} "OpenPilot firmware binaries."
|
||||
LangString DESC_InSecShortcuts ${LANG_GERMAN} "Installiere Verknüpfungen unter Startmenü->Anwendungen."
|
||||
|
||||
;--------------------------------
|