diff --git a/conf/airframes/examples/quadrotor_revo.xml b/conf/airframes/examples/quadrotor_revo.xml new file mode 100644 index 0000000000..ec6e72632b --- /dev/null +++ b/conf/airframes/examples/quadrotor_revo.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + +
+ + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ +
+ + + + +
+ +
diff --git a/conf/boards/openpilot_revo_1.0.makefile b/conf/boards/openpilot_revo_1.0.makefile new file mode 100644 index 0000000000..f8ec885d16 --- /dev/null +++ b/conf/boards/openpilot_revo_1.0.makefile @@ -0,0 +1,58 @@ +# Hey Emacs, this is a -*- makefile -*- +# +# openpilot_revo_1.0.makefile +# +# https://www.openpilot.org/products/openpilot-revolution-platform/ +# + +BOARD=openpilot_revo +BOARD_VERSION=1.0 +BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" + +ARCH=stm32 +ARCH_L=f4 +HARD_FLOAT=yes +$(TARGET).ARCHDIR = $(ARCH) +$(TARGET).LDSCRIPT=$(SRC_ARCH)/openpilot_revo.ld + +# ----------------------------------------------------------------------- + +# default flash mode is via SWD +# other possibilities: DFU, DFU-UTIL, SWD, STLINK +FLASH_MODE ?= SWD + + + +# +# default LED configuration +# +RADIO_CONTROL_LED ?= none +BARO_LED ?= none +AHRS_ALIGNER_LED ?= 2 +GPS_LED ?= none +SYS_TIME_LED ?= 1 + + +# +# default uart configuration +# +RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT ?= UART2 + +MODEM_PORT ?= UART1 +MODEM_BAUD ?= B57600 + +GPS_PORT ?= UART3 +GPS_BAUD ?= B38400 + + + + +# +# default actuator configuration +# +# you can use different actuators by adding a configure option to your firmware section +# e.g. +# +ACTUATORS ?= actuators_pwm diff --git a/conf/conf_tests.xml b/conf/conf_tests.xml index 45c638fe71..19b985f2dc 100644 --- a/conf/conf_tests.xml +++ b/conf/conf_tests.xml @@ -263,6 +263,17 @@ settings_modules="modules/gps_ubx_ucenter.xml" gui_color="#710080" /> + +# +# +# +# +# +# +# +# +# +# +# +# + + +include $(CFG_SHARED)/spi_master.makefile + + +IMU_CFLAGS = -DIMU_TYPE_H=\"imu/imu_mpu6000_hmc5883.h\" +IMU_SRCS = $(SRC_SUBSYSTEMS)/imu.c +IMU_SRCS += $(SRC_SUBSYSTEMS)/imu/imu_mpu6000_hmc5883.c + +# MPU +IMU_SRCS += peripherals/mpu60x0.c +IMU_SRCS += peripherals/mpu60x0_spi.c + +# Magnetometer +IMU_SRCS += peripherals/hmc58xx.c + +# for fixedwing firmware and ap only +ifeq ($(TARGET), ap) + IMU_CFLAGS += -DUSE_IMU +endif + +# HMC is on I2C1 on OpenPilot Revolution +IMU_HMC_I2C_DEV = i2c1 + +# convert i2cx to upper/lower case +IMU_HMC_I2C_DEV_UPPER=$(shell echo $(IMU_HMC_I2C_DEV) | tr a-z A-Z) +IMU_HMC_I2C_DEV_LOWER=$(shell echo $(IMU_HMC_I2C_DEV) | tr A-Z a-z) + +IMU_CFLAGS += -DIMU_HMC_I2C_DEV=$(IMU_HMC_I2C_DEV_LOWER) +IMU_CFLAGS += -DUSE_$(IMU_HMC_I2C_DEV_UPPER) + + +# MPU600 is on SPI1 using SPI_SLAVE_2 as defined in openpilot_revo_1.0.h +IMU_MPU_SPI_DEV = spi1 +IMU_MPU_SPI_SLAVE_IDX = SPI_SLAVE2 + +# convert spix to upper/lower case +IMU_MPU_SPI_DEV_UPPER=$(shell echo $(IMU_MPU_SPI_DEV) | tr a-z A-Z) +IMU_MPU_SPI_DEV_LOWER=$(shell echo $(IMU_MPU_SPI_DEV) | tr A-Z a-z) + +IMU_CFLAGS += -DIMU_MPU_SPI_DEV=$(IMU_MPU_SPI_DEV_LOWER) +IMU_CFLAGS += -DUSE_$(IMU_MPU_SPI_DEV_UPPER) +IMU_CFLAGS += -DIMU_MPU_SPI_SLAVE_IDX=$(IMU_MPU_SPI_SLAVE_IDX) +IMU_CFLAGS += -DUSE_$(IMU_MPU_SPI_SLAVE_IDX) + +# set channels and signs so that positive x-axis is indicated by arrows on board +# and the side with MPU and LEDs is up (negative z-axis) +IMU_CFLAGS += -DIMU_MPU_CHAN_X=1 -DIMU_MPU_CHAN_Y=0 -DIMU_MPU_CHAN_Z=2 +IMU_CFLAGS += -DIMU_MPU_X_SIGN=-1 -DIMU_MPU_Y_SIGN=-1 -DIMU_MPU_Z_SIGN=-1 +IMU_CFLAGS += -DIMU_HMC_CHAN_X=1 -DIMU_HMC_CHAN_Y=0 -DIMU_HMC_CHAN_Z=2 +IMU_CFLAGS += -DIMU_HMC_X_SIGN=1 -DIMU_HMC_Y_SIGN=1 -DIMU_HMC_Z_SIGN=-1 + +# add it for all targets except sim, fbw and nps +ifeq (,$(findstring $(TARGET),sim fbw nps)) +$(TARGET).CFLAGS += $(IMU_CFLAGS) +$(TARGET).srcs += $(IMU_SRCS) +endif + +# +# NPS simulator +# +include $(CFG_SHARED)/imu_nps.makefile diff --git a/conf/flash_modes.xml b/conf/flash_modes.xml index 836398c17c..b34d5d9db8 100644 --- a/conf/flash_modes.xml +++ b/conf/flash_modes.xml @@ -57,6 +57,7 @@ + @@ -68,6 +69,7 @@ + @@ -82,6 +84,7 @@ + diff --git a/sw/airborne/arch/stm32/openpilot_revo.ld b/sw/airborne/arch/stm32/openpilot_revo.ld new file mode 100644 index 0000000000..cfd9897dff --- /dev/null +++ b/sw/airborne/arch/stm32/openpilot_revo.ld @@ -0,0 +1,35 @@ +/* + * Hey Emacs, this is a -*- makefile -*- + * + * Copyright (C) 2016 Felix Ruess