2018-02-12 16:30:32 -04:00
|
|
|
# hw definition file for processing by chibios_pins.py
|
|
|
|
# for crazyflie2.0 hardware (see bitcraze.io)
|
|
|
|
|
|
|
|
# MCU class and specific type
|
|
|
|
MCU STM32F4xx STM32F405xx
|
|
|
|
|
|
|
|
# board ID for firmware load
|
2018-06-23 06:27:28 -03:00
|
|
|
APJ_BOARD_ID 12
|
2018-02-12 16:30:32 -04:00
|
|
|
|
|
|
|
# crystal frequency
|
|
|
|
OSCILLATOR_HZ 8000000
|
|
|
|
|
|
|
|
define STM32_ST_USE_TIMER 5
|
|
|
|
|
|
|
|
FLASH_SIZE_KB 1024
|
|
|
|
|
|
|
|
|
2018-06-23 07:56:05 -03:00
|
|
|
# use USB for stdout
|
|
|
|
#STDOUT_SERIAL SD3
|
|
|
|
#STDOUT_BAUDRATE 57600
|
2018-02-12 16:30:32 -04:00
|
|
|
|
|
|
|
# usart2
|
|
|
|
PA2 USART2_TX USART2 # E_TX2
|
|
|
|
PA3 USART2_RX USART2 # E_RX2
|
|
|
|
|
|
|
|
# external SPI on SPI1
|
|
|
|
PA5 SPI1_SCK SPI1 # E_SCK
|
|
|
|
PA6 SPI1_MISO SPI1 # E_MISO
|
|
|
|
PA7 SPI1_MOSI SPI1 # E_MOSI
|
|
|
|
|
|
|
|
# I2C3 is for IMU
|
|
|
|
PA8 I2C3_SCL I2C3
|
|
|
|
PC9 I2C3_SDA I2C3
|
|
|
|
|
|
|
|
# USB port
|
|
|
|
PA10 USB_ID INPUT
|
|
|
|
PA11 OTG_FS_DM OTG1
|
|
|
|
PA12 OTG_FS_DP OTG1
|
|
|
|
|
|
|
|
# stlink/jtag
|
|
|
|
PA13 JTMS-SWDIO SWD
|
|
|
|
PA14 JTCK-SWCLK SWD
|
|
|
|
|
2018-02-15 00:37:34 -04:00
|
|
|
PA1 TIM2_CH2 TIM2 PWM(1) # front-right
|
|
|
|
PB11 TIM2_CH4 TIM2 PWM(4) # rear-right
|
|
|
|
PA15 TIM2_CH1 TIM2 PWM(2) # rear-left
|
|
|
|
PB9 TIM4_CH4 TIM4 PWM(3) # front-left
|
2018-02-12 16:30:32 -04:00
|
|
|
|
|
|
|
PC13 MPU_INT INPUT
|
|
|
|
PC14 MPU_FSYNC OUTPUT LOW
|
|
|
|
|
|
|
|
# LEDs
|
|
|
|
PD2 LED_BLUE OUTPUT HIGH
|
|
|
|
PC0 LED_RED_L OUTPUT HIGH
|
|
|
|
PC1 LED_GREEN_L OUTPUT HIGH
|
|
|
|
PC2 LED_GREEN_R OUTPUT HIGH
|
|
|
|
PC3 LED_RED_R OUTPUT HIGH
|
|
|
|
|
|
|
|
# misc pins, unused
|
|
|
|
#PH0 OSC_IN
|
|
|
|
#PH1 OSC_OUT
|
|
|
|
#PB2 BOOT1
|
|
|
|
# PB3 STM_SWO
|
|
|
|
|
|
|
|
# CS pins for external SPI devices
|
|
|
|
PC12 E_CS0 CS
|
|
|
|
PB4 E_CS1 CS
|
|
|
|
PB5 E_CS2 CS
|
|
|
|
PB8 E_CS3 CS
|
|
|
|
|
|
|
|
# external I2C on I2C1
|
|
|
|
PB6 I2C1_SCL I2C1 # E_SCL
|
|
|
|
PB7 I2C1_SDA I2C1 # E_SCL
|
|
|
|
|
2018-02-15 02:22:35 -04:00
|
|
|
# radio setup
|
|
|
|
PA4 NRF_FLOW_CTRL INPUT # goes low when we can write to uart
|
2018-02-12 16:30:32 -04:00
|
|
|
#PB13 NRF_SWCLK
|
|
|
|
#PB15 NRF_SWIO
|
2018-02-15 02:22:35 -04:00
|
|
|
PC6 USART6_TX USART6 # NRF_RT
|
|
|
|
PC7 USART6_RX USART6 # NRF_RX
|
2018-02-12 16:30:32 -04:00
|
|
|
|
|
|
|
# USART3 for telemetry
|
|
|
|
PC10 USART3_TX USART3 # E_TX1
|
|
|
|
PC11 USART3_RX USART3 # E_RX1
|
|
|
|
|
|
|
|
# setup I2C order
|
|
|
|
I2C_ORDER I2C3 I2C1
|
|
|
|
|
2018-02-15 00:37:34 -04:00
|
|
|
# we need I2C clock at 400kHz for IMU
|
|
|
|
define HAL_I2C_MAX_CLOCK 400000
|
|
|
|
|
2018-02-12 16:30:32 -04:00
|
|
|
# order of UARTs (and USB)
|
2020-04-24 08:10:08 -03:00
|
|
|
SERIAL_ORDER OTG1 USART3 USART6 USART2
|
2018-02-12 16:30:32 -04:00
|
|
|
|
2018-06-23 05:00:05 -03:00
|
|
|
define HAL_STORAGE_SIZE 15360
|
2021-10-27 02:32:43 -03:00
|
|
|
STORAGE_FLASH_PAGE 1
|
2018-02-12 16:30:32 -04:00
|
|
|
|
|
|
|
# reserve 32k for bootloader and 32k for flash storage
|
|
|
|
FLASH_RESERVE_START_KB 64
|
|
|
|
|
2020-06-06 07:30:32 -03:00
|
|
|
# One IMU for Crazyflie 2.1 - I2C
|
2020-06-05 07:52:37 -03:00
|
|
|
IMU BMI088 I2C:0:0x18 I2C:0:0x69 ROTATION_ROLL_180
|
2019-05-29 20:21:09 -03:00
|
|
|
|
2020-06-06 07:30:32 -03:00
|
|
|
# One IMU for Crazyflie 2.0 - I2C
|
|
|
|
IMU Invensense I2C:0:0x69 ROTATION_YAW_180
|
|
|
|
|
|
|
|
# One baro for Crazyflie 2.1
|
2020-06-05 07:52:37 -03:00
|
|
|
BARO BMP388 I2C:0:0x77
|
2018-02-12 16:30:32 -04:00
|
|
|
|
2020-06-06 07:30:32 -03:00
|
|
|
# One bare for Crazyflie 2.0
|
|
|
|
BARO LPS2XH:probe_InvensenseIMU I2C:0:0x5D 0x69
|
|
|
|
|
2018-07-13 07:14:03 -03:00
|
|
|
# no built-in compass, but probe the i2c bus for all possible
|
|
|
|
# external compass types
|
2018-02-12 17:11:57 -04:00
|
|
|
define ALLOW_ARM_NO_COMPASS
|
2018-07-13 07:14:03 -03:00
|
|
|
define HAL_PROBE_EXTERNAL_I2C_COMPASSES
|
|
|
|
define HAL_I2C_INTERNAL_MASK 0
|
2018-07-28 02:36:37 -03:00
|
|
|
define HAL_COMPASS_AUTO_ROT_DEFAULT 2
|
2018-02-15 02:22:35 -04:00
|
|
|
|
|
|
|
define MAG_BOARD_ORIENTATION ROTATION_YAW_180
|
2019-03-14 23:17:17 -03:00
|
|
|
|
|
|
|
# no ADC pins
|
|
|
|
define HAL_USE_ADC FALSE
|
2023-10-18 11:17:06 -03:00
|
|
|
|
|
|
|
include ../include/minimize_features.inc
|
|
|
|
|