mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-25 23:46:04 +08:00
[board] support of the Chimera autopilot based on STM32F7 (#2018)
* [board] support of the Chimera autopilot based on STM32F7 - based on ChibiOS only (updated to master for proper support of F7) - requires some specific ram for DMA operations - SBUS driver updated and support of internal inverted logic option of F7 * [chibios] fix some compilation errors * [chibios] fix some a few PR comments - test less MCU types - support F1 for uart driver - more autodetect for VTOR_INIT * use correct path * choose a working version of chibios * [chibios] fix some comments from PR review - add some doc - protect LED - update TRUE/FALSE for lowercase - pick a slightly older version of chibios (wrong path in makefile not fixed yet)
This commit is contained in:
committed by
Michal Podhradsky
parent
81fd2161c4
commit
4e5d863291
+15
-11
@@ -50,7 +50,7 @@ ifdef CHIBIOS_BOOTLOADER_SCRIPT
|
||||
CHIBIOS_LINKER_DIR ?= $(PAPARAZZI_SRC)/sw/airborne/arch/chibios/
|
||||
else
|
||||
# we use the original linker script
|
||||
CHIBIOS_LINKER_DIR ?= $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/ld
|
||||
CHIBIOS_LINKER_DIR ?= $(STARTUPLD)
|
||||
endif
|
||||
|
||||
# Launch with "make Q=''" to get full command display
|
||||
@@ -129,6 +129,11 @@ endif
|
||||
# Enable this if you want link time optimizations (LTO)
|
||||
ifeq ($(USE_LTO),)
|
||||
USE_LTO = no
|
||||
else
|
||||
# Force LTO to 'no' if in debug mode
|
||||
ifeq (,$(findstring $(RTOS_DEBUG),0 FALSE))
|
||||
USE_LTO = no
|
||||
endif
|
||||
endif
|
||||
|
||||
# If enabled, this option allows to compile the application in THUMB mode.
|
||||
@@ -171,9 +176,9 @@ ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
|
||||
USE_EXCEPTIONS_STACKSIZE = 0x400
|
||||
endif
|
||||
|
||||
# Enables the use of FPU on Cortex-M4.
|
||||
# Enables the use of FPU on Cortex-M4 / M7 (no, softfp, hard).
|
||||
ifeq ($(USE_FPU),)
|
||||
USE_FPU = yes
|
||||
USE_FPU = hard
|
||||
endif
|
||||
|
||||
#
|
||||
@@ -188,7 +193,7 @@ endif
|
||||
|
||||
# Imported source files and paths
|
||||
# Startup files.
|
||||
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/$(CHIBIOS_BOARD_STARTUP)
|
||||
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/$(CHIBIOS_BOARD_STARTUP)
|
||||
# HAL-OSAL files (optional).
|
||||
include $(CHIBIOS)/os/hal/hal.mk
|
||||
include $(CHIBIOS)/os/hal/ports/STM32/$(CHIBIOS_BOARD_PLATFORM)
|
||||
@@ -196,9 +201,9 @@ include $(CHIBIOS_BOARD_DIR)/board.mk
|
||||
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
|
||||
# RTOS files (optional).
|
||||
include $(CHIBIOS)/os/rt/rt.mk
|
||||
include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
|
||||
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
|
||||
# Other files (optional).
|
||||
#include $(CHIBIOS)/test/rt/test.mk
|
||||
#
|
||||
ifeq ($(USE_FATFS), TRUE)
|
||||
include $(PAPARAZZI_HOME)/conf/chibios/fatfs.mk
|
||||
endif
|
||||
@@ -246,9 +251,9 @@ TCSRC =
|
||||
TCPPSRC =
|
||||
|
||||
# List ASM source files here
|
||||
ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
|
||||
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
|
||||
|
||||
INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
|
||||
INCDIR = $(CHIBIOS)/os/license $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
|
||||
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(FATFSINC) \
|
||||
$(CHIBIOS)/os/various $(CHIBIOS_BOARD_DIR) $(CHIBIOS_PROJECT_DIR)
|
||||
|
||||
@@ -308,7 +313,7 @@ UADEFS = $($(TARGET).CFLAGS) $(USER_CFLAGS) $(BOARD_CFLAGS)
|
||||
|
||||
# List all user directories here
|
||||
# remove -I before include dir because ChibiOS is adding them again
|
||||
UINCDIR = $(patsubst -I%,%,$(INCLUDES))
|
||||
UINCDIR = $(CHIBIOS)/os/license $(patsubst -I%,%,$(INCLUDES))
|
||||
|
||||
# List the user directory to look for the libraries here
|
||||
ULIBDIR =
|
||||
@@ -334,7 +339,6 @@ endif
|
||||
|
||||
|
||||
# Settings for GDB
|
||||
# default port configuration for BMP
|
||||
GDB = $(shell which arm-none-eabi-gdb)
|
||||
|
||||
|
||||
@@ -355,7 +359,7 @@ include $(PAPARAZZI_HOME)/conf/Makefile.stm32-upload
|
||||
|
||||
###############################################################################
|
||||
|
||||
RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
|
||||
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
|
||||
#include $(RULESPATH)/rules.mk
|
||||
|
||||
EXTRA_RULES_INCLUDE_PATH = $(PAPARAZZI_HOME)/conf/chibios/chibios_extra_rules.mk
|
||||
|
||||
@@ -0,0 +1,227 @@
|
||||
<!DOCTYPE airframe SYSTEM "../../airframe.dtd">
|
||||
|
||||
<!--
|
||||
Chimera test board
|
||||
Mako (http://www.readymaderc.com)
|
||||
Apogee 1.0
|
||||
XBEE modem
|
||||
UBX GPS / HMC58XX mag (drotek)
|
||||
-->
|
||||
|
||||
<airframe name="Chimera">
|
||||
|
||||
<firmware name="fixedwing">
|
||||
<configure name="RTOS_DEBUG" value="1"/>
|
||||
|
||||
<target name="ap" board="chimera_1.0">
|
||||
<module name="radio_control" type="sbus"/>
|
||||
<configure name="PERIODIC_FREQUENCY" value="100"/>
|
||||
</target>
|
||||
<target name="sim" board="pc">
|
||||
<module name="radio_control" type="ppm"/>
|
||||
</target>
|
||||
|
||||
<!-- Communication -->
|
||||
<module name="telemetry" type="xbee_api"/>
|
||||
|
||||
<!-- Actuators are automatically chosen according to board-->
|
||||
<module name="imu" type="chimera"/>
|
||||
<configure name="USE_MAGNETOMETER" value="FALSE"/>
|
||||
<module name="ahrs" type="float_dcm"/>
|
||||
<module name="ins" type="alt_float"/>
|
||||
<module name="control" type="new"/>
|
||||
<module name="navigation"/>
|
||||
<!-- Sensors -->
|
||||
<module name="gps" type="ublox"/>
|
||||
<module name="air_data"/>
|
||||
<module name="airspeed" type="ms45xx_i2c">
|
||||
<define name="MS45XX_I2C_DEV" value="i2c1"/>
|
||||
</module>
|
||||
|
||||
<module name="sys_mon"/>
|
||||
|
||||
<!--module name="pwm_meas"/-->
|
||||
<!--module name="spi_master"/-->
|
||||
|
||||
<!--module name="meteo_stick">
|
||||
<configure name="MS_SPI_DEV" value="SPI1"/>
|
||||
<configure name="MS_PRESSURE_SLAVE_IDX" value="0"/>
|
||||
<configure name="MS_DIFF_PRESSURE_SLAVE_IDX" value="3"/>
|
||||
<configure name="MS_TEMPERATURE_SLAVE_IDX" value="2"/>
|
||||
<configure name="MS_EEPROM_SLAVE_IDX" value="1"/>
|
||||
<configure name="MS_HUMIDITY_PWM_INPUT" value="PWM_INPUT1"/>
|
||||
<define name="USE_MS_TEMPERATURE" value="FALSE"/>
|
||||
</module-->
|
||||
|
||||
<!--module name="AOA_pwm">
|
||||
<configure name="AOA_PWM_CHANNEL" value="PWM_INPUT2"/>
|
||||
</module-->
|
||||
|
||||
<module name="tlsf"/>
|
||||
<module name="pprzlog"/>
|
||||
<module name="logger" type="sd_chibios"/>
|
||||
<module name="flight_recorder"/>
|
||||
|
||||
<!-- <module name="mcp355x"> -->
|
||||
<!-- <define name="USE_SPI1"/> -->
|
||||
<!-- </module> -->
|
||||
<!--module name="extra_dl">
|
||||
<configure name="EXTRA_DL_PORT" value="UART6"/>
|
||||
<configure name="EXTRA_DL_BAUD" value="B57600"/>
|
||||
</module>
|
||||
<module name="meteo_france_DAQ"/-->
|
||||
</firmware>
|
||||
|
||||
<firmware name="test_chibios">
|
||||
<target name="test_sys_time_timer" board="chimera_1.0"/>
|
||||
<target name="test_led" board="chimera_1.0"/>
|
||||
<target name="test_sys_gpio" board="chimera_1.0"/>
|
||||
</firmware>
|
||||
|
||||
<section name="METEO_STICK">
|
||||
<define name="LOG_MS" value="TRUE"/>
|
||||
<define name="SEND_MS" value="TRUE"/>
|
||||
</section>
|
||||
|
||||
<!-- commands section -->
|
||||
<servos>
|
||||
<servo name="MOTOR" no="0" min="1000" neutral="1000" max="1800"/>
|
||||
<servo name="AILEVON_LEFT" no="1" min="1000" neutral="1500" max="2000"/>
|
||||
<servo name="AILEVON_RIGHT" no="2" min="2000" neutral="1500" max="1000"/>
|
||||
</servos>
|
||||
|
||||
<commands>
|
||||
<axis name="THROTTLE" failsafe_value="0"/>
|
||||
<axis name="ROLL" failsafe_value="0"/>
|
||||
<axis name="PITCH" failsafe_value="0"/>
|
||||
</commands>
|
||||
|
||||
<rc_commands>
|
||||
<set command="THROTTLE" value="@THROTTLE"/>
|
||||
<set command="ROLL" value="@ROLL"/>
|
||||
<set command="PITCH" value="@PITCH"/>
|
||||
</rc_commands>
|
||||
|
||||
<section name="MIXER">
|
||||
<define name="AILEVON_AILERON_RATE" value="0.75"/>
|
||||
<define name="AILEVON_ELEVATOR_RATE" value="0.75"/>
|
||||
<define name="AILERON_DIFF" value="0.5"/>
|
||||
<define name="COMMAND_ROLL_TRIM" value="0"/>
|
||||
<define name="COMMAND_PITCH_TRIM" value="718"/>
|
||||
</section>
|
||||
|
||||
<command_laws>
|
||||
<let var="aileron" value="@ROLL * AILEVON_AILERON_RATE"/>
|
||||
<let var="elevator" value="@PITCH * AILEVON_ELEVATOR_RATE"/>
|
||||
<set servo="MOTOR" value="@THROTTLE"/>
|
||||
<set servo="AILEVON_LEFT" value="$elevator - ($aileron > 0 ? AILERON_DIFF : 1) * $aileron"/>
|
||||
<set servo="AILEVON_RIGHT" value="$elevator + ($aileron > 0 ? 1 : AILERON_DIFF) * $aileron"/>
|
||||
</command_laws>
|
||||
|
||||
<section name="AUTO1" prefix="AUTO1_">
|
||||
<define name="MAX_ROLL" value="45." unit="deg"/>
|
||||
<define name="MAX_PITCH" value="30." unit="deg"/>
|
||||
</section>
|
||||
|
||||
<section name="IMU" prefix="IMU_">
|
||||
<!-- Calibration Neutral -->
|
||||
<define name="GYRO_P_NEUTRAL" value="0"/>
|
||||
<define name="GYRO_Q_NEUTRAL" value="0"/>
|
||||
<define name="GYRO_R_NEUTRAL" value="0 "/>
|
||||
|
||||
<define name="ACCEL_X_NEUTRAL" value="-36"/>
|
||||
<define name="ACCEL_Y_NEUTRAL" value="26"/>
|
||||
<define name="ACCEL_Z_NEUTRAL" value="7"/>
|
||||
<define name="ACCEL_X_SENS" value="2.44787379999" integer="16"/>
|
||||
<define name="ACCEL_Y_SENS" value="2.45127482156" integer="16"/>
|
||||
<define name="ACCEL_Z_SENS" value="2.43752998117" integer="16"/>
|
||||
|
||||
<define name="MAG_X_SIGN" value="1"/>
|
||||
<define name="MAG_Y_SIGN" value="-1"/>
|
||||
<define name="MAG_Z_SIGN" value="-1"/>
|
||||
<define name="MAG_X_NEUTRAL" value="27"/>
|
||||
<define name="MAG_Y_NEUTRAL" value="-241"/>
|
||||
<define name="MAG_Z_NEUTRAL" value="139"/>
|
||||
<define name="MAG_X_SENS" value="3.89895537059" integer="16"/>
|
||||
<define name="MAG_Y_SENS" value="3.96680514301" integer="16"/>
|
||||
<define name="MAG_Z_SENS" value="4.60606895547" integer="16"/>
|
||||
|
||||
<define name="BODY_TO_IMU_PHI" value="-3.00000701874" unit="deg"/>
|
||||
<define name="BODY_TO_IMU_THETA" value="3.00000701874" unit="deg"/>
|
||||
<define name="BODY_TO_IMU_PSI" value="0" unit="deg"/>
|
||||
</section>
|
||||
|
||||
<section name="INS" prefix="INS_">
|
||||
<define name="H_X" value="0.5180"/>
|
||||
<define name="H_Y" value="-0.0071"/>
|
||||
<define name="H_Z" value="0.8554"/>
|
||||
</section>
|
||||
|
||||
<section name="BAT">
|
||||
<define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/>
|
||||
<define name="MilliAmpereOfAdc(_adc)" value="(_adc-158)*16.5698"/>
|
||||
</section>
|
||||
|
||||
<section name="MISC">
|
||||
<define name="NOMINAL_AIRSPEED" value="15." unit="m/s"/>
|
||||
<define name="CARROT" value="5." unit="s"/>
|
||||
<define name="KILL_MODE_DISTANCE" value="(1.5*MAX_DIST_FROM_HOME)"/>
|
||||
<define name="DEFAULT_CIRCLE_RADIUS" value="80."/>
|
||||
<define name="UNLOCKED_HOME_MODE" value="TRUE"/>
|
||||
</section>
|
||||
|
||||
<section name="VERTICAL CONTROL" prefix="V_CTL_">
|
||||
<!--define name="POWER_CTL_BAT_NOMINAL" value="11.1" unit="volt"/-->
|
||||
<!-- outer loop proportional gain -->
|
||||
<define name="ALTITUDE_PGAIN" value="0.06"/>
|
||||
<!-- outer loop saturation -->
|
||||
<define name="ALTITUDE_MAX_CLIMB" value="3."/>
|
||||
<!-- auto throttle inner loop -->
|
||||
<define name="AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" value="0.5"/>
|
||||
<define name="AUTO_THROTTLE_MIN_CRUISE_THROTTLE" value="0.25"/>
|
||||
<define name="AUTO_THROTTLE_MAX_CRUISE_THROTTLE" value="0.85"/>
|
||||
<define name="AUTO_THROTTLE_LOITER_TRIM" value="1000"/>
|
||||
<define name="AUTO_THROTTLE_DASH_TRIM" value="-1200"/>
|
||||
<define name="AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT" value="0.08" unit="%/(m/s)"/>
|
||||
<define name="AUTO_THROTTLE_PGAIN" value="0.011"/>
|
||||
<define name="AUTO_THROTTLE_IGAIN" value="0.006"/>
|
||||
<define name="AUTO_THROTTLE_PITCH_OF_VZ_PGAIN" value="0.13"/>
|
||||
<define name="THROTTLE_SLEW" value="0.1"/>
|
||||
|
||||
<!-- TODO : CTRL_NEW "Climb loop (pitch)" -->
|
||||
<define name="AUTO_PITCH_PGAIN" value="0.028"/>
|
||||
<define name="AUTO_PITCH_DGAIN" value="0.013"/>
|
||||
<define name="AUTO_PITCH_IGAIN" value="0.006"/>
|
||||
<define name="AUTO_PITCH_MAX_PITCH" value="20" unit="deg"/>
|
||||
<define name="AUTO_PITCH_MIN_PITCH" value="-20" unit="deg"/>
|
||||
|
||||
<define name="PITCH_TRIM" value="4.59999166346" unit="deg"/>
|
||||
</section>
|
||||
|
||||
<section name="HORIZONTAL CONTROL" prefix="H_CTL_">
|
||||
<define name="COURSE_PGAIN" value="0.58"/>
|
||||
<define name="ROLL_MAX_SETPOINT" value="41.0000004297" unit="deg"/>
|
||||
<define name="PITCH_MAX_SETPOINT" value="30." unit="deg"/>
|
||||
<define name="PITCH_MIN_SETPOINT" value="-30." unit="deg"/>
|
||||
<define name="ROLL_ATTITUDE_GAIN" value="10041"/>
|
||||
<define name="ROLL_RATE_GAIN" value="1500"/>
|
||||
<define name="PITCH_PGAIN" value="10672"/>
|
||||
<define name="PITCH_DGAIN" value="1343"/>
|
||||
<define name="AILERON_OF_THROTTLE" value="0.0"/>
|
||||
<define name="PITCH_OF_ROLL" value="0.024"/>
|
||||
</section>
|
||||
|
||||
<section name="FAILSAFE" prefix="FAILSAFE_">
|
||||
<define name="DELAY_WITHOUT_GPS" value="2" unit="s"/>
|
||||
<define name="DEFAULT_THROTTLE" value="0.3" unit="%"/>
|
||||
<define name="DEFAULT_ROLL" value="10" unit="deg"/>
|
||||
<define name="DEFAULT_PITCH" value="5" unit="deg"/>
|
||||
<define name="HOME_RADIUS" value="100" unit="m"/>
|
||||
</section>
|
||||
|
||||
<section name="SIMU">
|
||||
<!--define name="ROLL_RESPONSE_FACTOR" value="10"/>
|
||||
<define name="MAX_ROLL_DOT" value="20" unit="rad/s"/-->
|
||||
</section>
|
||||
|
||||
</airframe>
|
||||
@@ -14,9 +14,8 @@ $(TARGET).ARCHDIR = $(ARCH)
|
||||
|
||||
RTOS=chibios
|
||||
|
||||
# FPU on F4
|
||||
USE_FPU=yes
|
||||
HARD_FLOAT=yes
|
||||
## FPU on F4
|
||||
USE_FPU=softfp
|
||||
|
||||
$(TARGET).CFLAGS += -DSTM32F4 -DPPRZLINK_ENABLE_FD -DUSE_HARD_FAULT_RECOVERY
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
#
|
||||
# chimera_1.0.makefile
|
||||
#
|
||||
# based on STM32F7
|
||||
# pre-version, only compatible with ChibiOS
|
||||
#
|
||||
|
||||
BOARD=chimera
|
||||
BOARD_VERSION=1.0
|
||||
BOARD_DIR=$(BOARD)/chibios/v$(BOARD_VERSION)
|
||||
BOARD_CFG=\"boards/$(BOARD_DIR)/$(BOARD).h\"
|
||||
|
||||
ARCH=chibios
|
||||
$(TARGET).ARCHDIR = $(ARCH)
|
||||
|
||||
RTOS=chibios
|
||||
MCU=cortex-m7
|
||||
|
||||
## FPU on F7
|
||||
USE_FPU=softfp
|
||||
USE_FPU_OPT= -mfpu=fpv5-d16
|
||||
|
||||
USE_LTO=yes
|
||||
|
||||
$(TARGET).CFLAGS += -DSTM32F7 -DPPRZLINK_ENABLE_FD -DUSE_HARD_FAULT_RECOVERY
|
||||
|
||||
##############################################################################
|
||||
# Architecture or project specific options
|
||||
#
|
||||
# Define project name here (target)
|
||||
PROJECT = $(TARGET)
|
||||
|
||||
# Project specific files and paths (see Makefile.chibios for details)
|
||||
CHIBIOS_BOARD_PLATFORM = STM32F7xx/platform.mk
|
||||
CHIBIOS_BOARD_PORT = ARMCMx/STM32F7xx/port.mk
|
||||
CHIBIOS_BOARD_LINKER = STM32F76xxI.ld
|
||||
CHIBIOS_BOARD_STARTUP = startup_stm32f7xx.mk
|
||||
|
||||
# ITCM flash is a special flash that allow faster operations
|
||||
# At the moment it is not possible to flash the code in this mode using dfu-util
|
||||
# but it should work with the BlackMagicProbe or STLINK
|
||||
# By default, normal flash is used
|
||||
ifeq ($(USE_ITCM),1)
|
||||
$(TARGET).CFLAGS += -DUSE_ITCM=1
|
||||
DFU_ADDR = 0x00200000
|
||||
else
|
||||
$(TARGET).CFLAGS += -DUSE_ITCM=0
|
||||
DFU_ADDR = 0x08000000
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
# Compiler settings
|
||||
#
|
||||
|
||||
# default flash mode is via usb dfu bootloader
|
||||
# possibilities: DFU-UTIL, SWD, STLINK
|
||||
FLASH_MODE ?= DFU-UTIL
|
||||
|
||||
HAS_LUFTBOOT = FALSE
|
||||
|
||||
#
|
||||
# default LED configuration
|
||||
#
|
||||
RADIO_CONTROL_LED ?= 4
|
||||
BARO_LED ?= none
|
||||
AHRS_ALIGNER_LED ?= 2
|
||||
GPS_LED ?= 3
|
||||
SYS_TIME_LED ?= 1
|
||||
|
||||
#
|
||||
# default UART configuration (modem, gps, spektrum)
|
||||
#
|
||||
|
||||
MODEM_PORT ?= UART3
|
||||
MODEM_BAUD ?= B57600
|
||||
|
||||
GPS_PORT ?= UART8
|
||||
GPS_BAUD ?= B57600
|
||||
|
||||
RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT ?= UART4
|
||||
RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT ?= UART7
|
||||
|
||||
# single mode
|
||||
SBUS_PORT ?= UART7
|
||||
# dual mode
|
||||
SBUS1_PORT ?= UART7
|
||||
SBUS2_PORT ?= UART4
|
||||
|
||||
#
|
||||
# default actuator configuration
|
||||
#
|
||||
# you can use different actuators by adding a configure option to your firmware section
|
||||
# e.g. <configure name="ACTUATORS" value="actuators_ppm/>
|
||||
# and by setting the correct "driver" attribute in servo section
|
||||
# e.g. <servo driver="Ppm">
|
||||
#
|
||||
ACTUATORS ?= actuators_pwm
|
||||
|
||||
@@ -38,4 +38,4 @@ GPS_BAUD ?= B38400
|
||||
#
|
||||
ACTUATORS ?= actuators_pwm
|
||||
|
||||
include $(PAPARAZZI_SRC)/conf/boards/lisa_m_common_chibios.makefile
|
||||
include $(PAPARAZZI_HOME)/conf/boards/lisa_m_common_chibios.makefile
|
||||
|
||||
@@ -14,9 +14,8 @@ $(TARGET).ARCHDIR = $(ARCH)
|
||||
|
||||
RTOS=chibios
|
||||
|
||||
# FPU on F4
|
||||
USE_FPU=yes
|
||||
HARD_FLOAT=yes
|
||||
## FPU on F4
|
||||
USE_FPU=hard
|
||||
|
||||
$(TARGET).CFLAGS += -DSTM32F4 -DPPRZLINK_ENABLE_FD
|
||||
|
||||
|
||||
@@ -17,8 +17,7 @@ $(TARGET).ARCHDIR = $(ARCH)
|
||||
RTOS=chibios
|
||||
|
||||
# FPU on F4
|
||||
USE_FPU=yes
|
||||
HARD_FLOAT=yes
|
||||
USE_FPU=hard
|
||||
|
||||
$(TARGET).CFLAGS += -DSTM32F4 -DPPRZLINK_ENABLE_FD
|
||||
|
||||
|
||||
@@ -15,8 +15,7 @@ $(TARGET).ARCHDIR = $(ARCH)
|
||||
RTOS=chibios
|
||||
|
||||
# FPU on F4
|
||||
USE_FPU=yes
|
||||
HARD_FLOAT=yes
|
||||
USE_FPU=hard
|
||||
|
||||
$(TARGET).CFLAGS += -DSTM32F4 -DPPRZLINK_ENABLE_FD
|
||||
|
||||
|
||||
@@ -27,17 +27,21 @@ ifeq ($(USE_LTO),yes)
|
||||
OPT += -flto
|
||||
endif
|
||||
|
||||
# FPU-related options
|
||||
ifeq ($(USE_FPU),yes)
|
||||
ifeq ($(HARD_FLOAT),yes)
|
||||
OPT += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
|
||||
else
|
||||
OPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant
|
||||
# FPU options default (Cortex-M4 and Cortex-M7 single precision).
|
||||
ifeq ($(USE_FPU_OPT),)
|
||||
USE_FPU_OPT = -mfpu=fpv4-sp-d16 -fsingle-precision-constant
|
||||
endif
|
||||
DDEFS += -DCORTEX_USE_FPU=TRUE
|
||||
|
||||
# FPU-related options
|
||||
ifeq ($(USE_FPU),)
|
||||
USE_FPU = no
|
||||
endif
|
||||
ifneq ($(USE_FPU),no)
|
||||
OPT += -mfloat-abi=$(USE_FPU) $(USE_FPU_OPT)
|
||||
DDEFS += -DCORTEX_USE_FPU=TRUE
|
||||
DADEFS += -DCORTEX_USE_FPU=TRUE
|
||||
else
|
||||
DDEFS += -DCORTEX_USE_FPU=FALSE
|
||||
DDEFS += -DCORTEX_USE_FPU=FALSE
|
||||
DADEFS += -DCORTEX_USE_FPU=FALSE
|
||||
endif
|
||||
|
||||
@@ -80,8 +84,8 @@ else
|
||||
ACSRC += $(CSRC)
|
||||
ACPPSRC += $(CPPSRC)
|
||||
endif
|
||||
ASRC = $(ACSRC)$(ACPPSRC)
|
||||
TSRC = $(TCSRC)$(TCPPSRC)
|
||||
ASRC = $(ACSRC) $(ACPPSRC)
|
||||
TSRC = $(TCSRC) $(TCPPSRC)
|
||||
SRCPATHS = $(sort $(dir $(ASMXSRC)) $(dir $(ASMSRC)) $(dir $(ASRC)) $(dir $(TSRC)))
|
||||
|
||||
# Various directories
|
||||
@@ -115,24 +119,27 @@ ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
|
||||
ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS)
|
||||
CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS)
|
||||
CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS)
|
||||
LDFLAGS = $(MCFLAGS) $(OPT) -nostartfiles $(LLIBDIR) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--library-path=$(RULESPATH),--script=$(LDSCRIPT)$(LDOPT)
|
||||
LDFLAGS = $(MCFLAGS) $(OPT) -nostartfiles $(LLIBDIR) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--library-path=$(RULESPATH)/ld,--script=$(LDSCRIPT)$(LDOPT)
|
||||
|
||||
# Thumb interwork enabled only if needed because it kills performance.
|
||||
ifneq ($(TSRC),)
|
||||
ifneq ($(strip $(TSRC)),)
|
||||
CFLAGS += -DTHUMB_PRESENT
|
||||
CPPFLAGS += -DTHUMB_PRESENT
|
||||
ASFLAGS += -DTHUMB_PRESENT
|
||||
ifneq ($(ASRC),)
|
||||
ASXFLAGS += -DTHUMB_PRESENT
|
||||
ifneq ($(strip $(ASRC)),)
|
||||
# Mixed ARM and THUMB mode.
|
||||
CFLAGS += -mthumb-interwork
|
||||
CPPFLAGS += -mthumb-interwork
|
||||
ASFLAGS += -mthumb-interwork
|
||||
ASXFLAGS += -mthumb-interwork
|
||||
LDFLAGS += -mthumb-interwork
|
||||
else
|
||||
# Pure THUMB mode, THUMB C code cannot be called by ARM asm code directly.
|
||||
CFLAGS += -mno-thumb-interwork -DTHUMB_NO_INTERWORKING
|
||||
CPPFLAGS += -mno-thumb-interwork -DTHUMB_NO_INTERWORKING
|
||||
ASFLAGS += -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb
|
||||
ASXFLAGS += -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb
|
||||
LDFLAGS += -mno-thumb-interwork -mthumb
|
||||
endif
|
||||
else
|
||||
@@ -140,11 +147,13 @@ else
|
||||
CFLAGS += -mno-thumb-interwork
|
||||
CPPFLAGS += -mno-thumb-interwork
|
||||
ASFLAGS += -mno-thumb-interwork
|
||||
ASXFLAGS += -mno-thumb-interwork
|
||||
LDFLAGS += -mno-thumb-interwork
|
||||
endif
|
||||
|
||||
# Generate dependency information
|
||||
ASFLAGS += -MD -MP -MF $(BUILDDIR)/.dep/$(@F).d
|
||||
ASXFLAGS += -MD -MP -MF $(BUILDDIR)/.dep/$(@F).d
|
||||
CFLAGS += -MD -MP -MF $(BUILDDIR)/.dep/$(@F).d
|
||||
CPPFLAGS += -MD -MP -MF $(BUILDDIR)/.dep/$(@F).d
|
||||
|
||||
@@ -239,6 +248,7 @@ else
|
||||
endif
|
||||
|
||||
%.elf: $(OBJS) $(LDSCRIPT)
|
||||
#$(BUILDDIR)/$(PROJECT).elf: $(OBJS) $(LDSCRIPT)
|
||||
ifeq ($(USE_VERBOSE_COMPILE),yes)
|
||||
@echo
|
||||
$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
|
||||
@@ -247,7 +257,7 @@ else
|
||||
@$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
|
||||
endif
|
||||
|
||||
%.hex: %.elf $(LDSCRIPT)
|
||||
%.hex: %.elf
|
||||
ifeq ($(USE_VERBOSE_COMPILE),yes)
|
||||
$(HEX) $< $@
|
||||
else
|
||||
@@ -255,7 +265,7 @@ else
|
||||
@$(HEX) $< $@
|
||||
endif
|
||||
|
||||
%.bin: %.elf $(LDSCRIPT)
|
||||
%.bin: %.elf
|
||||
ifeq ($(USE_VERBOSE_COMPILE),yes)
|
||||
$(BIN) $< $@
|
||||
else
|
||||
@@ -263,7 +273,7 @@ else
|
||||
@$(BIN) $< $@
|
||||
endif
|
||||
|
||||
%.srec: %.elf $(LDSCRIPT)
|
||||
%.srec: %.elf
|
||||
ifeq ($(USE_VERBOSE_COMPILE),yes)
|
||||
$(SREC) $< $@
|
||||
else
|
||||
@@ -271,7 +281,7 @@ else
|
||||
@$(SREC) $< $@
|
||||
endif
|
||||
|
||||
%.dmp: %.elf $(LDSCRIPT)
|
||||
%.dmp: %.elf
|
||||
ifeq ($(USE_VERBOSE_COMPILE),yes)
|
||||
$(OD) $(ODFLAGS) $< > $@
|
||||
$(SZ) $<
|
||||
|
||||
@@ -247,6 +247,15 @@ else ifeq ($(BOARD), openpilot_revo)
|
||||
BARO_BOARD_SRCS += peripherals/ms5611_i2c.c
|
||||
BARO_BOARD_SRCS += boards/baro_board_ms5611_i2c.c
|
||||
|
||||
else ifeq ($(BOARD), chimera)
|
||||
BARO_BOARD_CFLAGS += -DBARO_BOARD=BARO_MS5611_I2C
|
||||
BARO_BOARD_CFLAGS += -DUSE_I2C1
|
||||
BARO_BOARD_CFLAGS += -DBB_MS5611_I2C_DEV=i2c1
|
||||
BARO_BOARD_CFLAGS += -DBB_MS5611_SLAVE_ADDR=MS5611_I2C_SLAVE_ADDR_ALT
|
||||
BARO_BOARD_SRCS += peripherals/ms5611.c
|
||||
BARO_BOARD_SRCS += peripherals/ms5611_i2c.c
|
||||
BARO_BOARD_SRCS += boards/baro_board_ms5611_i2c.c
|
||||
|
||||
endif # check board
|
||||
|
||||
BARO_LED ?= none
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
<board name="navstik_.*"/>
|
||||
<board name="elle*"/>
|
||||
<board name="openpilot_revo.*"/>
|
||||
<board name="chimera_.*"/>
|
||||
</boards>
|
||||
</mode>
|
||||
<mode name="STLink (SWD)">
|
||||
@@ -71,6 +72,7 @@
|
||||
<board name="elle*"/>
|
||||
<board name="naze32*"/>
|
||||
<board name="openpilot_revo.*"/>
|
||||
<board name="chimera_.*"/>
|
||||
</boards>
|
||||
</mode>
|
||||
<mode name="BlackMagic Probe (SWD)">
|
||||
@@ -88,6 +90,7 @@
|
||||
<board name="cjmcu*"/>
|
||||
<board name="openpilot_revo.*"/>
|
||||
<board name="lia_.*"/>
|
||||
<board name="chimera_.*"/>
|
||||
<board name="vms_ecu_.*"/>
|
||||
</boards>
|
||||
</mode>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE module SYSTEM "module.dtd">
|
||||
|
||||
<module name="imu_chimera" dir="imu">
|
||||
<doc>
|
||||
<description>
|
||||
MPU9250 IMU via SPI.
|
||||
Basically the same as imu_mpu9250_spi, only changed axes assignment for Chimera.
|
||||
</description>
|
||||
</doc>
|
||||
<autoload name="imu_mpu9250_i2c"/>
|
||||
<makefile target="!sim|nps|fbw">
|
||||
<configure name="IMU_MPU9250_I2C_DEV" value="i2c1" case="upper|lower"/>
|
||||
<define name="IMU_MPU9250_CHAN_X" value="1"/>
|
||||
<define name="IMU_MPU9250_CHAN_Y" value="0"/>
|
||||
<define name="IMU_MPU9250_CHAN_Z" value="2"/>
|
||||
<define name="IMU_MPU9250_X_SIGN" value="-1"/>
|
||||
<define name="IMU_MPU9250_Y_SIGN" value="-1"/>
|
||||
<define name="IMU_MPU9250_Z_SIGN" value="-1"/>
|
||||
</makefile>
|
||||
</module>
|
||||
Reference in New Issue
Block a user