AP_HAL_ChibiOS: ensure GPIO pins get undef'ed properly
minimise bi-directional dshot configs for: CubeOrange Durandal MatekF405 MatekH743 OmnibusNanoV6 Pixracer mRoPixracerPro omnibusf4pro CUAV-X7
This commit is contained in:
parent
07c3435f9d
commit
06a1500f98
18
libraries/AP_HAL_ChibiOS/hwdef/CUAV-X7-bdshot/defaults.parm
Normal file
18
libraries/AP_HAL_ChibiOS/hwdef/CUAV-X7-bdshot/defaults.parm
Normal file
@ -0,0 +1,18 @@
|
||||
# temperature control. We need lower P/I values
|
||||
# to prevent oscillation of the BMI088 temperature
|
||||
# the ADIS16470 is factory temperature calibrated,
|
||||
# but the BMI088 isn't, so temperature control is still
|
||||
# worthwhile
|
||||
BRD_IMU_TARGTEMP 45
|
||||
BRD_IMUHEAT_P 50
|
||||
BRD_IMUHEAT_I 0.07
|
||||
|
||||
# turn on the CAN power monitoring(default)
|
||||
CAN_P1_DRIVER 1
|
||||
BATT_MONITOR 8
|
||||
|
||||
# setup the parameter for the ADC power module
|
||||
BATT_VOLT_PIN 16
|
||||
BATT_CURR_PIN 17
|
||||
BATT_VOLT_MULT 18.000
|
||||
BATT_AMP_PERVLT 24.000
|
@ -0,0 +1 @@
|
||||
include ../CUAV-X7/hwdef-bl.dat
|
8
libraries/AP_HAL_ChibiOS/hwdef/CUAV-X7-bdshot/hwdef.dat
Normal file
8
libraries/AP_HAL_ChibiOS/hwdef/CUAV-X7-bdshot/hwdef.dat
Normal file
@ -0,0 +1,8 @@
|
||||
# Bi-directional dshot version CUAV-X7
|
||||
|
||||
include ../CUAV-X7/hwdef.dat
|
||||
|
||||
undef PH10 PH12
|
||||
|
||||
PH10 TIM5_CH1 TIM5 PWM(1) GPIO(50) BIDIR
|
||||
PH12 TIM5_CH3 TIM5 PWM(3) GPIO(52) BIDIR
|
@ -0,0 +1 @@
|
||||
include ../CubeOrange/hwdef-bl.dat
|
@ -1,324 +1,12 @@
|
||||
# hw definition file for processing by chibios_hwdef.py
|
||||
# Bi-directional dshot version of CubeOrange
|
||||
|
||||
# USB setup
|
||||
USB_VENDOR 0x2DAE # ONLY FOR USE BY HEX! NOBODY ELSE
|
||||
USB_PRODUCT 0x1016
|
||||
USB_STRING_MANUFACTURER "Hex/ProfiCNC"
|
||||
USB_STRING_PRODUCT "CubeOrange"
|
||||
USB_STRING_SERIAL "%SERIAL%"
|
||||
include ../CubeOrange/hwdef.dat
|
||||
|
||||
# MCU class and specific type
|
||||
MCU STM32H7xx STM32H743xx
|
||||
undef PE14 PE13 PE11 PE9 PD13 PD14
|
||||
|
||||
# crystal frequency
|
||||
OSCILLATOR_HZ 24000000
|
||||
|
||||
# board ID for firmware load
|
||||
APJ_BOARD_ID 140
|
||||
|
||||
FLASH_SIZE_KB 2048
|
||||
|
||||
# with 2M flash we can afford to optimize for speed
|
||||
env OPTIMIZE -O2
|
||||
|
||||
FLASH_RESERVE_START_KB 128
|
||||
|
||||
define HAL_STORAGE_SIZE 16384
|
||||
|
||||
# order of I2C buses
|
||||
I2C_ORDER I2C2 I2C1
|
||||
|
||||
# order of UARTs (and USB)
|
||||
SERIAL_ORDER OTG1 USART2 USART3 UART4 UART8 UART7 OTG2
|
||||
|
||||
# If the board has an IOMCU connected via a UART then this defines the
|
||||
# UART to talk to that MCU. Leave it out for boards with no IOMCU.
|
||||
|
||||
# UART for IOMCU
|
||||
IOMCU_UART USART6
|
||||
|
||||
# UART4 serial GPS
|
||||
PA0 UART4_TX UART4
|
||||
PA1 UART4_RX UART4 NODMA
|
||||
|
||||
PA2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
|
||||
PA3 BATT_CURRENT_SENS ADC1 SCALE(1)
|
||||
|
||||
# Now the VDD sense pin. This is used to sense primary board voltage.
|
||||
PA4 VDD_5V_SENS ADC1 SCALE(2)
|
||||
|
||||
PA5 SPI1_SCK SPI1
|
||||
PA6 SPI1_MISO SPI1
|
||||
PA7 SPI1_MOSI SPI1
|
||||
|
||||
# This defines an output pin which will default to output HIGH. It is
|
||||
# a pin that enables peripheral power on this board. It starts in the
|
||||
# off state, then is pulled low to enable peripherals in
|
||||
# peripheral_power_enable()
|
||||
PA8 nVDD_5V_PERIPH_EN OUTPUT HIGH
|
||||
|
||||
# This is the pin that senses USB being connected. It is an input pin
|
||||
# setup as OPENDRAIN.
|
||||
PA9 VBUS INPUT OPENDRAIN
|
||||
|
||||
# Now we define the pins that USB is connected on.
|
||||
PA11 OTG_FS_DM OTG1
|
||||
PA12 OTG_FS_DP OTG1
|
||||
|
||||
# These are the pins for SWD debugging with a STlinkv2 or black-magic probe.
|
||||
PA13 JTMS-SWDIO SWD
|
||||
PA14 JTCK-SWCLK SWD
|
||||
|
||||
# PWM output for buzzer
|
||||
PA15 TIM2_CH1 TIM2 GPIO(77) ALARM
|
||||
|
||||
# This defines a couple of general purpose outputs, mapped to GPIO
|
||||
# numbers 1 and 2 for users.
|
||||
PB0 EXTERN_GPIO1 OUTPUT GPIO(1)
|
||||
PB1 EXTERN_GPIO2 OUTPUT GPIO(2)
|
||||
|
||||
# This defines some input pins, currently unused.
|
||||
PB2 BOOT1 INPUT
|
||||
PB3 FMU_SW0 INPUT
|
||||
|
||||
# This defines the pins for the 2nd CAN interface, if available.
|
||||
PB6 CAN2_TX CAN2
|
||||
PB12 CAN2_RX CAN2
|
||||
|
||||
# Now the first I2C bus. The pin speeds are automatically setup
|
||||
# correctly, but can be overridden here if needed.
|
||||
PB8 I2C1_SCL I2C1
|
||||
PB9 I2C1_SDA I2C1
|
||||
|
||||
# the 2nd I2C bus
|
||||
PB10 I2C2_SCL I2C2
|
||||
PB11 I2C2_SDA I2C2
|
||||
|
||||
# the 2nd SPI bus
|
||||
PB13 SPI2_SCK SPI2
|
||||
PB14 SPI2_MISO SPI2
|
||||
PB15 SPI2_MOSI SPI2
|
||||
|
||||
# This input pin is used to detect that power is valid on USB.
|
||||
PC0 VBUS_nVALID INPUT PULLUP
|
||||
|
||||
# This defines the CS pin for the magnetometer and first IMU. Note
|
||||
# that CS pins are software controlled, and are not tied to a particular
|
||||
# SPI bus.
|
||||
PC1 MAG_CS CS
|
||||
PC2 MPU_CS CS
|
||||
|
||||
# This defines more ADC inputs.
|
||||
PC3 AUX_POWER ADC1 SCALE(1)
|
||||
PC4 AUX_ADC2 ADC1 SCALE(1)
|
||||
|
||||
# And the analog input for airspeed (rarely used these days).
|
||||
PC5 PRESSURE_SENS ADC1 SCALE(2)
|
||||
|
||||
# USART6 to IO
|
||||
PC6 USART6_TX USART6
|
||||
PC7 USART6_RX USART6
|
||||
|
||||
# Now setup the pins for the microSD card, if available.
|
||||
PC8 SDMMC1_D0 SDMMC1
|
||||
PC9 SDMMC1_D1 SDMMC1
|
||||
PC10 SDMMC1_D2 SDMMC1
|
||||
PC11 SDMMC1_D3 SDMMC1
|
||||
PC12 SDMMC1_CK SDMMC1
|
||||
PD2 SDMMC1_CMD SDMMC1
|
||||
|
||||
# More CS pins for more sensors. The labels for all CS pins need to
|
||||
# match the SPI device table later in this file.
|
||||
PC13 GYRO_EXT_CS CS
|
||||
PC14 BARO_EXT_CS CS
|
||||
PC15 ACCEL_EXT_CS CS
|
||||
PD7 BARO_CS CS
|
||||
PE4 MPU_EXT_CS CS
|
||||
|
||||
# the first CAN bus
|
||||
PD0 CAN1_RX CAN1
|
||||
PD1 CAN1_TX CAN1
|
||||
|
||||
# Another USART, this one for telem1. This one has RTS and CTS lines.
|
||||
# USART2 serial2 telem1
|
||||
PD3 USART2_CTS USART2
|
||||
PD4 USART2_RTS USART2
|
||||
PD5 USART2_TX USART2
|
||||
PD6 USART2_RX USART2
|
||||
|
||||
# The telem2 USART, also with RTS/CTS available.
|
||||
# USART3 serial3 telem2
|
||||
PD8 USART3_TX USART3
|
||||
PD9 USART3_RX USART3
|
||||
PD11 USART3_CTS USART3
|
||||
PD12 USART3_RTS USART3
|
||||
|
||||
# The CS pin for FRAM (ramtron). This one is marked as using
|
||||
# SPEED_VERYLOW, which matches the HAL_PX4 setup.
|
||||
PD10 FRAM_CS CS SPEED_VERYLOW
|
||||
|
||||
# Now we start defining some PWM pins. We also map these pins to GPIO
|
||||
# values, so users can set BRD_PWM_COUNT to choose how many of the PWM
|
||||
# outputs on the primary MCU are setup as PWM and how many as
|
||||
# GPIOs. To match HAL_PX4 we number the GPIOs for the PWM outputs
|
||||
# starting at 50.
|
||||
PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50) BIDIR
|
||||
PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51) # this will automatically be shared with TIM1_CH4
|
||||
PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52) BIDIR
|
||||
PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53) # this will automatically be shared with TIM1_CH1
|
||||
PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54) BIDIR
|
||||
PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55) BIDIR
|
||||
|
||||
define BOARD_PWM_COUNT_DEFAULT 4
|
||||
|
||||
# Pin for PWM Voltage Selection
|
||||
PB4 PWM_VOLT_SEL OUTPUT HIGH GPIO(3)
|
||||
|
||||
# Relays default to use GPIO pins 54 and 55.
|
||||
define RELAY1_PIN_DEFAULT 54
|
||||
define RELAY2_PIN_DEFAULT 55
|
||||
|
||||
# This is the invensense data-ready pin. We don't use it in the
|
||||
# default driver.
|
||||
PD15 MPU_DRDY INPUT
|
||||
|
||||
# the 2nd GPS UART
|
||||
# UART8 serial4 GPS2
|
||||
PE0 UART8_RX UART8
|
||||
PE1 UART8_TX UART8 NODMA
|
||||
|
||||
# Now setup SPI bus4.
|
||||
PE2 SPI4_SCK SPI4
|
||||
PE5 SPI4_MISO SPI4
|
||||
PE6 SPI4_MOSI SPI4
|
||||
|
||||
# This is the pin to enable the sensors rail. It can be used to power
|
||||
# cycle sensors to recover them in case there are problems with power on
|
||||
# timing affecting sensor stability. We pull it LOW on startup, which
|
||||
# means sensors off, then it is pulled HIGH in peripheral_power_enable()
|
||||
PE3 VDD_3V3_SENSORS_EN OUTPUT LOW
|
||||
|
||||
# UART7 maps to uartF in the HAL (serial5 in SERIALn_ parameters).
|
||||
PE7 UART7_RX UART7
|
||||
PE8 UART7_TX UART7
|
||||
|
||||
# Define a LED, mapping it to GPIO(0). LOW will illuminate the LED
|
||||
PE12 FMU_LED_AMBER OUTPUT HIGH OPENDRAIN GPIO(0)
|
||||
|
||||
# Power flag pins: these tell the MCU the status of the various power
|
||||
# supplies that are available. The pin names need to exactly match the
|
||||
# names used in AnalogIn.cpp.
|
||||
PB5 VDD_BRICK_nVALID INPUT PULLUP
|
||||
PB7 VDD_BRICK2_nVALID INPUT PULLUP
|
||||
PE10 VDD_5V_HIPOWER_nOC INPUT PULLUP
|
||||
PE15 VDD_5V_PERIPH_nOC INPUT PULLUP
|
||||
|
||||
SPIDEV ms5611 SPI1 DEVID3 BARO_CS MODE3 20*MHZ 20*MHZ
|
||||
SPIDEV ms5611_ext SPI4 DEVID2 BARO_EXT_CS MODE3 20*MHZ 20*MHZ
|
||||
SPIDEV mpu6000 SPI1 DEVID4 MPU_CS MODE3 2*MHZ 8*MHZ
|
||||
SPIDEV icm20608-am SPI1 DEVID2 ACCEL_EXT_CS MODE3 4*MHZ 8*MHZ
|
||||
SPIDEV mpu9250 SPI1 DEVID4 MPU_CS MODE3 4*MHZ 8*MHZ
|
||||
SPIDEV mpu9250_ext SPI4 DEVID1 MPU_EXT_CS MODE3 4*MHZ 8*MHZ
|
||||
SPIDEV icm20948 SPI1 DEVID4 MPU_CS MODE3 4*MHZ 8*MHZ
|
||||
SPIDEV icm20948_ext SPI4 DEVID1 MPU_EXT_CS MODE3 4*MHZ 8*MHZ
|
||||
SPIDEV hmc5843 SPI1 DEVID5 MAG_CS MODE3 11*MHZ 11*MHZ
|
||||
SPIDEV lsm9ds0_g SPI1 DEVID1 GYRO_EXT_CS MODE3 11*MHZ 11*MHZ
|
||||
SPIDEV lsm9ds0_am SPI1 DEVID2 ACCEL_EXT_CS MODE3 11*MHZ 11*MHZ
|
||||
SPIDEV lsm9ds0_ext_g SPI4 DEVID4 GYRO_EXT_CS MODE3 11*MHZ 11*MHZ
|
||||
SPIDEV lsm9ds0_ext_am SPI4 DEVID3 ACCEL_EXT_CS MODE3 11*MHZ 11*MHZ
|
||||
SPIDEV icm20602_ext SPI4 DEVID4 GYRO_EXT_CS MODE3 4*MHZ 8*MHZ
|
||||
SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ
|
||||
SPIDEV external0m0 SPI4 DEVID5 MPU_EXT_CS MODE0 2*MHZ 2*MHZ
|
||||
SPIDEV external0m1 SPI4 DEVID5 MPU_EXT_CS MODE1 2*MHZ 2*MHZ
|
||||
SPIDEV external0m2 SPI4 DEVID5 MPU_EXT_CS MODE2 2*MHZ 2*MHZ
|
||||
SPIDEV external0m3 SPI4 DEVID5 MPU_EXT_CS MODE3 2*MHZ 2*MHZ
|
||||
SPIDEV pixartPC15 SPI4 DEVID13 ACCEL_EXT_CS MODE3 2*MHZ 2*MHZ
|
||||
|
||||
# three IMUs, but allow for different varients. First two IMUs are
|
||||
# isolated, 3rd isn't
|
||||
IMU Invensense SPI:mpu9250_ext ROTATION_PITCH_180
|
||||
|
||||
# the 3 rotations for the LSM9DS0 driver are for the accel, the gyro
|
||||
# and the H varient of the gyro
|
||||
IMU LSM9DS0 SPI:lsm9ds0_ext_g SPI:lsm9ds0_ext_am ROTATION_ROLL_180_YAW_270 ROTATION_ROLL_180_YAW_90 ROTATION_ROLL_180_YAW_90
|
||||
|
||||
# 3rd non-isolated IMU
|
||||
IMU Invensense SPI:mpu9250 ROTATION_YAW_270
|
||||
|
||||
# alternative IMU set for newer cubes
|
||||
IMU Invensense SPI:icm20602_ext ROTATION_ROLL_180_YAW_270
|
||||
IMU Invensensev2 SPI:icm20948_ext ROTATION_PITCH_180
|
||||
IMU Invensensev2 SPI:icm20948 ROTATION_YAW_270
|
||||
|
||||
# Sensor Check alias for validating board type
|
||||
CHECK_ICM20649 spi_check_register_inv2("icm20948", INV2REG_WHOAMI, INV2_WHOAMI_ICM20649)
|
||||
CHECK_ICM20602_EXT spi_check_register("icm20602_ext", MPUREG_WHOAMI, MPU_WHOAMI_ICM20602)
|
||||
CHECK_ICM20948_EXT spi_check_register_inv2("icm20948_ext", INV2REG_WHOAMI, INV2_WHOAMI_ICM20948)
|
||||
CHECK_MS5611 check_ms5611("ms5611")
|
||||
CHECK_MS5611_EXT check_ms5611("ms5611_ext")
|
||||
|
||||
# Sensor Check Macros to be used for validating board type
|
||||
CHECK_IMU0_PRESENT $CHECK_ICM20602_EXT
|
||||
CHECK_IMU1_PRESENT $CHECK_ICM20948_EXT
|
||||
CHECK_IMU2_PRESENT $CHECK_ICM20649
|
||||
CHECK_BARO0_PRESENT $CHECK_MS5611
|
||||
CHECK_BARO1_PRESENT $CHECK_MS5611_EXT
|
||||
|
||||
BOARD_VALIDATE $CHECK_IMU0_PRESENT $CHECK_IMU1_PRESENT $CHECK_IMU2_PRESENT $CHECK_BARO0_PRESENT $CHECK_BARO1_PRESENT
|
||||
|
||||
|
||||
define HAL_DEFAULT_INS_FAST_SAMPLE 7
|
||||
|
||||
# two baros
|
||||
BARO MS56XX SPI:ms5611_ext
|
||||
BARO MS56XX SPI:ms5611
|
||||
|
||||
# two compasses. First is in the LSM303D
|
||||
COMPASS LSM303D SPI:lsm9ds0_ext_am ROTATION_YAW_270
|
||||
# 2nd compass is part of the 2nd invensense IMU
|
||||
COMPASS AK8963:probe_mpu9250 1 ROTATION_YAW_270
|
||||
|
||||
# compass as part of ICM20948 on newer cubes
|
||||
COMPASS AK09916:probe_ICM20948 0 ROTATION_ROLL_180_YAW_90
|
||||
|
||||
# also probe for external compasses
|
||||
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
|
||||
|
||||
define HAL_CHIBIOS_ARCH_FMUV3 1
|
||||
|
||||
define BOARD_TYPE_DEFAULT 3
|
||||
|
||||
# Nnow some defines for logging and terrain data files.
|
||||
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
|
||||
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
|
||||
|
||||
# allow to have have a dedicated safety switch pin
|
||||
define HAL_HAVE_SAFETY_SWITCH 1
|
||||
|
||||
# Enable RAMTROM parameter storage.
|
||||
define HAL_WITH_RAMTRON 1
|
||||
|
||||
# Setup for the possibility of an IMU heater since the pixhawk2 cube has
|
||||
# an IMU heater.
|
||||
define HAL_HAVE_IMU_HEATER 1
|
||||
|
||||
# Enable FAT filesystem support (needs a microSD defined via SDMMC).
|
||||
define HAL_OS_FATFS_IO 1
|
||||
|
||||
# Now setup the default battery pins driver analog pins and default
|
||||
# scaling for the power brick.
|
||||
define HAL_BATT_VOLT_PIN 14
|
||||
define HAL_BATT_CURR_PIN 15
|
||||
define HAL_BATT_VOLT_SCALE 10.1
|
||||
define HAL_BATT_CURR_SCALE 17.0
|
||||
define HAL_GPIO_PWM_VOLT_PIN 3
|
||||
define HAL_GPIO_PWM_VOLT_3v3 1
|
||||
|
||||
# List of files to put in ROMFS. For fmuv3 we need an IO firmware so
|
||||
# we can automatically update the IOMCU firmware on boot. The format
|
||||
# is "ROMFS ROMFS-filename source-filename". Paths are relative to the
|
||||
# ardupilot root.
|
||||
ROMFS io_firmware.bin Tools/IO_Firmware/iofirmware_highpolh.bin
|
||||
|
||||
DMA_NOSHARE SPI1* SPI4* USART6*
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
include ../Durandal/hwdef-bl.dat
|
10
libraries/AP_HAL_ChibiOS/hwdef/Durandal-bdshot/hwdef.dat
Normal file
10
libraries/AP_HAL_ChibiOS/hwdef/Durandal-bdshot/hwdef.dat
Normal file
@ -0,0 +1,10 @@
|
||||
# Bi-directional dshot version of Durandal
|
||||
|
||||
include ../Durandal/hwdef.dat
|
||||
|
||||
undef PE14 PA10 PE11 PE9 PD13 PD14
|
||||
|
||||
PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50) BIDIR
|
||||
PA10 TIM1_CH3 TIM1 PWM(2) GPIO(51)
|
||||
PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52) BIDIR
|
||||
PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53)
|
@ -0,0 +1 @@
|
||||
include ../MatekF405/hwdef-bl.dat
|
@ -1,173 +1,7 @@
|
||||
# hw definition file for MatekF405 hardware
|
||||
# tested on the MatekF405-OSD board
|
||||
# with thanks to betaflight for pinout
|
||||
# Bi-directional dshot version of MatekF405
|
||||
|
||||
include ../MatekF405/hwdef.dat
|
||||
|
||||
# MCU class and specific type
|
||||
MCU STM32F4xx STM32F405xx
|
||||
undef PC6
|
||||
|
||||
# board ID for firmware load
|
||||
APJ_BOARD_ID 125
|
||||
|
||||
# crystal frequency
|
||||
OSCILLATOR_HZ 8000000
|
||||
|
||||
define STM32_ST_USE_TIMER 4
|
||||
define CH_CFG_ST_RESOLUTION 16
|
||||
|
||||
FLASH_SIZE_KB 1024
|
||||
|
||||
|
||||
# only one I2C bus
|
||||
I2C_ORDER I2C1
|
||||
|
||||
# order of UARTs (and USB)
|
||||
SERIAL_ORDER OTG1 USART3 UART4 USART1 UART5 USART2
|
||||
|
||||
# LEDs
|
||||
PB9 LED_BLUE OUTPUT LOW GPIO(0)
|
||||
PA14 LED_GREEN OUTPUT LOW GPIO(1)
|
||||
|
||||
define HAL_GPIO_A_LED_PIN 0
|
||||
define HAL_GPIO_B_LED_PIN 1
|
||||
|
||||
# buzzer
|
||||
PC13 BUZZER OUTPUT GPIO(80) LOW
|
||||
define HAL_BUZZER_PIN 80
|
||||
define HAL_BUZZER_ON 1
|
||||
define HAL_BUZZER_OFF 0
|
||||
|
||||
# spi1 bus for IMU
|
||||
PA5 SPI1_SCK SPI1
|
||||
PA6 SPI1_MISO SPI1
|
||||
PA7 SPI1_MOSI SPI1
|
||||
|
||||
# spi2 for OSD
|
||||
PB13 SPI2_SCK SPI2
|
||||
PB14 SPI2_MISO SPI2
|
||||
PB15 SPI2_MOSI SPI2
|
||||
PB10 MAX7456_CS CS
|
||||
|
||||
# spi3 for sdcard and onboard flash
|
||||
PB3 SPI3_SCK SPI3
|
||||
PB4 SPI3_MISO SPI3
|
||||
PB5 SPI3_MOSI SPI3
|
||||
PC1 SDCARD_CS CS
|
||||
PC0 M25P16_CS CS
|
||||
|
||||
PC2 MPU6000_CS CS
|
||||
|
||||
# only one I2C bus in normal config
|
||||
PB6 I2C1_SCL I2C1
|
||||
PB7 I2C1_SDA I2C1
|
||||
|
||||
# analog pins
|
||||
PC5 BATT_VOLTAGE_SENS ADC1 SCALE(1)
|
||||
PC4 BATT_CURRENT_SENS ADC1 SCALE(1)
|
||||
PB1 RSSI_ADC_PIN ADC1 SCALE(1)
|
||||
|
||||
# define default battery setup
|
||||
# PC5 - ADC12_CH15
|
||||
define HAL_BATT_VOLT_PIN 15
|
||||
# PC4 - ADC12_CH14
|
||||
define HAL_BATT_CURR_PIN 14
|
||||
define HAL_BATT_VOLT_SCALE 10.1
|
||||
define HAL_BATT_CURR_SCALE 17.0
|
||||
|
||||
#analog rssi pin (also could be used as analog airspeed input)
|
||||
# PB1 - ADC12_CH9
|
||||
define BOARD_RSSI_ANA_PIN 9
|
||||
|
||||
# USART1
|
||||
PA9 USART1_TX USART1
|
||||
PA10 USART1_RX USART1
|
||||
|
||||
# RC input using timer
|
||||
PA3 TIM9_CH2 TIM9 RCININT PULLDOWN
|
||||
|
||||
# alternative RC input using UART
|
||||
PA2 USART2_TX USART2 NODMA
|
||||
PA3 USART2_RX USART2 NODMA ALT(1)
|
||||
|
||||
# USART3
|
||||
PC10 USART3_TX USART3
|
||||
PC11 USART3_RX USART3
|
||||
|
||||
# UART4
|
||||
PA0 UART4_TX UART4
|
||||
PA1 UART4_RX UART4
|
||||
|
||||
# UART5
|
||||
PD2 UART5_RX UART5
|
||||
PC12 UART5_TX UART5
|
||||
|
||||
# PA10 IO-debug-console
|
||||
PA11 OTG_FS_DM OTG1
|
||||
PA12 OTG_FS_DP OTG1
|
||||
|
||||
# USB detection
|
||||
PB12 VBUS INPUT OPENDRAIN
|
||||
|
||||
# debug (disabled out to allow for both LEDs)
|
||||
#PA13 JTMS-SWDIO SWD
|
||||
#PA14 JTCK-SWCLK SWD
|
||||
|
||||
# PWM out pins. Note that channel order follows the ArduPilot motor
|
||||
# order conventions
|
||||
PC6 TIM8_CH1 TIM8 PWM(1) GPIO(50) BIDIR
|
||||
PC7 TIM8_CH2 TIM8 PWM(2) GPIO(51)
|
||||
PC8 TIM8_CH3 TIM8 PWM(3) GPIO(52)
|
||||
PC9 TIM8_CH4 TIM8 PWM(4) GPIO(53)
|
||||
PA15 TIM2_CH1 TIM2 PWM(5) GPIO(54)
|
||||
PA8 TIM1_CH1 TIM1 PWM(6) GPIO(55)
|
||||
|
||||
define HAL_STORAGE_SIZE 15360
|
||||
define STORAGE_FLASH_PAGE 2
|
||||
|
||||
# reserve 32k for bootloader and 32k for flash storage
|
||||
FLASH_RESERVE_START_KB 64
|
||||
|
||||
# one IMU
|
||||
IMU Invensense SPI:mpu6000 ROTATION_YAW_180
|
||||
|
||||
# probe for I2C BMP280, but allow init on board variants without onboard baro too
|
||||
BARO BMP280 I2C:0:0x76
|
||||
define HAL_PROBE_EXTERNAL_I2C_BAROS
|
||||
define HAL_BARO_ALLOW_INIT_NO_BARO
|
||||
|
||||
# no built-in compass, but probe the i2c bus for all possible
|
||||
# external compass types
|
||||
define ALLOW_ARM_NO_COMPASS
|
||||
define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
|
||||
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
|
||||
define HAL_I2C_INTERNAL_MASK 0
|
||||
define HAL_COMPASS_AUTO_ROT_DEFAULT 2
|
||||
|
||||
# SPI devices
|
||||
SPIDEV mpu6000 SPI1 DEVID1 MPU6000_CS MODE3 1*MHZ 8*MHZ
|
||||
SPIDEV sdcard SPI3 DEVID1 SDCARD_CS MODE0 400*KHZ 25*MHZ
|
||||
SPIDEV osd SPI2 DEVID1 MAX7456_CS MODE0 10*MHZ 10*MHZ
|
||||
|
||||
# filesystem setup on sdcard
|
||||
define HAL_OS_FATFS_IO 1
|
||||
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
|
||||
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
|
||||
|
||||
# 8 PWM available by default
|
||||
define BOARD_PWM_COUNT_DEFAULT 8
|
||||
|
||||
# setup for OSD
|
||||
define OSD_ENABLED 1
|
||||
define HAL_OSD_TYPE_DEFAULT 1
|
||||
ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin
|
||||
|
||||
# disable SMBUS and fuel battery monitors to save flash
|
||||
define HAL_BATTMON_SMBUS_ENABLE 0
|
||||
define HAL_BATTMON_FUEL_ENABLE 0
|
||||
|
||||
# disable parachute and sprayer to save flash
|
||||
define HAL_PARACHUTE_ENABLED 0
|
||||
define HAL_SPRAYER_ENABLED 0
|
||||
|
||||
# reduce max size of embedded params for apj_tool.py
|
||||
define AP_PARAM_MAX_EMBEDDED_PARAM 1024
|
||||
|
@ -0,0 +1 @@
|
||||
include ../MatekH743/hwdef-bl.dat
|
@ -1,138 +1,13 @@
|
||||
# hw definition file for processing by chibios_pins.py
|
||||
# for Matek H743-WING
|
||||
# Bi-directional dshot version of MatekF405
|
||||
# RC input and buzzer timers need to be used so buzzer becomes single tone
|
||||
# and UART is used for RCIN
|
||||
|
||||
# MCU class and specific type
|
||||
MCU STM32H7xx STM32H743xx
|
||||
include ../MatekH743/hwdef.dat
|
||||
|
||||
# board ID for firmware load
|
||||
APJ_BOARD_ID 1013
|
||||
# undefine the pins we are going to change
|
||||
undef PC7 PB0 PB1 PA0 PA1 PA15
|
||||
|
||||
# crystal frequency, setup to use external oscillator
|
||||
OSCILLATOR_HZ 8000000
|
||||
|
||||
FLASH_SIZE_KB 2048
|
||||
env OPTIMIZE -O2
|
||||
|
||||
# bootloader takes first sector
|
||||
FLASH_RESERVE_START_KB 128
|
||||
|
||||
|
||||
# ChibiOS system timer
|
||||
STM32_ST_USE_TIMER 12
|
||||
define CH_CFG_ST_RESOLUTION 16
|
||||
|
||||
# USB
|
||||
PA11 OTG_FS_DM OTG1
|
||||
PA12 OTG_FS_DP OTG1
|
||||
|
||||
PA13 JTMS-SWDIO SWD
|
||||
PA14 JTCK-SWCLK SWD
|
||||
|
||||
# SPI1 for IMU1 (MPU6000)
|
||||
PA5 SPI1_SCK SPI1
|
||||
PA6 SPI1_MISO SPI1
|
||||
PD7 SPI1_MOSI SPI1
|
||||
PC15 IMU1_CS CS
|
||||
|
||||
# SPI2 for MAX7456 OSD
|
||||
PB12 MAX7456_CS CS
|
||||
PB13 SPI2_SCK SPI2
|
||||
PB14 SPI2_MISO SPI2
|
||||
PB15 SPI2_MOSI SPI2
|
||||
|
||||
# SPI3 - external
|
||||
PB3 SPI3_SCK SPI3
|
||||
PB4 SPI3_MISO SPI3
|
||||
PB5 SPI3_MOSI SPI3
|
||||
|
||||
# external CS pins
|
||||
PD4 EXT_CS1 CS
|
||||
PE2 EXT_CS2 CS
|
||||
|
||||
# SPI4 for IMU2 (ICM20602)
|
||||
PE11 IMU2_CS CS
|
||||
PE12 SPI4_SCK SPI4
|
||||
PE13 SPI4_MISO SPI4
|
||||
PE14 SPI4_MOSI SPI4
|
||||
|
||||
# two I2C bus
|
||||
I2C_ORDER I2C2 I2C1
|
||||
|
||||
# I2C1
|
||||
PB6 I2C1_SCL I2C1
|
||||
PB7 I2C1_SDA I2C1
|
||||
|
||||
# I2C2
|
||||
PB10 I2C2_SCL I2C2
|
||||
PB11 I2C2_SDA I2C2
|
||||
|
||||
# ADC
|
||||
PC0 BATT_VOLTAGE_SENS ADC1 SCALE(1)
|
||||
PC1 BATT_CURRENT_SENS ADC1 SCALE(1)
|
||||
PA4 BATT2_VOLTAGE_SENS ADC1 SCALE(1)
|
||||
PA7 BATT2_CURRENT_SENS ADC1 SCALE(1)
|
||||
|
||||
define HAL_BATT_MONITOR_DEFAULT 4
|
||||
define HAL_BATT_VOLT_PIN 10
|
||||
define HAL_BATT_CURR_PIN 11
|
||||
define HAL_BATT2_VOLT_PIN 18
|
||||
define HAL_BATT2_CURR_PIN 7
|
||||
define HAL_BATT_VOLT_SCALE 11.0
|
||||
define HAL_BATT_CURR_SCALE 40.0
|
||||
define HAL_BATT2_VOLT_SCALE 11.0
|
||||
|
||||
PC4 PRESSURE_SENS ADC1 SCALE(2)
|
||||
define HAL_DEFAULT_AIRSPEED_PIN 4
|
||||
|
||||
PC5 RSSI_ADC ADC1
|
||||
define BOARD_RSSI_ANA_PIN 8
|
||||
|
||||
# LED
|
||||
# green LED1 marked as B/E
|
||||
# blue LED0 marked as ACT
|
||||
PE3 LED0 OUTPUT LOW GPIO(90) # blue
|
||||
PE4 LED1 OUTPUT LOW GPIO(91) # green
|
||||
define HAL_GPIO_A_LED_PIN 91
|
||||
define HAL_GPIO_B_LED_PIN 90
|
||||
define HAL_GPIO_LED_OFF 1
|
||||
|
||||
# order of UARTs (and USB)
|
||||
SERIAL_ORDER OTG1 UART7 USART1 USART2 USART3 UART8 UART4 USART6 OTG2
|
||||
|
||||
# USART1 (telem2)
|
||||
PA10 USART1_RX USART1
|
||||
PA9 USART1_TX USART1
|
||||
|
||||
# USART2 (GPS1)
|
||||
PD5 USART2_TX USART2
|
||||
PD6 USART2_RX USART2
|
||||
|
||||
# USART3 (GPS2)
|
||||
PD9 USART3_RX USART3
|
||||
PD8 USART3_TX USART3
|
||||
|
||||
# UART4 (spare)
|
||||
PB9 UART4_TX UART4
|
||||
PB8 UART4_RX UART4
|
||||
|
||||
# USART6 (RC input), SERIAL7
|
||||
PC7 USART6_RX USART6
|
||||
PC6 USART6_TX USART6 NODMA
|
||||
|
||||
# UART7 (telem1)
|
||||
PE7 UART7_RX UART7
|
||||
PE8 UART7_TX UART7
|
||||
PE10 UART7_CTS UART7
|
||||
PE9 UART7_RTS UART7
|
||||
|
||||
# UART8 (spare)
|
||||
PE0 UART8_RX UART8
|
||||
PE1 UART8_TX UART8
|
||||
|
||||
# CAN bus
|
||||
PD0 CAN1_RX CAN1
|
||||
PD1 CAN1_TX CAN1
|
||||
PD3 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(70)
|
||||
|
||||
# Motors
|
||||
PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50) BIDIR
|
||||
@ -140,78 +15,11 @@ PB1 TIM3_CH4 TIM3 PWM(2) GPIO(51)
|
||||
PA0 TIM2_CH1 TIM2 PWM(3) GPIO(52) BIDIR
|
||||
PA1 TIM2_CH2 TIM2 PWM(4) GPIO(53)
|
||||
|
||||
PA2 TIM5_CH3 TIM5 PWM(5) GPIO(54)
|
||||
PA3 TIM5_CH4 TIM5 PWM(6) GPIO(55)
|
||||
PD12 TIM4_CH1 TIM4 PWM(7) GPIO(56)
|
||||
PD13 TIM4_CH2 TIM4 PWM(8) GPIO(57)
|
||||
PD14 TIM4_CH3 TIM4 PWM(9) GPIO(58)
|
||||
PD15 TIM4_CH4 TIM4 PWM(10) GPIO(59)
|
||||
PE5 TIM15_CH1 TIM15 PWM(11) GPIO(60)
|
||||
PE6 TIM15_CH2 TIM15 PWM(12) GPIO(61)
|
||||
PA8 TIM1_CH1 TIM1 PWM(13) GPIO(62) # for WS2812 LED
|
||||
|
||||
# Beeper
|
||||
PA15 BUZZER OUTPUT GPIO(32) LOW
|
||||
define HAL_BUZZER_PIN 32
|
||||
define HAL_BUZZER_ON 1
|
||||
define HAL_BUZZER_OFF 0
|
||||
|
||||
# microSD support
|
||||
PC8 SDMMC1_D0 SDMMC1
|
||||
PC9 SDMMC1_D1 SDMMC1
|
||||
PC10 SDMMC1_D2 SDMMC1
|
||||
PC11 SDMMC1_D3 SDMMC1
|
||||
PC12 SDMMC1_CK SDMMC1
|
||||
PD2 SDMMC1_CMD SDMMC1
|
||||
|
||||
# GPIOs
|
||||
PD10 PINIO1 OUTPUT GPIO(81) LOW
|
||||
PD11 PINIO2 OUTPUT GPIO(82) LOW
|
||||
|
||||
DMA_PRIORITY S* TIM3* TIM2*
|
||||
|
||||
define HAL_STORAGE_SIZE 16384
|
||||
|
||||
# use last 2 pages for flash storage
|
||||
# H743 has 16 pages of 128k each
|
||||
define STORAGE_FLASH_PAGE 14
|
||||
|
||||
# spi devices
|
||||
SPIDEV mpu6000 SPI1 DEVID1 IMU1_CS MODE3 1*MHZ 4*MHZ
|
||||
SPIDEV icm20602 SPI4 DEVID1 IMU2_CS MODE3 1*MHZ 4*MHZ
|
||||
SPIDEV osd SPI2 DEVID4 MAX7456_CS MODE0 10*MHZ 10*MHZ
|
||||
|
||||
DMA_NOSHARE SPI1* SPI4* TIM3* TIM2*
|
||||
|
||||
# SPI3 external connections
|
||||
SPIDEV pixartflow SPI3 DEVID1 EXT_CS1 MODE3 2*MHZ 2*MHZ
|
||||
|
||||
# no built-in compass, but probe the i2c bus for all possible
|
||||
# external compass types
|
||||
define ALLOW_ARM_NO_COMPASS
|
||||
define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
|
||||
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
|
||||
define HAL_I2C_INTERNAL_MASK 0
|
||||
define HAL_COMPASS_AUTO_ROT_DEFAULT 2
|
||||
|
||||
# two IMUs. We put icm20602 first as we can sample accel at 4kHz
|
||||
IMU Invensense SPI:icm20602 ROTATION_ROLL_180_YAW_270
|
||||
IMU Invensense SPI:mpu6000 ROTATION_ROLL_180_YAW_270
|
||||
define HAL_DEFAULT_INS_FAST_SAMPLE 1
|
||||
|
||||
# MS5611 integrated on I2C2 bus, multiple possible choices for external barometer
|
||||
BARO MS56XX I2C:0:0x77
|
||||
BARO DPS280 I2C:0:0x76
|
||||
BARO BMP280 I2C:0:0x76
|
||||
|
||||
define HAL_OS_FATFS_IO 1
|
||||
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
|
||||
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
|
||||
|
||||
# setup for OSD
|
||||
define OSD_ENABLED 1
|
||||
define HAL_OSD_TYPE_DEFAULT 1
|
||||
ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin
|
||||
|
||||
define BOARD_PWM_COUNT_DEFAULT 13
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
include ../OmnibusNanoV6/hwdef-bl.dat
|
@ -1,152 +1,13 @@
|
||||
# hw definition file for processing by chibios_pins.py
|
||||
# Omnibus F4 Nano V6 only
|
||||
# with F405 mcu, mpu6000 imu, bmp280 barometer, 7456 series osd, flash log storage
|
||||
# Bi-directional dshot version of OmnibusNanoV6
|
||||
|
||||
MCU STM32F4xx STM32F405xx
|
||||
include ../OmnibusNanoV6/hwdef.dat
|
||||
|
||||
# board ID for firmware load
|
||||
APJ_BOARD_ID 133
|
||||
undef PB0 PB1 PA3 PB5
|
||||
undef STM32_PWM_USE_ADVANCED
|
||||
|
||||
# crystal frequency
|
||||
OSCILLATOR_HZ 8000000
|
||||
|
||||
STM32_ST_USE_TIMER 5
|
||||
|
||||
# flash size
|
||||
FLASH_SIZE_KB 1024
|
||||
FLASH_RESERVE_START_KB 64
|
||||
|
||||
# order of I2C buses
|
||||
I2C_ORDER I2C2 I2C1
|
||||
|
||||
# order of UARTs
|
||||
SERIAL_ORDER OTG1 USART1 UART4 USART6 USART3
|
||||
|
||||
#adc
|
||||
PC1 BAT_CURR_SENS ADC1 SCALE(1)
|
||||
PC2 BAT_VOLT_SENS ADC1 SCALE(1)
|
||||
PA0 RSSI_IN ADC1
|
||||
|
||||
#pwm output
|
||||
PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50)
|
||||
PB1 TIM3_CH4 TIM3 PWM(2) GPIO(51) BIDIR
|
||||
PA3 TIM2_CH4 TIM2 PWM(3) GPIO(52) BIDIR
|
||||
PB5 TIM3_CH2 TIM3 PWM(4) GPIO(53) BIDIR
|
||||
|
||||
DMA_NOSHARE SPI2*
|
||||
|
||||
PA4 MPU6000_CS CS
|
||||
PA5 SPI1_SCK SPI1
|
||||
PA6 SPI1_MISO SPI1
|
||||
PA7 SPI1_MOSI SPI1
|
||||
|
||||
# note that this board needs PULLUP on I2C pins
|
||||
PB10 I2C2_SCL I2C2 PULLUP
|
||||
PB11 I2C2_SDA I2C2 PULLUP
|
||||
|
||||
# I2C1 on PPM / PB9 pads of V6.x board revision
|
||||
PB8 I2C1_SCL I2C1 PULLUP
|
||||
PB9 I2C1_SDA I2C1 PULLUP
|
||||
|
||||
# use RX3 / TX3 pins as USART3 = SERIAL4 in BRD_ALT_CONFIG = 1
|
||||
PB10 USART3_TX USART3 ALT(1)
|
||||
PB11 USART3_RX USART3 ALT(1)
|
||||
|
||||
# SPI2 for flash
|
||||
PB15 SPI2_MOSI SPI2
|
||||
PB14 SPI2_MISO SPI2
|
||||
PB13 SPI2_SCK SPI2
|
||||
PB12 FLASH_CS CS
|
||||
|
||||
# USART1 = SERIAL1 on original V6 revision only
|
||||
# not available on V6.x revisions due to altered inverter layout
|
||||
PA10 USART1_RX USART1
|
||||
PA9 USART1_TX USART1
|
||||
|
||||
# USART6 = SERIAL3
|
||||
PC6 USART6_TX USART6
|
||||
PC7 USART6_RX USART6
|
||||
|
||||
# UART4 (ESC sensor)
|
||||
PA1 UART4_RX UART4
|
||||
|
||||
PA13 JTMS-SWDIO SWD
|
||||
PA14 JTCK-SWCLK SWD
|
||||
|
||||
PA15 OSD_CS CS
|
||||
PB3 BMP280_CS CS
|
||||
PC12 SPI3_MOSI SPI3
|
||||
PC11 SPI3_MISO SPI3
|
||||
PC10 SPI3_SCK SPI3
|
||||
|
||||
PA8 LED OUTPUT HIGH GPIO(41)
|
||||
|
||||
# passive buzzer disabled, timer 3 used for PWM(4) output
|
||||
#PB4 TIM3_CH1 TIM3 GPIO(70) ALARM
|
||||
|
||||
# use active buzzer instead
|
||||
PB4 BUZZER OUTPUT GPIO(80) LOW
|
||||
define HAL_BUZZER_PIN 80
|
||||
define HAL_BUZZER_ON 1
|
||||
define HAL_BUZZER_OFF 0
|
||||
|
||||
PA11 OTG_FS_DM OTG1
|
||||
PA12 OTG_FS_DP OTG1
|
||||
PC5 VBUS INPUT OPENDRAIN
|
||||
|
||||
#LED strip output pad used for RC input
|
||||
PB6 TIM4_CH1 TIM4 RCININT PULLDOWN LOW
|
||||
|
||||
#Omnibus F4 V3 and later had hw inverter on UART6
|
||||
#Overide it to use as GPS UART port
|
||||
PC8 SBUS_INVERT_RX OUTPUT LOW
|
||||
PC9 SBUS_INVERT_TX OUTPUT LOW
|
||||
|
||||
# SPI Device table
|
||||
SPIDEV mpu6000 SPI1 DEVID1 MPU6000_CS MODE3 1*MHZ 8*MHZ
|
||||
SPIDEV bmp280 SPI3 DEVID3 BMP280_CS MODE3 1*MHZ 8*MHZ
|
||||
SPIDEV osd SPI3 DEVID4 OSD_CS MODE0 10*MHZ 10*MHZ
|
||||
SPIDEV dataflash SPI2 DEVID1 FLASH_CS MODE3 32*MHZ 32*MHZ
|
||||
|
||||
# enable logging to dataflash
|
||||
define HAL_LOGGING_DATAFLASH
|
||||
|
||||
# one IMU
|
||||
IMU Invensense SPI:mpu6000 ROTATION_YAW_90
|
||||
|
||||
# one baro
|
||||
BARO BMP280 SPI:bmp280
|
||||
|
||||
# no built-in compass, but probe the i2c bus for all possible
|
||||
# external compass types
|
||||
define ALLOW_ARM_NO_COMPASS
|
||||
define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
|
||||
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
|
||||
define HAL_I2C_INTERNAL_MASK 0
|
||||
|
||||
define STORAGE_FLASH_PAGE 1
|
||||
define HAL_STORAGE_SIZE 15360
|
||||
|
||||
|
||||
# define default battery setup
|
||||
define HAL_BATT_VOLT_PIN 12
|
||||
define HAL_BATT_CURR_PIN 11
|
||||
define HAL_BATT_VOLT_SCALE 11
|
||||
define HAL_BATT_CURR_SCALE 18.2
|
||||
|
||||
#analog rssi pin (also could be used as analog airspeed input)
|
||||
#PA0 - ADC123_CH0
|
||||
define BOARD_RSSI_ANA_PIN 0
|
||||
|
||||
|
||||
define HAL_GPIO_A_LED_PIN 41
|
||||
|
||||
define OSD_ENABLED 1
|
||||
define HAL_OSD_TYPE_DEFAULT 1
|
||||
|
||||
define BOARD_PWM_COUNT_DEFAULT 4
|
||||
|
||||
#font for the osd
|
||||
ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin
|
||||
|
||||
define HAL_MOUNT_ENABLED 0
|
||||
|
@ -0,0 +1 @@
|
||||
include ../Pixracer/hwdef-bl.dat
|
@ -1,234 +1,15 @@
|
||||
# hw definition file for processing by chibios_hwdef.py for the
|
||||
# mRo Pixracer board. This is a fmuv4 board
|
||||
# Bi-directional dshot version of Pixracer
|
||||
# DMA on USART1 is lost
|
||||
|
||||
define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_FMUV4
|
||||
include ../Pixracer/hwdef.dat
|
||||
|
||||
# MCU class and specific type
|
||||
MCU STM32F4xx STM32F427xx
|
||||
undef PB6 PB7 PE14 PE9
|
||||
|
||||
# board ID for firmware load
|
||||
APJ_BOARD_ID 11
|
||||
|
||||
# crystal frequency
|
||||
OSCILLATOR_HZ 24000000
|
||||
|
||||
|
||||
# ChibiOS system timer
|
||||
STM32_ST_USE_TIMER 5
|
||||
|
||||
# flash size
|
||||
FLASH_SIZE_KB 2048
|
||||
|
||||
env OPTIMIZE -O2
|
||||
|
||||
# serial port for stdout disabled, use USB console
|
||||
# STDOUT_SERIAL SD7
|
||||
# STDOUT_BAUDRATE 57600
|
||||
|
||||
# only one I2C bus
|
||||
I2C_ORDER I2C1
|
||||
|
||||
# to match px4 we make the first bus number 1
|
||||
define HAL_I2C_BUS_BASE 1
|
||||
define HAL_I2C_INTERNAL_MASK 0
|
||||
|
||||
# order of UARTs (and USB)
|
||||
SERIAL_ORDER OTG1 USART2 USART3 UART4 UART8 USART1 UART7
|
||||
|
||||
# UART4 is GPS
|
||||
PA0 UART4_TX UART4
|
||||
PA1 UART4_RX UART4
|
||||
PA2 BATT_VOLTAGE_SENS ADC1
|
||||
PA3 BATT_CURRENT_SENS ADC1
|
||||
PA4 VDD_5V_SENS ADC1 SCALE(2)
|
||||
|
||||
# SPI1 is sensors bus
|
||||
PA5 SPI1_SCK SPI1
|
||||
PA6 SPI1_MISO SPI1
|
||||
PA7 SPI1_MOSI SPI1
|
||||
|
||||
PA9 VBUS INPUT
|
||||
|
||||
PA11 OTG_FS_DM OTG1
|
||||
PA12 OTG_FS_DP OTG1
|
||||
|
||||
PA13 JTMS-SWDIO SWD
|
||||
PA14 JTCK-SWCLK SWD
|
||||
|
||||
# PWM output for buzzer
|
||||
PA15 TIM2_CH1 TIM2 GPIO(77) ALARM
|
||||
|
||||
# control of spektrum power pin
|
||||
PE4 SPEKTRUM_PWR OUTPUT LOW GPIO(70)
|
||||
define HAL_GPIO_SPEKTRUM_PWR 70
|
||||
|
||||
# spektrum power is active low
|
||||
define HAL_SPEKTRUM_PWR_ENABLED 0
|
||||
|
||||
# spektrum RC input pin, used as GPIO for bind for satellite receivers
|
||||
PB0 SPEKTRUM_RC INPUT PULLUP GPIO(71)
|
||||
define HAL_GPIO_SPEKTRUM_RC 71
|
||||
|
||||
PB2 BOOT1 INPUT
|
||||
PB5 VDD_BRICK_VALID INPUT PULLDOWN
|
||||
|
||||
# USART1 is ESP8266
|
||||
PB6 USART1_TX USART1 NODMA
|
||||
PB7 USART1_RX USART1 NODMA
|
||||
PA8 USART1_RTS USART1
|
||||
# PE10 is not a hw CTS pin for USART1
|
||||
PE10 8266_CTS INPUT
|
||||
|
||||
# make GPIOs for ESP8266 available via mavlink relay control as pins
|
||||
# 60 to 63
|
||||
PB4 8266_GPIO2 OUTPUT GPIO(60)
|
||||
PE2 8266_GPI0 INPUT PULLUP GPIO(61)
|
||||
PE5 8266_PD OUTPUT HIGH GPIO(62)
|
||||
PE6 8266_RST OUTPUT HIGH GPIO(63)
|
||||
|
||||
PB8 I2C1_SCL I2C1
|
||||
PB9 I2C1_SDA I2C1
|
||||
|
||||
# SPI2 is FRAM
|
||||
PB10 SPI2_SCK SPI2
|
||||
PB12 CAN2_RX CAN2
|
||||
PB13 CAN2_TX CAN2 # this is SPI2_SCK on beta board
|
||||
PB14 SPI2_MISO SPI2
|
||||
PB15 SPI2_MOSI SPI2
|
||||
|
||||
PC0 VBUS_VALID INPUT PULLDOWN
|
||||
PC1 RSSI_IN ADC1
|
||||
PC2 MPU9250_CS CS
|
||||
PC3 LED_SAFETY OUTPUT
|
||||
PC4 SAFETY_IN INPUT PULLDOWN
|
||||
PC5 VDD_PERIPH_EN OUTPUT HIGH
|
||||
|
||||
PC7 TIM8_CH2 TIM8 RCININT FLOAT LOW # also USART6_RX for serial RC
|
||||
PC13 SBUS_INV OUTPUT LOW
|
||||
|
||||
PC8 SDIO_D0 SDIO
|
||||
PC9 SDIO_D1 SDIO
|
||||
PC10 SDIO_D2 SDIO
|
||||
PC11 SDIO_D3 SDIO
|
||||
PC12 SDIO_CK SDIO
|
||||
|
||||
|
||||
PC14 20608_DRDY INPUT
|
||||
PC15 20608_CS CS
|
||||
|
||||
PD0 CAN1_RX CAN1
|
||||
PD1 CAN1_TX CAN1
|
||||
PD2 SDIO_CMD SDIO
|
||||
|
||||
# USART2 serial2 telem1
|
||||
PD3 USART2_CTS USART2
|
||||
PD4 USART2_RTS USART2
|
||||
PD5 USART2_TX USART2
|
||||
PD6 USART2_RX USART2
|
||||
|
||||
PD7 BARO_CS CS
|
||||
|
||||
# USART3 serial3 telem2
|
||||
PD8 USART3_TX USART3
|
||||
PD9 USART3_RX USART3
|
||||
PD10 FRAM_CS CS
|
||||
PD11 USART3_CTS USART3
|
||||
PD12 USART3_RTS USART3
|
||||
|
||||
PD15 MPU9250_DRDY INPUT
|
||||
|
||||
# UART8 serial4 FrSky
|
||||
PE0 UART8_RX UART8
|
||||
PE1 UART8_TX UART8
|
||||
|
||||
# allow this uart to be inverted for transmit under user control
|
||||
# the polarity is the value to use on the GPIO to change the polarity
|
||||
# to the opposite of the default
|
||||
PA10 UART8_TXINV OUTPUT HIGH GPIO(78) POL(0)
|
||||
|
||||
PE3 VDD_SENSORS_EN OUTPUT HIGH
|
||||
|
||||
# UART7 is debug
|
||||
PE7 UART7_RX UART7 NODMA
|
||||
PE8 UART7_TX UART7 NODMA
|
||||
|
||||
PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50) BIDIR
|
||||
PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51)
|
||||
PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52)
|
||||
PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53) BIDIR
|
||||
PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54)
|
||||
PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55)
|
||||
|
||||
DMA_PRIORITY SDIO TIM1_UP TIM1_CH4 TIM1_CH1
|
||||
DMA_NOSHARE SPI1*
|
||||
|
||||
PE12 MAG_DRDY INPUT
|
||||
PE15 MAG_CS CS
|
||||
|
||||
# SPI device table. The DEVID values are chosen to match the PX4 port
|
||||
# of ArduPilot so users don't need to re-do their accel and compass calibrations
|
||||
# when moving to ChibiOS
|
||||
SPIDEV ms5611_int SPI2 DEVID3 BARO_CS MODE3 20*MHZ 20*MHZ
|
||||
SPIDEV mpu9250 SPI1 DEVID4 MPU9250_CS MODE3 2*MHZ 4*MHZ
|
||||
SPIDEV icm20608 SPI1 DEVID6 20608_CS MODE3 2*MHZ 8*MHZ
|
||||
SPIDEV hmc5843 SPI1 DEVID5 MAG_CS MODE3 11*MHZ 11*MHZ
|
||||
SPIDEV lis3mdl SPI1 DEVID5 MAG_CS MODE3 500*KHZ 500*KHZ
|
||||
SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ
|
||||
|
||||
define HAL_CHIBIOS_ARCH_FMUV4 1
|
||||
|
||||
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
|
||||
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
|
||||
|
||||
define HAL_STORAGE_SIZE 16384
|
||||
|
||||
# enable RAMTROM parameter storage
|
||||
define HAL_WITH_RAMTRON 1
|
||||
|
||||
# enable FAT filesystem
|
||||
define HAL_OS_FATFS_IO 1
|
||||
|
||||
# pixracer has 3 LEDs, Red, Green, Blue
|
||||
define HAL_HAVE_PIXRACER_LED
|
||||
|
||||
define HAL_GPIO_LED_ON 0
|
||||
define HAL_GPIO_LED_OFF 1
|
||||
|
||||
# LED setup for PixracerLED driver
|
||||
PB11 LED_RED OUTPUT GPIO(0)
|
||||
PB1 LED_GREEN OUTPUT GPIO(1)
|
||||
PB3 LED_BLUE OUTPUT GPIO(2)
|
||||
|
||||
define HAL_GPIO_A_LED_PIN 0
|
||||
define HAL_GPIO_B_LED_PIN 1
|
||||
define HAL_GPIO_C_LED_PIN 2
|
||||
|
||||
# battery setup
|
||||
define HAL_BATT_VOLT_PIN 2
|
||||
define HAL_BATT_CURR_PIN 3
|
||||
define HAL_BATT_VOLT_SCALE 10.1
|
||||
define HAL_BATT_CURR_SCALE 17.0
|
||||
|
||||
# setup serial port defaults for ESP8266
|
||||
define HAL_SERIAL5_PROTOCOL SerialProtocol_MAVLink2
|
||||
define HAL_SERIAL5_BAUD 921600
|
||||
|
||||
# 6 PWM available by default
|
||||
define BOARD_PWM_COUNT_DEFAULT 6
|
||||
|
||||
|
||||
# two IMUs
|
||||
IMU Invensense SPI:icm20608 ROTATION_ROLL_180_YAW_90
|
||||
IMU Invensense SPI:mpu9250 ROTATION_ROLL_180_YAW_90
|
||||
define HAL_DEFAULT_INS_FAST_SAMPLE 1
|
||||
|
||||
# 2 compasses. R15 has LIS3MDL instead of HMC5843
|
||||
COMPASS HMC5843 SPI:hmc5843 false ROTATION_PITCH_180
|
||||
COMPASS LIS3MDL SPI:lis3mdl false ROTATION_NONE
|
||||
COMPASS AK8963:probe_mpu9250 0 ROTATION_ROLL_180_YAW_90
|
||||
|
||||
# also probe all types of external I2C compasses
|
||||
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
|
||||
|
||||
# one barometer
|
||||
BARO MS56XX SPI:ms5611_int
|
||||
|
@ -0,0 +1 @@
|
||||
include ../mRoPixracerPro/hwdef-bl.dat
|
@ -1,285 +1,11 @@
|
||||
###########################################################################################################################################################
|
||||
# mRo Pixracer Pro Flight Controller
|
||||
# STM32H743IIK6
|
||||
# 8 PWM / IO - DMA capable and hardware and/or software switchable 3.3v / 5v Logic (hardware default)
|
||||
# Logic level set in hardware: No Solder for 5v, Solder 1-2 for 3.3v, Solder 2-3 for 3.3v / 5v software switchable
|
||||
# Exposed JST GH Connectors: GPS UART+I2C connector, 6 Available UARTS (2 with Flow Control), 2 FDCAN, SPI, I2C, Power with analog current and voltage sense
|
||||
# 3 IMUs (ICM20602 6DOF, ICM20948 9DOF, BMI088 6DOF)
|
||||
# Baro, FRAM (256kb), SDCARD Socket, TC2030 JTAG, USB-C
|
||||
# Onboard 3 color LED and buzzer
|
||||
# Uncased weight and dimensions:
|
||||
# Weight (with headers): 11.3g (.40oz)
|
||||
# Length: 36mm (1.42in)
|
||||
# Width: 36mm (1.42in)
|
||||
# Mounting holes: 31.5mm x 31.5mm 4mm grommeted mounting holes for 3mm fasteners
|
||||
# M10064C - Initial Release
|
||||
###########################################################################################################################################################
|
||||
# Bi-directional dshot version of mRoPixracerPro
|
||||
|
||||
# default to all pins low to avoid ESD issues
|
||||
DEFAULTGPIO OUTPUT LOW PULLDOWN
|
||||
include ../mRoPixracerPro/hwdef.dat
|
||||
|
||||
# MCU class and specific type
|
||||
MCU STM32H7xx STM32H743xx
|
||||
undef PE14 PE9
|
||||
|
||||
# board ID for firmware load
|
||||
APJ_BOARD_ID 1017
|
||||
|
||||
# crystal frequency
|
||||
OSCILLATOR_HZ 24000000
|
||||
|
||||
FLASH_SIZE_KB 2048
|
||||
|
||||
# with 2M flash we can afford to optimize for speed
|
||||
env OPTIMIZE -O2
|
||||
|
||||
# start on 2th sector (1st sector for bootloader)
|
||||
FLASH_RESERVE_START_KB 128
|
||||
|
||||
# use FRAM for storage
|
||||
define HAL_STORAGE_SIZE 16384
|
||||
define HAL_WITH_RAMTRON 1
|
||||
|
||||
# USB setup
|
||||
USB_STRING_MANUFACTURER "mRo"
|
||||
|
||||
# RC Input set for Interrupt also USART6_RX for serial RC
|
||||
PC7 TIM3_CH2 TIM3 RCININT FLOAT LOW
|
||||
|
||||
# Control of Spektrum power pin
|
||||
PE4 SPEKTRUM_PWR OUTPUT LOW GPIO(70)
|
||||
define HAL_GPIO_SPEKTRUM_PWR 70
|
||||
|
||||
# Spektrum Power is Active Low
|
||||
define HAL_SPEKTRUM_PWR_ENABLED 0
|
||||
|
||||
# Spektrum RC Input pin, used as GPIO for bind for Satellite Receivers
|
||||
PB0 SPEKTRUM_RC INPUT PULLUP GPIO(71)
|
||||
define HAL_GPIO_SPEKTRUM_RC 71
|
||||
|
||||
# Order of I2C buses
|
||||
I2C_ORDER I2C1
|
||||
|
||||
# this board only has a single I2C bus so make it external
|
||||
define HAL_I2C_INTERNAL_MASK 0
|
||||
|
||||
# order of UARTs (and USB) and suggested usage
|
||||
# USART2 Telem 1 (Flow Control)
|
||||
# USART3 Telem 2 (Flow Control)
|
||||
# UART4 GPS
|
||||
# UART8 FRSKY Telem
|
||||
# USART1 Additional UART
|
||||
# UART7 Additional UART
|
||||
|
||||
# USART6 RC input (Only RX pin is connected)
|
||||
|
||||
SERIAL_ORDER OTG1 USART2 USART3 UART4 UART8 USART1 UART7 OTG2
|
||||
|
||||
# default the 2nd interface to MAVLink2
|
||||
define HAL_OTG2_PROTOCOL SerialProtocol_MAVLink2
|
||||
|
||||
# Another USART, this one for telem1. This one has RTS and CTS lines.
|
||||
# USART2 telem1
|
||||
PD3 USART2_CTS USART2
|
||||
PD4 USART2_RTS USART2
|
||||
PD5 USART2_TX USART2
|
||||
PD6 USART2_RX USART2
|
||||
|
||||
# The telem2 USART, this one for telem2. This one has RTS and CTS lines.
|
||||
# USART3 telem2
|
||||
PD8 USART3_TX USART3
|
||||
PD9 USART3_RX USART3
|
||||
PD11 USART3_CTS USART3
|
||||
PD12 USART3_RTS USART3
|
||||
|
||||
# UART4 GPS
|
||||
PA0 UART4_TX UART4
|
||||
PA1 UART4_RX UART4
|
||||
|
||||
# USART1 Spare
|
||||
PB6 USART1_TX USART1
|
||||
PB7 USART1_RX USART1
|
||||
|
||||
# UART7 Spare or Debug Console
|
||||
PE7 UART7_RX UART7
|
||||
PE8 UART7_TX UART7
|
||||
|
||||
# UART8 FrSky Telemetry
|
||||
PE0 UART8_RX UART8
|
||||
PE1 UART8_TX UART8
|
||||
|
||||
# RSSI Analog Input
|
||||
PC1 RSSI_IN ADC1
|
||||
|
||||
# Analog current and voltage sense pins.
|
||||
PA2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
|
||||
PA3 BATT_CURRENT_SENS ADC1 SCALE(1)
|
||||
|
||||
# Now the VDD sense pin. This is used to sense primary board voltage.
|
||||
PA4 VDD_5V_SENS ADC1 SCALE(2)
|
||||
|
||||
#SPI1 ICM_20602 / ICM_20948
|
||||
PA5 SPI1_SCK SPI1
|
||||
PA6 SPI1_MISO SPI1
|
||||
PA7 SPI1_MOSI SPI1
|
||||
|
||||
#SPI2 FRAM / DPS310
|
||||
PB10 SPI2_SCK SPI2
|
||||
PB14 SPI2_MISO SPI2
|
||||
PB15 SPI2_MOSI SPI2
|
||||
|
||||
#SPI5 BMI088
|
||||
PF7 SPI5_SCK SPI5
|
||||
PF8 SPI5_MISO SPI5
|
||||
PF9 SPI5_MOSI SPI5
|
||||
|
||||
#SPI6 EXTERNAL
|
||||
PG13 SPI6_SCK SPI6
|
||||
PG12 SPI6_MISO SPI6
|
||||
PG14 SPI6_MOSI SPI6
|
||||
|
||||
# This is the pin that senses USB being connected. It is an input pin
|
||||
# setup as OPENDRAIN.
|
||||
PA9 VBUS INPUT OPENDRAIN
|
||||
|
||||
# This input pin is used to detect that power is valid on USB.
|
||||
PC0 VBUS_VALID INPUT
|
||||
|
||||
# Now we define the pins that USB is connected on.
|
||||
PA11 OTG_FS_DM OTG1
|
||||
PA12 OTG_FS_DP OTG1
|
||||
|
||||
# These are the pins for SWD debugging with a STlinkv2 or black-magic probe.
|
||||
PA13 JTMS-SWDIO SWD
|
||||
PA14 JTCK-SWCLK SWD
|
||||
|
||||
# PWM output for buzzer
|
||||
PA15 TIM2_CH1 TIM2 GPIO(77) ALARM
|
||||
|
||||
# Now the first I2C bus. The pin speeds are automatically setup
|
||||
# correctly, but can be overridden here if needed.
|
||||
PB8 I2C1_SCL I2C1
|
||||
PB9 I2C1_SDA I2C1
|
||||
|
||||
# Now setup the pins for the microSD card, if available.
|
||||
PC8 SDMMC1_D0 SDMMC1
|
||||
PC9 SDMMC1_D1 SDMMC1
|
||||
PC10 SDMMC1_D2 SDMMC1
|
||||
PC11 SDMMC1_D3 SDMMC1
|
||||
PC12 SDMMC1_CK SDMMC1
|
||||
PD2 SDMMC1_CMD SDMMC1
|
||||
|
||||
# More CS pins for more sensors. The labels for all CS pins need to
|
||||
# match the SPI device table later in this file.
|
||||
PC2 ICM_20602_CS CS
|
||||
PD7 BARO_CS CS
|
||||
PD10 FRAM_CS CS SPEED_VERYLOW
|
||||
PE15 ICM_20948_CS CS
|
||||
PF10 BMI088_GYRO_CS CS
|
||||
PF6 BMI088_ACCEL_CS CS
|
||||
PG9 EXT_SPI_CS CS
|
||||
|
||||
# the first CAN bus
|
||||
PD0 CAN1_RX CAN1
|
||||
PD1 CAN1_TX CAN1
|
||||
|
||||
PF11 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(72)
|
||||
|
||||
# This defines the pins for the 2nd CAN interface, OEM Only.
|
||||
PB13 CAN2_TX CAN2
|
||||
PB12 CAN2_RX CAN2
|
||||
|
||||
PF14 GPIO_CAN2_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(73)
|
||||
|
||||
# Now we start defining some PWM pins. We also map these pins to GPIO
|
||||
# values, so users can set BRD_PWM_COUNT to choose how many of the PWM
|
||||
# outputs on the primary MCU are setup as PWM and how many as
|
||||
# GPIOs. To match HAL_PX4 we number the GPIOs for the PWM outputs
|
||||
# starting at 50.
|
||||
PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50) BIDIR
|
||||
PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51)
|
||||
PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52)
|
||||
PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53) BIDIR
|
||||
PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54)
|
||||
PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55)
|
||||
PI5 TIM8_CH1 TIM8 PWM(7) GPIO(56)
|
||||
PI6 TIM8_CH2 TIM8 PWM(8) GPIO(57)
|
||||
|
||||
DMA_PRIORITY TIM1_UP TIM1_CH4 TIM1_CH1
|
||||
DMA_NOSHARE SPI1* SPI5* TIM1_UP
|
||||
|
||||
define BOARD_PWM_COUNT_DEFAULT 8
|
||||
|
||||
# This is the invensense data-ready pin. We don't use it in the
|
||||
# default driver.
|
||||
PD15 MPU_DRDY INPUT
|
||||
|
||||
# This is the pin to enable the sensors rail. It can be used to power
|
||||
# cycle sensors to recover them in case there are problems with power on
|
||||
# timing affecting sensor stability. We pull it high by default.
|
||||
PE3 VDD_3V3_SENSORS_EN OUTPUT HIGH
|
||||
|
||||
# 1.8V Sensor Level Shifter Output Enable. We pull it high by default.
|
||||
PI3 VDD_1V8_SENSORS_EN OUTPUT HIGH
|
||||
|
||||
# Pin for PWM Voltage Selection, 0 means 3.3v, 1 means 5v
|
||||
PG6 PWM_VOLT_SEL OUTPUT LOW GPIO(74)
|
||||
define HAL_GPIO_PWM_VOLT_PIN 74
|
||||
define HAL_GPIO_PWM_VOLT_3v3 0
|
||||
|
||||
# Power flag pins: these tell the MCU the status of the various power
|
||||
# supplies that are available. The pin names need to exactly match the
|
||||
# names used in AnalogIn.cpp.
|
||||
PB5 VDD_BRICK_VALID INPUT PULLUP
|
||||
|
||||
SPIDEV icm20948 SPI1 DEVID1 ICM_20948_CS MODE3 2*MHZ 4*MHZ
|
||||
SPIDEV icm20608 SPI1 DEVID2 ICM_20602_CS MODE3 2*MHZ 8*MHZ
|
||||
SPIDEV dps310 SPI2 DEVID3 BARO_CS MODE3 5*MHZ 5*MHZ
|
||||
SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ
|
||||
SPIDEV bmi088_g SPI5 DEVID1 BMI088_GYRO_CS MODE3 10*MHZ 10*MHZ
|
||||
SPIDEV bmi088_a SPI5 DEVID2 BMI088_ACCEL_CS MODE3 10*MHZ 10*MHZ
|
||||
|
||||
# Now some defines for logging and terrain data files.
|
||||
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
|
||||
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
|
||||
|
||||
# Enable FAT filesystem support (needs a microSD defined via SDMMC).
|
||||
define HAL_OS_FATFS_IO 1
|
||||
|
||||
# Now setup the default battery pins driver analog pins and default
|
||||
# scaling for the power brick.
|
||||
define HAL_BATT_VOLT_PIN 14
|
||||
define HAL_BATT_CURR_PIN 15
|
||||
define HAL_BATT_VOLT_SCALE 10.1
|
||||
define HAL_BATT_CURR_SCALE 17.0
|
||||
|
||||
# No hardware safety pin, CAN safety switch only
|
||||
# define HAL_HAVE_SAFETY_SWITCH 0
|
||||
|
||||
# Pixracer Pro has a TriColor LED, Red, Green, Blue
|
||||
define HAL_HAVE_PIXRACER_LED
|
||||
|
||||
define HAL_GPIO_LED_ON 0
|
||||
define HAL_GPIO_LED_OFF 1
|
||||
|
||||
# LED setup for PixracerLED driver
|
||||
PB11 LED_R OUTPUT HIGH GPIO(0)
|
||||
PB1 LED_G OUTPUT HIGH GPIO(1)
|
||||
PB3 LED_B OUTPUT HIGH GPIO(2)
|
||||
|
||||
define HAL_GPIO_A_LED_PIN 0
|
||||
define HAL_GPIO_B_LED_PIN 1
|
||||
define HAL_GPIO_C_LED_PIN 2
|
||||
|
||||
# 3 IMUs
|
||||
IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_NONE
|
||||
IMU Invensense SPI:icm20608 ROTATION_ROLL_180_YAW_90
|
||||
IMU Invensensev2 SPI:icm20948 ROTATION_ROLL_180_YAW_90
|
||||
|
||||
define HAL_DEFAULT_INS_FAST_SAMPLE 7
|
||||
|
||||
# 1 baro
|
||||
BARO DPS280 SPI:dps310
|
||||
|
||||
# 1 compass
|
||||
COMPASS AK09916:probe_ICM20948 0 ROTATION_ROLL_180
|
||||
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
|
||||
|
@ -0,0 +1 @@
|
||||
include ../omnibusf4pro/hwdef-bl.dat
|
@ -1,163 +1,10 @@
|
||||
# hw definition file for processing by chibios_pins.py
|
||||
# Omnibus F4 PRO with on-board current sensor
|
||||
# with F405 mcu, mpu6000 imu, bmp280 barometer, 7456 series osd and sdcard
|
||||
# Bi-directional dshot version of omnibusf4pro
|
||||
# Buzzer timer is required so becomes single tone
|
||||
|
||||
MCU STM32F4xx STM32F405xx
|
||||
include ../omnibusf4pro/hwdef.dat
|
||||
|
||||
HAL_CHIBIOS_ARCH_F405 1
|
||||
undef PB0 PB1 PA3 PB4
|
||||
|
||||
# board ID for firmware load
|
||||
APJ_BOARD_ID 131
|
||||
|
||||
# crystal frequency
|
||||
OSCILLATOR_HZ 8000000
|
||||
|
||||
STM32_ST_USE_TIMER 5
|
||||
|
||||
# flash size
|
||||
FLASH_SIZE_KB 1024
|
||||
FLASH_RESERVE_START_KB 64
|
||||
|
||||
# order of I2C buses
|
||||
I2C_ORDER I2C2
|
||||
|
||||
# order of UARTs
|
||||
SERIAL_ORDER OTG1 USART1 USART3 USART6 UART4
|
||||
|
||||
#adc
|
||||
PC1 BAT_CURR_SENS ADC1 SCALE(1)
|
||||
PC2 BAT_VOLT_SENS ADC1 SCALE(1)
|
||||
|
||||
#analog rssi pin (also could be used as analog airspeed input)
|
||||
PA0 RSSI_IN ADC1
|
||||
define BOARD_RSSI_ANA_PIN 0
|
||||
|
||||
#pwm output. 1 - 4 on main header, 5 & 6 on separated header w/o 5V supply, 7 & 8 on CH5 and CH6 pads
|
||||
PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50)
|
||||
PB1 TIM3_CH4 TIM3 PWM(2) GPIO(51) BIDIR
|
||||
PA3 TIM2_CH4 TIM2 PWM(3) GPIO(52) BIDIR
|
||||
PA2 TIM2_CH3 TIM2 PWM(4) GPIO(53)
|
||||
PA1 TIM2_CH2 TIM2 PWM(5) GPIO(54)
|
||||
PA8 TIM1_CH1 TIM1 PWM(6) GPIO(55)
|
||||
PC8 TIM8_CH3 TIM8 PWM(7) GPIO(56)
|
||||
PC9 TIM8_CH4 TIM8 PWM(8) GPIO(59)
|
||||
|
||||
PA4 MPU6000_CS CS
|
||||
PA5 SPI1_SCK SPI1
|
||||
PA6 SPI1_MISO SPI1
|
||||
PA7 SPI1_MOSI SPI1
|
||||
|
||||
# note that this board needs PULLUP on I2C pins
|
||||
PB10 I2C2_SCL I2C2 PULLUP
|
||||
PB11 I2C2_SDA I2C2 PULLUP
|
||||
|
||||
# use I2C pins as USART3 (SERIAL2) in BRD_ALT_CONFIG=1 & 4
|
||||
PB10 USART3_TX USART3 ALT(1)
|
||||
PB11 USART3_RX USART3 ALT(1)
|
||||
PB10 USART3_TX USART3 ALT(4)
|
||||
PB11 USART3_RX USART3 ALT(4)
|
||||
|
||||
PB15 SPI2_MOSI SPI2
|
||||
PB14 SPI2_MISO SPI2
|
||||
PB13 SPI2_SCK SPI2
|
||||
PB12 SDCARD_CS CS
|
||||
|
||||
PA10 USART1_RX USART1
|
||||
PA9 USART1_TX USART1
|
||||
|
||||
PC6 USART6_TX USART6
|
||||
PC7 USART6_RX USART6
|
||||
|
||||
# UART4 TX available as an alternative config on PA0 (RSSI pad) with BRD_ALT_CONFIG=2
|
||||
PA0 UART4_TX UART4 ALT(2)
|
||||
|
||||
# full UART4 also available as alt config on PA0 (RSSI pad) and PA1 (PWM output chan 5) with BRD_ALT_CONFIG=3 & 4
|
||||
PA0 UART4_TX UART4 ALT(3)
|
||||
PA1 UART4_RX UART4 ALT(3)
|
||||
PA0 UART4_TX UART4 ALT(4)
|
||||
PA1 UART4_RX UART4 ALT(4)
|
||||
|
||||
PA13 JTMS-SWDIO SWD
|
||||
PA14 JTCK-SWCLK SWD
|
||||
|
||||
PA15 OSD_CS CS
|
||||
PB3 BMP280_CS CS
|
||||
PC12 SPI3_MOSI SPI3
|
||||
PC11 SPI3_MISO SPI3
|
||||
PC10 SPI3_SCK SPI3
|
||||
|
||||
PB5 LED_BLUE OUTPUT LOW GPIO(1)
|
||||
define HAL_GPIO_A_LED_PIN 1
|
||||
|
||||
#dummy assignment required to allow AP_NOTIFY to use board led
|
||||
define HAL_GPIO_B_LED_PIN 2
|
||||
|
||||
# TIM3 is needed for bi-directional dshot
|
||||
#PB4 TIM3_CH1 TIM3 GPIO(58) ALARM LOW
|
||||
|
||||
#use LED-STRIP output as general purpose GPIO
|
||||
PB6 GP_GPIO OUTPUT LOW GPIO(70)
|
||||
|
||||
PA11 OTG_FS_DM OTG1
|
||||
PA12 OTG_FS_DP OTG1
|
||||
PC5 VBUS INPUT OPENDRAIN
|
||||
|
||||
# "PPM" solder pad/resistor should be soldered and "S-BUS" resistor/solder pad removed
|
||||
# Overwise UART1 or UART6 or RCIN will not work
|
||||
PB8 TIM4_CH3 TIM4 RCININT PULLDOWN LOW
|
||||
|
||||
|
||||
# SPI Device table
|
||||
SPIDEV mpu6000 SPI1 DEVID1 MPU6000_CS MODE3 1*MHZ 8*MHZ
|
||||
SPIDEV sdcard SPI2 DEVID2 SDCARD_CS MODE0 400*KHZ 25*MHZ
|
||||
SPIDEV bmp280 SPI3 DEVID3 BMP280_CS MODE3 1*MHZ 8*MHZ
|
||||
SPIDEV osd SPI3 DEVID4 OSD_CS MODE0 10*MHZ 10*MHZ
|
||||
|
||||
# one IMU
|
||||
IMU Invensense SPI:mpu6000 ROTATION_YAW_180
|
||||
|
||||
# one baro
|
||||
BARO BMP280 SPI:bmp280
|
||||
|
||||
# no built-in compass, but probe the i2c bus for all possible
|
||||
# external compass types
|
||||
define ALLOW_ARM_NO_COMPASS
|
||||
define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
|
||||
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
|
||||
define HAL_I2C_INTERNAL_MASK 0
|
||||
define HAL_COMPASS_AUTO_ROT_DEFAULT 2
|
||||
|
||||
define STORAGE_FLASH_PAGE 1
|
||||
define HAL_STORAGE_SIZE 15360
|
||||
|
||||
define HAL_OS_FATFS_IO 1
|
||||
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
|
||||
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
|
||||
|
||||
# define default battery setup
|
||||
define HAL_BATT_VOLT_PIN 12
|
||||
define HAL_BATT_CURR_PIN 11
|
||||
define HAL_BATT_VOLT_SCALE 11
|
||||
define HAL_BATT_CURR_SCALE 18.2
|
||||
|
||||
define OSD_ENABLED 1
|
||||
define HAL_OSD_TYPE_DEFAULT 1
|
||||
|
||||
#To complementary channels work we define this
|
||||
define STM32_PWM_USE_ADVANCED TRUE
|
||||
|
||||
define BOARD_PWM_COUNT_DEFAULT 8
|
||||
|
||||
#font for the osd
|
||||
ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin
|
||||
|
||||
# disable SMBUS and fuel battery monitors to save flash
|
||||
define HAL_BATTMON_SMBUS_ENABLE 0
|
||||
define HAL_BATTMON_FUEL_ENABLE 0
|
||||
|
||||
# disable parachute and sprayer to save flash
|
||||
define HAL_PARACHUTE_ENABLED 0
|
||||
define HAL_SPRAYER_ENABLED 0
|
||||
|
||||
# reduce max size of embedded params for apj_tool.py
|
||||
define AP_PARAM_MAX_EMBEDDED_PARAM 1024
|
||||
|
@ -2053,27 +2053,30 @@ def process_line(line):
|
||||
elif a[0] == 'ROMFS_WILDCARD':
|
||||
romfs_wildcard(a[1])
|
||||
elif a[0] == 'undef':
|
||||
print("Removing %s" % a[1])
|
||||
config.pop(a[1], '')
|
||||
bytype.pop(a[1], '')
|
||||
bylabel.pop(a[1], '')
|
||||
# also remove all occurences of defines in previous lines if any
|
||||
for line in alllines[:]:
|
||||
if line.startswith('define') and a[1] == line.split()[1]:
|
||||
alllines.remove(line)
|
||||
newpins = []
|
||||
for pin in allpins:
|
||||
if pin.type == a[1] or pin.label == a[1] or pin.portpin == a[1]:
|
||||
portmap[pin.port][pin.pin] = generic_pin(pin.port, pin.pin, None, 'INPUT', [])
|
||||
continue
|
||||
newpins.append(pin)
|
||||
allpins = newpins
|
||||
if a[1] == 'IMU':
|
||||
imu_list = []
|
||||
if a[1] == 'COMPASS':
|
||||
compass_list = []
|
||||
if a[1] == 'BARO':
|
||||
baro_list = []
|
||||
for u in a[1:]:
|
||||
print("Removing %s" % u)
|
||||
config.pop(u, '')
|
||||
bytype.pop(u, '')
|
||||
bylabel.pop(u, '')
|
||||
# also remove all occurences of defines in previous lines if any
|
||||
for line in alllines[:]:
|
||||
if line.startswith('define') and u == line.split()[1]:
|
||||
alllines.remove(line)
|
||||
newpins = []
|
||||
for pin in allpins:
|
||||
if pin.type == u or pin.label == u or pin.portpin == u:
|
||||
if pin.label is not None:
|
||||
bylabel.pop(pin.label, '')
|
||||
portmap[pin.port][pin.pin] = generic_pin(pin.port, pin.pin, None, 'INPUT', [])
|
||||
continue
|
||||
newpins.append(pin)
|
||||
allpins = newpins
|
||||
if u == 'IMU':
|
||||
imu_list = []
|
||||
if u == 'COMPASS':
|
||||
compass_list = []
|
||||
if u == 'BARO':
|
||||
baro_list = []
|
||||
elif a[0] == 'env':
|
||||
print("Adding environment %s" % ' '.join(a[1:]))
|
||||
if len(a[1:]) < 2:
|
||||
|
Loading…
Reference in New Issue
Block a user