# hw definition file for processing by chibios_hwdef.py # for QioTekZealotF407 hardware from Qio-tek.com # MCU class and specific type MCU CKS32F4xx CKS32F407xx # board ID for firmware load APJ_BOARD_ID 1065 FLASH_SIZE_KB 1024 # reserve 16k for bootloader FLASH_RESERVE_START_KB 16 # USB setup USB_STRING_MANUFACTURER "Qiotek" # crystal frequency OSCILLATOR_HZ 8000000 # ChibiOS system timer STM32_ST_USE_TIMER 5 PA11 OTG_FS_DM OTG1 PA12 OTG_FS_DP OTG1 PA13 JTMS-SWDIO SWD PA14 JTCK-SWCLK SWD # this is the pin that senses USB being connected. It is an input pin # setup as OPENDRAIN PA9 VBUS INPUT OPENDRAIN # The normal usage of this ordering is: # 1) SERIAL0: console (primary mavlink, usually USB) # 2) SERIAL1: telem1 # 3) SERIAL2: telem2 (recommend ESP8266) # 4) SERIAL3: primary GPS # 5) SERIAL4: telem3 or GPS2 # 6) SERIAL5: extra UART or sbus output (usually RTOS debug console) SERIAL_ORDER OTG1 USART6 USART3 USART1 UART4 USART2 # UART3 PD8 USART3_TX USART3 PD9 USART3_RX USART3 # USART2 for Mavlink2 wifi module set baudrate to 921600 PD5 USART2_TX USART2 NODMA PD6 USART2_RX USART2 # USART1 for gps1 PB6 USART1_TX USART1 PB7 USART1_RX USART1 # UART4 PA0 UART4_TX UART4 NODMA PA1 UART4_RX UART4 NODMA # USART6 PC6 USART6_TX USART6 NODMA PC7 USART6_RX USART6 NODMA # CAN bus PD0 CAN1_RX CAN1 PD1 CAN1_TX CAN1 # SPI1 for IMU Baro OSD PA5 SPI1_SCK SPI1 PB4 SPI1_MISO SPI1 PB5 SPI1_MOSI SPI1 PD3 IMU1_CS CS PD4 IMU2_CS CS PD7 IMU3_CS CS PB3 Baro1_CS CS PE4 Baro2_CS CS PE6 AT7456_CS CS # SPI bus for dataflash PB13 SPI2_SCK SPI2 PC2 SPI2_MISO SPI2 PC3 SPI2_MOSI SPI2 PC13 FRAM_CS CS SPEED_VERYLOW # SPI devices SPIDEV imu1 SPI1 DEVID1 IMU1_CS MODE3 2*MHZ 8*MHZ SPIDEV imu2 SPI1 DEVID2 IMU2_CS MODE3 2*MHZ 8*MHZ SPIDEV imu3 SPI1 DEVID3 IMU3_CS MODE3 2*MHZ 8*MHZ SPIDEV baro1 SPI1 DEVID2 Baro1_CS MODE3 5*MHZ 5*MHZ SPIDEV baro2 SPI1 DEVID1 Baro2_CS MODE3 5*MHZ 5*MHZ SPIDEV osd SPI1 DEVID2 AT7456_CS MODE0 10*MHZ 10*MHZ SPIDEV ramtron SPI2 DEVID1 FRAM_CS MODE0 8*MHZ 8*MHZ # four IMUs, adi16740 is used, then imu3 will be removed IMU Invensensev3 SPI:imu1 ROTATION_NONE IMU Invensensev3 SPI:imu2 ROTATION_NONE IMU Invensense SPI:imu2 ROTATION_PITCH_180 # two Baro sensors BARO DPS280 SPI:baro1 #BARO DPS280 SPI:baro2 # define the pins for the microSD card. PC8 SDIO_D0 SDIO PC9 SDIO_D1 SDIO PC10 SDIO_D2 SDIO PC11 SDIO_D3 SDIO PC12 SDIO_CK SDIO PD2 SDIO_CMD SDIO # enable FAT filesystem support define HAL_OS_FATFS_IO 1 # now some defines for logging and terrain data files define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS" define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN" # define the order that I2C buses I2C_ORDER I2C1 I2C2 PB8 I2C1_SCL I2C1 PB9 I2C1_SDA I2C1 PB10 I2C2_SCL I2C2 PB11 I2C2_SDA I2C2 # look for I2C compass COMPASS IST8310 I2C:0:0x0E false ROTATION_ROLL_180 COMPASS QMC5883L I2C:0:0x0D false ROTATION_ROLL_180 define HAL_PROBE_EXTERNAL_I2C_COMPASSES define HAL_I2C_INTERNAL_MASK 1 # PWM out pins PA6 TIM3_CH1 TIM3 PWM(1) GPIO(50) PA7 TIM3_CH2 TIM3 PWM(2) GPIO(51) PB0 TIM3_CH3 TIM3 PWM(3) GPIO(52) PB1 TIM3_CH4 TIM3 PWM(4) GPIO(53) PE9 TIM1_CH1 TIM1 PWM(5) GPIO(54) PE11 TIM1_CH2 TIM1 PWM(6) GPIO(55) PE13 TIM1_CH3 TIM1 PWM(7) GPIO(56) PE14 TIM1_CH4 TIM1 PWM(8) GPIO(57) PD12 TIM4_CH1 TIM4 PWM(9) GPIO(58) PD13 TIM4_CH2 TIM4 PWM(10) GPIO(59) PD14 TIM4_CH3 TIM4 PWM(11) GPIO(60) PD15 TIM4_CH4 TIM4 PWM(12) GPIO(61) PE7 EXTERN_GPIO1 OUTPUT GPIO(1) PE8 EXTERN_GPIO2 OUTPUT GPIO(2) PE2 EXTERN_GPIO3 OUTPUT GPIO(3) PE3 EXTERN_GPIO4 OUTPUT GPIO(4) PE1 EXTERN_GPIO5 OUTPUT GPIO(5) PE0 EXTERN_GPIO6 OUTPUT GPIO(6) # also USART6_RX for serial RC PA15 TIM2_CH1 TIM2 RCININT PULLDOWN LOW # LED setup is similar to PixRacer define HAL_HAVE_PIXRACER_LED PE10 LED_RED OUTPUT GPIO(10) PE12 LED_GREEN OUTPUT GPIO(11) PE15 LED_BLUE OUTPUT GPIO(12) define HAL_GPIO_A_LED_PIN 10 define HAL_GPIO_B_LED_PIN 11 define HAL_GPIO_C_LED_PIN 12 define HAL_GPIO_LED_ON 0 define HAL_GPIO_LED_OFF 1 # analog in 6.6V PC1 ADC_1 ADC1 SCALE(2) # define the primary battery connectors. PA3 BATT_CURRENT_SENS ADC1 SCALE(2) PA2 BATT_VOLTAGE_SENS ADC1 SCALE(2) PC5 BATT2_CURRENT_SENS ADC1 SCALE(2) PC4 BATT2_VOLTAGE_SENS ADC1 SCALE(2) PA4 VDD_5V_SENS ADC1 SCALE(2) PC0 FMU_SERVORAIL_VCC_SENS ADC1 SCALE(12) #PB2 HEATER_EN OUTPUT LOW GPIO(5) #define HAL_HEATER_GPIO_PIN 5 #define HAL_IMU_TEMP_DEFAULT 45 define HAL_HAVE_SAFETY_SWITCH 1 PB15 LED_SAFETY OUTPUT PB12 SAFETY_IN INPUT PULLDOWN PB14 TIM12_CH1 TIM12 ALARM # enable RAMTROM parameter storage define HAL_WITH_RAMTRON 1 define HAL_STORAGE_SIZE 16384 # --------------------- save flash ---------------------- include ../include/minimize_features.inc # setup for OSD undef OSD_ENABLED define OSD_ENABLED 1 define HAL_OSD_TYPE_DEFAULT 1 ROMFS_WILDCARD libraries/AP_OSD/fonts/font1.bin