build: added px4fmu-v4 support (for XRacer)

This commit is contained in:
Andrew Tridgell 2015-11-25 09:50:50 +11:00
parent 4722a388b9
commit 09276ce068
4 changed files with 35 additions and 4 deletions

View File

@ -0,0 +1,10 @@
#
# Makefile for the px4fmu-v4_APM configuration
#
include $(SKETCHBOOK)/mk/PX4/px4_common.mk
MODULES += drivers/mpu9250
MODULES += drivers/boards/px4fmu-v4
MODULES += drivers/pwm_input
MODULES += modules/uavcan
MODULES += lib/mathlib

View File

@ -22,6 +22,7 @@ help:
@echo ""
@echo " px4-v1 - the PX4v1 board"
@echo " px4-v2 - the Pixhawk"
@echo " px4-v4 - the XRacer"
@echo " pxf - the Beagle Bone Black (BBB) + PXF cape combination"
@echo " navio - the RaspberryPi + NavIO cape combination"
@echo " linux - a generic Linux build"

View File

@ -43,6 +43,7 @@ EXTRAFLAGS += -DUAVCAN=1
# we have different config files for V1 and V2
PX4_V1_CONFIG_FILE=$(MK_DIR)/PX4/config_px4fmu-v1_APM.mk
PX4_V2_CONFIG_FILE=$(MK_DIR)/PX4/config_px4fmu-v2_APM.mk
PX4_V4_CONFIG_FILE=$(MK_DIR)/PX4/config_px4fmu-v4_APM.mk
SKETCHFLAGS=$(SKETCHLIBINCLUDES) -DARDUPILOT_BUILD -DTESTS_MATHLIB_DISABLE -DCONFIG_HAL_BOARD=HAL_BOARD_PX4 -DSKETCHNAME="\\\"$(SKETCH)\\\"" -DSKETCH_MAIN=ArduPilot_main -DAPM_BUILD_DIRECTORY=APM_BUILD_$(SKETCH)
@ -102,7 +103,18 @@ px4-v2: $(BUILDROOT)/make.flags CHECK_MODULES $(PX4_ROOT)/Archives/px4fmu-v2.exp
$(v) $(SKETCHBOOK)/Tools/scripts/add_git_hashes.py $(HASHADDER_FLAGS) "$(SKETCH)-v2.px4" "$(SKETCH)-v2.px4"
$(v) echo "PX4 $(SKETCH) Firmware is in $(SKETCH)-v2.px4"
px4: px4-v1 px4-v2
px4-v4: $(BUILDROOT)/make.flags CHECK_MODULES $(PX4_ROOT)/Archives/px4fmu-v4.export $(SKETCHCPP) module_mk
$(RULEHDR)
$(v) rm -f $(PX4_ROOT)/makefiles/$(PX4_V4_CONFIG_FILE)
$(v) cp $(PX4_V4_CONFIG_FILE) $(PX4_ROOT)/makefiles/nuttx/
$(PX4_MAKE) px4fmu-v4_APM
$(v) /bin/rm -f $(SKETCH)-v4.px4
$(v) arm-none-eabi-size $(PX4_ROOT)/Build/px4fmu-v4_APM.build/firmware.elf
$(v) cp $(PX4_ROOT)/Images/px4fmu-v4_APM.px4 $(SKETCH)-v4.px4
$(v) $(SKETCHBOOK)/Tools/scripts/add_git_hashes.py $(HASHADDER_FLAGS) "$(SKETCH)-v4.px4" "$(SKETCH)-v4.px4"
$(v) echo "PX4 $(SKETCH) Firmware is in $(SKETCH)-v4.px4"
px4: px4-v1 px4-v2 px4-v4
px4-clean: clean CHECK_MODULES px4-archives-clean px4-cleandep
$(v) /bin/rm -rf $(PX4_ROOT)/makefiles/build $(PX4_ROOT)/Build
@ -120,6 +132,10 @@ px4-v2-upload: px4-v2
$(RULEHDR)
$(v) $(PX4_MAKE) px4fmu-v2_APM upload
px4-v4-upload: px4-v4
$(RULEHDR)
$(v) $(PX4_MAKE) px4fmu-v4_APM upload
px4-upload: px4-v1-upload
px4-archives-clean:
@ -166,6 +182,7 @@ px4-io: px4-io-v1 px4-io-v2
.NOTPARALLEL: \
$(PX4_ROOT)/Archives/px4fmu-v1.export \
$(PX4_ROOT)/Archives/px4fmu-v2.export \
$(PX4_ROOT)/Archives/px4fmu-v4.export \
$(PX4_ROOT)/Archives/px4io-v1.export \
$(PX4_ROOT)/Archives/px4io-v2.export
@ -175,6 +192,9 @@ $(PX4_ROOT)/Archives/px4fmu-v1.export:
$(PX4_ROOT)/Archives/px4fmu-v2.export:
$(v) $(PX4_MAKE_ARCHIVES) BOARDS="px4fmu-v2"
$(PX4_ROOT)/Archives/px4fmu-v4.export:
$(v) $(PX4_MAKE_ARCHIVES) BOARDS="px4fmu-v4"
$(PX4_ROOT)/Archives/px4io-v1.export:
$(v) $(PX4_MAKE_ARCHIVES) BOARDS="px4io-v1"
@ -182,4 +202,4 @@ $(PX4_ROOT)/Archives/px4io-v2.export:
$(v) $(PX4_MAKE_ARCHIVES) BOARDS="px4io-v2"
px4-archives:
$(v) $(PX4_MAKE_ARCHIVES) BOARDS="px4io-v1 px4io-v2 px4fmu-v1 px4fmu-v2"
$(v) $(PX4_MAKE_ARCHIVES) BOARDS="px4io-v1 px4io-v2 px4fmu-v1 px4fmu-v2 px4fmu-v4"

View File

@ -84,7 +84,7 @@ empty: all
# cope with copter and hil targets
FRAMES = quad tri hexa y6 octa octa-quad heli single coax obc nologging
BOARDS = apm1 apm2 apm2beta apm1-1280 px4 px4-v1 px4-v2 sitl flymaple linux vrbrain vrbrain-v40 vrbrain-v45 vrbrainv-50 vrbrain-v51 vrbrain-v52 vrubrain-v51 vrubrain-v52 vrhero-v10 erle pxf navio raspilot bbbmini minlure erlebrain2
BOARDS = apm1 apm2 apm2beta apm1-1280 px4 px4-v1 px4-v2 px4-v4 sitl flymaple linux vrbrain vrbrain-v40 vrbrain-v45 vrbrainv-50 vrbrain-v51 vrbrain-v52 vrubrain-v51 vrubrain-v52 vrhero-v10 erle pxf navio raspilot bbbmini minlure erlebrain2
define frame_template
$(1)-$(2) : EXTRAFLAGS += "-DFRAME_CONFIG=$(shell echo $(2) | tr a-z A-Z | sed s/-/_/g)_FRAME "