AP_HAL_ChibiOS: hwdef: Add new hardware pixflamingo f7

This commit is contained in:
subashchandar 2023-12-05 17:06:54 +05:30 committed by Peter Hall
parent bd928fb044
commit 7db7f95a3b
6 changed files with 454 additions and 0 deletions

BIN
Tools/bootloaders/PixFlamingo-F767_bl.bin generated Executable file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -0,0 +1,180 @@
# PixFlamingo-F767 Flight Controller
The PixFlamingo-F767 is a flight controller produced by Dheeran Labs.
Contact dheeranlabs@gmail.com for sales
## Features
Processor
STM32F767 32-bit processor
Onboard Flash: 2048Mbits
Sensors
Two IMU : ICM42670, MPU6500/ICM20602 Acc/Gyro
One Baro : Internal MS5611/BMP280/DPS310 SPI barometer
Internal LIS3MDL Compass
Power
5v input voltage with voltage monitoring
Interfaces
10x PWM outputs
1x RC input
5x UARTs/serial for GPS and other peripherals
2x I2C ports for external compass, airspeed, etc.
microSD card slot port
Internal RGB LED
Safety switch port
Buzzer port
USB-C port
## Connectors
**POWER ADC**
| Pin | Signal | Volt |
| :--: | :-------------: | :---: |
| 1 | VCC_IN | +5V |
| 2 | VCC_IN | +5V |
| 3 | BAT_CRRENT_ADC | +3.3V |
| 4 | BAT_VOLTAGE_ADC | +3.3V |
| 5 | GND | GND |
| 6 | GND | GND |
**TELEM1**
| Pin | Signal | Volt |
| :--: | :-----: | :---: |
| 1 | VCC | +5V |
| 2 | UART_TX3 | +3.3V |
| 3 | UART_RX3 | +3.3V |
| 4 | CTS | +3.3V |
| 5 | RTS | +3.3V |
| 6 | GND | GND |
**TELEM2**
| Pin | Signal | Volt |
| :--: | :-----: | :---: |
| 1 | VCC | +5V |
| 2 | UART_TX6 | +3.3V |
| 3 | UART_RX6 | +3.3V |
| 4 | CTS | +3.3V |
| 5 | RTS | +3.3V |
| 6 | GND | GND |
**GPS1**
| Pin | Signal | Volt |
| :--: | :-----: | :---: |
| 1 | VCC | +5V |
| 2 | UART_TX1 | +3.3V |
| 3 | UART_RX1 | +3.3V |
| 4 | I2C2_SCL | +3.3V |
| 5 | I2C2_SDA | +3.3V |
| 6 | GND | GND |
**GPS2**
| Pin | Signal | Volt |
| :--: | :-----: | :---: |
| 1 | VCC | +5V |
| 2 | UART_TX7 | +3.3V |
| 3 | UART_RX7 | +3.3V |
| 4 | X | X |
| 5 | X | X |
| 6 | GND | GND |
**SAFETY**
| Pin | Signal | Volt |
| :--: | :-----------: | :---: |
| 1 | SAFETY_SW | +3.3V |
| 2 | SAFETY_SW_LED | +3.3V |
| 3 | 3V3_OUT | +3.3V |
| 4 | BUZZER+ | +3.3V |
| 5 | BUZZER- | GND |
## UART Mapping
The UARTs are marked Rn and Tn in the above pinouts. The Rn pin is the
receive pin for UARTn. The Tn pin is the transmit pin for UARTn.
- SERIAL0 -> USB (OTG1)
- SERIAL1 -> UART3 (TELEM1) with CTS/RTS DMA Enabled
- SERIAL2 -> UART6 (TELEM2) with DMA Enabled
- SERIAL3 -> UART1 (GPS1) Tx(NODMA), Rx(DMA Enabled)
- SERIAL4 -> EMPTY
- SERIAL5 -> UART7 (GPS2) NODMA
- SERIAL6 -> USART2 (User) NODMA
## RC Input
Supports I-Bus/S-bus
Any UART can be used for RC system connections in ArduPilot also, and is compatible with all protocols except PPM. See Radio Control Systems for details.
## PWM Output
The PixFlaminog-F767 supports up to 10 PWM outputs.
The PWM is in 5 groups:
- PWM 1-4 in group1
- PWM 5-8 in group2
- PWM 9 in group3
- PWM 10 in group4
## GPIOs
All 10 PWM channels can be used for GPIO functions (relays, buttons, RPM etc).
The pin numbers for these PWM channels in ArduPilot are shown below:
| PWM Channels | Pin | PWM Channels | Pin |
| ------------ | ---- | ------------ | ---- |
| PWM1 | 50 | PWM8 | 57 |
| PWM2 | 51 | PWM9 | 58 |
| PWM3 | 52 | PWM10 | 59 |
| PWM4 | 53 | | |
| PWM5 | 54 | | |
| PWM6 | 55 | | |
| PWM7 | 56 | | |
## Analog inputs
The PixFlamingo-F767 flight controller has 4 analog inputs
- ADC Pin10 -> Battery Current
- ADC Pin11 -> Battery Voltage
- ADC Pin14 -> ADC 3V3 Sense
- ADC Pin15 -> ADC 6V6 Sense
## Battery Monitor Configuration
The board has voltage and current sensor inputs on the POWER_ADC connector.
The correct battery setting parameters are:
Enable Battery monitor.
BATT_MONITOR =4
Then reboot.
BATT_VOLT_PIN 11
BATT_CURR_PIN 10
BATT_VOLT_MULT 10.1 (may need adjustment if supplied monitor is not used)
BATT_AMP_PERVLT 17.0 (may need adjustment if supplied monitor is not used)
## Build the FC
./waf configure --board=PixFlamingo-F767
./waf copter
The compiled firmware is located in folder **"build/PixFlamingo-F767/bin/arducopter.apj"**.
## Loading Firmware
The PixFlamingo-F767 flight controller comes pre-installed with an ArduPilot compatible bootloader, allowing the loading of *.apj firmware files with any ArduPilot compatible ground station.

