hwdef.dat 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. # hw definition file for processing by chibios_pins.py
  2. # for Holybro KakuteF7 hardware.
  3. @ thanks to betaflight for pin information
  4. # MCU class and specific type
  5. MCU STM32F7xx STM32F745xx
  6. # board ID for firmware load
  7. APJ_BOARD_ID 123
  8. # crystal frequency, setup to use external oscillator
  9. OSCILLATOR_HZ 8000000
  10. define STM32_LSECLK 32768U
  11. define STM32_LSEDRV (3U << 3U)
  12. define STM32_PLLSRC STM32_PLLSRC_HSE
  13. define STM32_PLLM_VALUE 8
  14. define STM32_PLLN_VALUE 432
  15. define STM32_PLLP_VALUE 2
  16. define STM32_PLLQ_VALUE 9
  17. FLASH_SIZE_KB 1024
  18. # leave 2 sectors free
  19. FLASH_RESERVE_START_KB 96
  20. # board voltage
  21. STM32_VDD 330U
  22. # only one I2C bus
  23. I2C_ORDER I2C1
  24. # order of UARTs (and USB), USART3 should be in second place to map order with the board's silk screen
  25. UART_ORDER OTG1 USART3 USART1 USART2 UART4 UART7 USART6
  26. # buzzer
  27. PD15 TIM4_CH4 TIM4 GPIO(77) ALARM
  28. #PD15 BUZZER OUTPUT GPIO(80) LOW
  29. #define HAL_BUZZER_PIN 80
  30. #define HAL_BUZZER_ON 1
  31. #define HAL_BUZZER_OFF 0
  32. # PA10 IO-debug-console
  33. PA11 OTG_FS_DM OTG1
  34. PA12 OTG_FS_DP OTG1
  35. PA13 JTMS-SWDIO SWD
  36. PA14 JTCK-SWCLK SWD
  37. # SPI1 for SDCard
  38. PA4 SDCARD_CS CS
  39. PA5 SPI1_SCK SPI1
  40. PA6 SPI1_MISO SPI1
  41. PA7 SPI1_MOSI SPI1
  42. # SPI2 for MAX7456 OSD
  43. PB12 MAX7456_CS CS
  44. PB13 SPI2_SCK SPI2
  45. PB14 SPI2_MISO SPI2
  46. PB15 SPI2_MOSI SPI2
  47. # SPI4 for ICM20689
  48. PE4 ICM20689_CS CS
  49. PE2 SPI4_SCK SPI4
  50. PE5 SPI4_MISO SPI4
  51. PE6 SPI4_MOSI SPI4
  52. # I2C1 for baro
  53. PB6 I2C1_SCL I2C1
  54. PB7 I2C1_SDA I2C1
  55. PC3 BATT_VOLTAGE_SENS ADC1 SCALE(1)
  56. PC2 BATT_CURRENT_SENS ADC1 SCALE(1)
  57. # define default battery setup
  58. define HAL_BATT_VOLT_PIN 13
  59. define HAL_BATT_CURR_PIN 12
  60. define HAL_BATT_VOLT_SCALE 10.1
  61. define HAL_BATT_CURR_SCALE 17.0
  62. PC5 RSSI_ADC ADC1
  63. PA2 LED0 OUTPUT LOW
  64. # USART1
  65. PA10 USART1_RX USART1
  66. PA9 USART1_TX USART1
  67. # USART2
  68. PD5 USART2_TX USART2
  69. PD6 USART2_RX USART2
  70. # USART3 (GPS)
  71. PB11 USART3_RX USART3
  72. PB10 USART3_TX USART3
  73. # UART4 (GPS2)
  74. PA0 UART4_TX UART4 NODMA
  75. PA1 UART4_RX UART4 NODMA
  76. # USART6, RX only for RCIN
  77. PC7 TIM8_CH2 TIM8 RCININT FLOAT LOW
  78. PC6 USART6_TX USART6 NODMA LOW
  79. # UART7 USED BY ESC FROM ORIGINAL DESIGN
  80. PE7 UART7_RX UART7
  81. PE8 UART7_TX UART7
  82. # Motors
  83. PB1 TIM1_CH3N TIM1 PWM(1) GPIO(50)
  84. PE9 TIM1_CH1 TIM1 PWM(2) GPIO(51)
  85. PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52)
  86. PB0 TIM3_CH3 TIM3 PWM(4) GPIO(53)
  87. PC9 TIM3_CH4 TIM3 PWM(5) GPIO(54)
  88. PA3 TIM5_CH4 TIM5 PWM(6) GPIO(55)
  89. # extra PWM outs
  90. #PD12 TIM4_CH1 TIM4 PWM(7) GPIO(56) # led pin
  91. #PD15 TIM4_CH4 TIM4 PWM(8) GPIO(57) # buzzer pin (need to comment out buzzer)
  92. DMA_PRIORITY S*
  93. define HAL_STORAGE_SIZE 16384
  94. define STORAGE_FLASH_PAGE 1
  95. # spi devices
  96. SPIDEV mpu6000 SPI4 DEVID1 ICM20689_CS MODE3 1*MHZ 4*MHZ
  97. SPIDEV sdcard SPI1 DEVID1 SDCARD_CS MODE0 400*KHZ 25*MHZ
  98. SPIDEV osd SPI2 DEVID4 MAX7456_CS MODE0 10*MHZ 10*MHZ
  99. # no built-in compass, but probe the i2c bus for all possible
  100. # external compass types
  101. define ALLOW_ARM_NO_COMPASS
  102. define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
  103. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  104. define HAL_I2C_INTERNAL_MASK 0
  105. define HAL_COMPASS_AUTO_ROT_DEFAULT 2
  106. # one IMU
  107. IMU Invensense SPI:mpu6000 ROTATION_YAW_180
  108. # one BARO
  109. BARO BMP280 I2C:0:0x76
  110. define HAL_OS_FATFS_IO 1
  111. define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
  112. define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
  113. # setup for OSD
  114. define OSD_ENABLED ENABLED
  115. define HAL_OSD_TYPE_DEFAULT 1
  116. ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin
  117. define BOARD_PWM_COUNT_DEFAULT 6
  118. define STM32_PWM_USE_ADVANCED TRUE
  119. # we are low on flash on this board
  120. define HAL_MINIMIZE_FEATURES 1