View File

@ -0,0 +1 @@
BRD_HEAT_TARG -1

View File

@ -0,0 +1,63 @@
# hw definition file for processing by chibios_hwdef.py for the
# mRo Pixracer board. This is a fmuv4 board
# MCU class and specific type
MCU STM32F7xx STM32F767xx
# board ID for firmware load
APJ_BOARD_ID 1131
USB_STRING_MANUFACTURER "Dheeran labs"
USB_STRING_PRODUCT "PixFlamingo"
# crystal frequency
OSCILLATOR_HZ 24000000
#define HAL_CHIBIOS_ARCH_FMUV3 1
# ChibiOS system timer
STM32_ST_USE_TIMER 2
# flash size
FLASH_SIZE_KB 2048
# order of UARTs (and USB)
SERIAL_ORDER OTG1 USART2
define HAL_USE_SERIAL TRUE
define STM32_SERIAL_USE_USART2 TRUE
PD5 USART2_TX USART2
PD6 USART2_RX USART2
PA0 USART2_CTS USART2
PA1 USART2_RTS USART2
PB9 EXTERN_GPIO1 OUTPUT GPIO(4)
HAL_BOOTLOADER_TIMEOUT 1000
PE8 LED_BOOTLOADER OUTPUT LOW
PE7 LED_ACTIVITY OUTPUT
define HAL_LED_ON 1
PA9 VBUS INPUT
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
# location of application code
FLASH_BOOTLOADER_LOAD_KB 96
# bootloader loads at start of flash
FLASH_RESERVE_START_KB 0
# Add CS pins to ensure they are high in bootloader
PD0 IMU1_CS CS
PE0 MPU6500_CS CS
PB5 BARO_CS CS
PD7 MAG_CS CS

View File

@ -0,0 +1,210 @@
# MCU class and specific type
MCU STM32F7xx STM32F767xx
# board ID for firmware load
APJ_BOARD_ID 1131
# crystal frequency
OSCILLATOR_HZ 24000000
USB_STRING_MANUFACTURER "Dheeran labs"
USB_STRING_PRODUCT "PixFlamingo"
# ChibiOS system timer
STM32_ST_USE_TIMER 2
#define CH_CFG_ST_RESOLUTION 16
# flash size
FLASH_SIZE_KB 2048
FLASH_RESERVE_START_KB 96
env OPTIMIZE -O2
# serial port for stdout disabled, use USB console
# STDOUT_SERIAL SD7
# STDOUT_BAUDRATE 57600
# only one I2C bus
I2C_ORDER I2C2
# order of UARTs (and USB)
SERIAL_ORDER OTG1 USART3 USART6 USART1 EMPTY UART7 USART2
#define HAL_SERIAL4_PROTOCOL SerialProtocol_RCIN
#define HAL_SERIAL4_BAUD 115
# debug on LUART1
#STDOUT_SERIAL SD4
#STDOUT_BAUDRATE 57600
PC1 BATT_VOLTAGE_SENS ADC1 SCALE(1)
PC0 BATT_CURRENT_SENS ADC1 SCALE(1)
PA4 VDD_5V_SENS ADC1 SCALE(2)
# SPI1 is fram 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
# USART3 serial1 telem1
PD8 USART3_TX USART3
PD9 USART3_RX USART3
PB13 USART3_CTS USART3
PB14 USART3_RTS USART3
# USART2 serial2 telem2
PC6 USART6_TX USART6
PC7 USART6_RX USART6
PD5 USART2_TX USART2 NODMA
PD6 USART2_RX USART2 NODMA
# USART1 is GPS
PB6 USART1_TX USART1 NODMA
PB7 USART1_RX USART1
define HAL_USE_SERIAL TRUE
PB4 UART7_TX UART7 NODMA
PB3 UART7_RX UART7 NODMA
#define STM32_SERIAL_USE_USART2 TRUE
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
# PWM output for buzzer
PB0 TIM3_CH3 TIM3 RCININT PULLDOWN LOW
PE2 BOOT1 INPUT
PB12 VDD_BRICK_VALID INPUT PULLDOWN
PB10 I2C2_SCL I2C2
PB11 I2C2_SDA I2C2
PA8 CAN3_RX CAN3
PA15 CAN3_TX CAN3
# SPI2 is for sensors
PD3 SPI2_SCK SPI2
PC2 SPI2_MISO SPI2
PC3 SPI2_MOSI SPI2
PD0 IMU1_CS CS
PE0 MPU6500_CS CS
PB5 BARO_CS CS
PD7 MAG_CS CS
# This defines more ADC inputs.
PC4 AUX_POWER ADC1 SCALE(1)
PC5 AUX_ADC2 ADC1 SCALE(1)
PD10 VBUS_VALID INPUT PULLDOWN
PE12 LED_SAFETY OUTPUT
PE15 SAFETY_IN INPUT PULLDOWN
PC14 VDD_PERIPH_EN OUTPUT HIGH
PC8 SDMMC_D0 SDMMC1
PC9 SDMMC_D1 SDMMC1
PC10 SDMMC_D2 SDMMC1
PC11 SDMMC_D3 SDMMC1
PC12 SDMMC_CK SDMMC1
PD2 SDMMC_CMD SDMMC1
PE5 IMU1_DRDY INPUT
PE6 MPU6500_DRDY INPUT
PE4 MAG_DRDY INPUT
PC13 VDD_SENSORS_EN OUTPUT HIGH
# GPIOs
PE3 HEATER_EN OUTPUT LOW GPIO(80)
define HAL_HEATER_GPIO_PIN 80
define HAL_HAVE_IMU_HEATER 1
PD12 TIM4_CH1 TIM4 GPIO(32) ALARM
PB9 EXTERN_GPIO1 OUTPUT GPIO(4)
PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50)
PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51)
PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52)
PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53)
PA0 TIM5_CH1 TIM5 PWM(5) GPIO(54)
PA1 TIM5_CH2 TIM5 PWM(6) GPIO(55)
PA2 TIM5_CH3 TIM5 PWM(7) GPIO(56)
PA3 TIM5_CH4 TIM5 PWM(8) GPIO(57)
PB8 TIM10_CH1 TIM10 PWM(9) GPIO(58) NODMA
PB15 TIM8_CH3N TIM8 PWM(10) GPIO(59) NODMA
# SPI device table.
SPIDEV icm42670 SPI2 DEVID1 IMU1_CS MODE3 2*MHZ 8*MHZ
SPIDEV mpu6500 SPI2 DEVID2 MPU6500_CS MODE3 1*MHZ 4*MHZ
SPIDEV ms5611_int SPI1 DEVID3 BARO_CS MODE3 20*MHZ 20*MHZ
SPIDEV lis3mdl SPI2 DEVID5 MAG_CS MODE3 500*KHZ 500*KHZ
SPIDEV bmp280 SPI1 DEVID3 BARO_CS MODE3 1*MHZ 8*MHZ
SPIDEV dps310 SPI1 DEVID3 BARO_CS MODE3 5*MHZ 5*MHZ
# enable FAT filesystem
define HAL_OS_FATFS_IO 1
define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
# pixracer has 3 LEDs, Red, Green, Blue
define HAL_HAVE_PIXRACER_LED
define HAL_GPIO_LED_ON 0
define HAL_GPIO_LED_OFF 1
PE10 LED_RED OUTPUT GPIO(0)
PE8 LED_GREEN OUTPUT GPIO(1)
PE7 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_MONITOR_DEFAULT 4
define HAL_BATT_VOLT_PIN 11
define HAL_BATT_CURR_PIN 10
define HAL_BATT_VOLT_SCALE 10.1
define HAL_BATT_CURR_SCALE 17.0
DMA_PRIORITY S*
define STORAGE_FLASH_PAGE 1
define HAL_STORAGE_SIZE 32768
# two IMUs
IMU Invensensev3 SPI:icm42670 ROTATION_YAW_270 #ROTATION_YAW_180 #ROTATION_ROLL_180_YAW_270 #ROTATION_YAW_90 #ROTATION_YAW_270 #ROTATION_ROLL_180
IMU Invensense SPI:mpu6500 ROTATION_ROLL_180
COMPASS LIS3MDL SPI:lis3mdl false ROTATION_NONE
# also probe all types of external I2C compasses
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
define HAL_I2C_INTERNAL_MASK 0
#NODMA I2C*
define STM32_I2C_USE_DMA FALSE
# one barometer
BARO MS56XX SPI:ms5611_int
BARO BMP280 SPI:bmp280
BARO DPS310 SPI:dps310
define HAL_BARO_ALLOW_INIT_NO_BARO
define HAL_COMPASS_AUTO_ROT_DEFAULT 2