hwdef.dat 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. # hw definition file for processing by chibios_hwdef.py
  2. # MCU class and specific type
  3. MCU STM32F7xx STM32F777xx
  4. # board ID for firmware load
  5. APJ_BOARD_ID 141
  6. # crystal frequency
  7. OSCILLATOR_HZ 24000000
  8. define STM32_LSECLK 32768U
  9. define STM32_LSEDRV (3U << 3U)
  10. define STM32_PLLSRC STM32_PLLSRC_HSE
  11. define STM32_PLLM_VALUE 24
  12. define STM32_PLLN_VALUE 432
  13. define STM32_PLLP_VALUE 2
  14. define STM32_PLLQ_VALUE 9
  15. # board voltage
  16. STM32_VDD 330U
  17. FLASH_SIZE_KB 2048
  18. # with 2M flash we can afford to optimize for speed
  19. env OPTIMIZE -O2
  20. # start on 4th sector (1st sector for bootloader, 2 for extra storage)
  21. FLASH_RESERVE_START_KB 96
  22. # fallback storage in case FRAM is not populated
  23. define STORAGE_FLASH_PAGE 1
  24. # this is the STM32 timer that ChibiOS will use for the low level
  25. # driver. This must be a 32 bit timer, so Timers 2 or 5 on the STM32F777.
  26. # See hal_st_lld.c in ChibiOS for details
  27. # ChibiOS system timer
  28. STM32_ST_USE_TIMER 5
  29. define HAL_STORAGE_SIZE 16384
  30. # USB setup
  31. USB_VENDOR 0x0483 # ST
  32. USB_PRODUCT 0x5740
  33. USB_STRING_MANUFACTURER "mRo"
  34. # RC Input set for Interrupt not DMA
  35. PC7 TIM3_CH2 TIM3 RCININT FLOAT LOW # also USART6_RX for serial RC
  36. # Control of Spektrum power pin
  37. PE4 SPEKTRUM_PWR OUTPUT LOW GPIO(70)
  38. define HAL_GPIO_SPEKTRUM_PWR 70
  39. # Spektrum Power is Active Low
  40. define HAL_SPEKTRUM_PWR_ENABLED 0
  41. # Spektrum RC Input pin, used as GPIO for bind for Satellite Receivers
  42. PB0 SPEKTRUM_RC INPUT PULLUP GPIO(71)
  43. define HAL_GPIO_SPEKTRUM_RC 71
  44. # Order of I2C buses
  45. I2C_ORDER I2C1
  46. # OEM Only
  47. # I2C_ORDER I2C1, I2C2, I2C3
  48. # order of UARTs (and USB)
  49. # UART4 GPS
  50. # USART2 FC
  51. # USART3 FC
  52. # UART8 FRSKY Telem
  53. # USART6 FC
  54. # UART7 DEBUG
  55. UART_ORDER OTG1 UART4 USART2 USART3 UART8 USART6 UART7 OTG2
  56. # default the 2nd interface to MAVLink2 until MissionPlanner updates drivers
  57. define HAL_OTG2_PROTOCOL SerialProtocol_MAVLink2
  58. # Another USART, this one for telem1. This one has RTS and CTS lines.
  59. # USART2 telem1
  60. PD3 USART2_CTS USART2
  61. PD4 USART2_RTS USART2
  62. PD5 USART2_TX USART2
  63. PD6 USART2_RX USART2
  64. # The telem2 USART, this one for telem2. This one has RTS and CTS lines.
  65. # USART3 telem2
  66. PD8 USART3_TX USART3
  67. PD9 USART3_RX USART3
  68. PD11 USART3_CTS USART3
  69. PD12 USART3_RTS USART3
  70. # UART4 GPS
  71. PA0 UART4_TX UART4
  72. PA1 UART4_RX UART4 NODMA
  73. # USART6 Spare or can be configured as SPI6
  74. PG14 USART6_TX USART6 NODMA
  75. PG9 USART6_RX USART6 NODMA
  76. # UART7 maps to uartF in the HAL (serial5 in SERIALn_ parameters). Debug Console
  77. PE7 UART7_RX UART7 NODMA
  78. PE8 UART7_TX UART7 NODMA
  79. # UART8 FrSky Telemetry
  80. PE0 UART8_RX UART8 NODMA
  81. PE1 UART8_TX UART8 NODMA
  82. # RSSI Analog Input
  83. PC1 RSSI_IN ADC1
  84. # Safety Switch Input
  85. PC4 SAFETY_IN INPUT PULLDOWN
  86. PA2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
  87. PA3 BATT_CURRENT_SENS ADC1 SCALE(1)
  88. # Now the VDD sense pin. This is used to sense primary board voltage.
  89. PA4 VDD_5V_SENS ADC1 SCALE(2)
  90. #SPI1 ICM_20602 / ICM_20948
  91. PA5 SPI1_SCK SPI1
  92. PA6 SPI1_MISO SPI1
  93. PA7 SPI1_MOSI SPI1
  94. #SPI2 FRAM / DPS310
  95. PB10 SPI2_SCK SPI2
  96. PB14 SPI2_MISO SPI2
  97. PB15 SPI2_MOSI SPI2
  98. #SPI5 BMI088
  99. PF7 SPI5_SCK SPI5
  100. PF8 SPI5_MISO SPI5
  101. PF9 SPI5_MOSI SPI5
  102. # This is the pin that senses USB being connected. It is an input pin
  103. # setup as OPENDRAIN.
  104. PA9 VBUS INPUT OPENDRAIN
  105. # This input pin is used to detect that power is valid on USB.
  106. PC0 VBUS_VALID INPUT
  107. # Now we define the pins that USB is connected on.
  108. PA11 OTG_FS_DM OTG1
  109. PA12 OTG_FS_DP OTG1
  110. # These are the pins for SWD debugging with a STlinkv2 or black-magic probe.
  111. PA13 JTMS-SWDIO SWD
  112. PA14 JTCK-SWCLK SWD
  113. # PWM output for buzzer
  114. PA15 TIM2_CH1 TIM2 GPIO(77) ALARM
  115. # Now the first I2C bus. The pin speeds are automatically setup
  116. # correctly, but can be overridden here if needed.
  117. PB8 I2C1_SCL I2C1
  118. PB9 I2C1_SDA I2C1
  119. # the 2nd I2C bus, OEM Only
  120. # PB10 I2C2_SCL I2C2
  121. # PB11 I2C2_SDA I2C2
  122. # the 3nd I2C bus, OEM Only
  123. # PB6 I2C4_SCL I2C4
  124. # PB7 I2C4_SDA I2C4
  125. # Now setup the pins for the microSD card, if available.
  126. PC8 SDMMC_D0 SDMMC1
  127. PC9 SDMMC_D1 SDMMC1
  128. PC10 SDMMC_D2 SDMMC1
  129. PC11 SDMMC_D3 SDMMC1
  130. PC12 SDMMC_CK SDMMC1
  131. PD2 SDMMC_CMD SDMMC1
  132. # More CS pins for more sensors. The labels for all CS pins need to
  133. # match the SPI device table later in this file.
  134. PC2 ICM_20602_CS CS
  135. PD7 BARO_CS CS
  136. # The CS pin for FRAM (ramtron). This one is marked as using
  137. # SPEED_VERYLOW, which matches the HAL_PX4 setup.
  138. PD10 FRAM_CS CS SPEED_VERYLOW NODMA
  139. PE15 ICM_20948_CS CS
  140. PF10 BMI088_GYRO_CS CS
  141. PF6 BMI088_ACCEL_CS CS
  142. # the first CAN bus
  143. PD0 CAN1_RX CAN1
  144. PD1 CAN1_TX CAN1
  145. PF5 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(72)
  146. # This defines the pins for the 2nd CAN interface, OEM Only.
  147. # PB6 CAN2_TX CAN2
  148. # PB4 CAN2_RX CAN2
  149. # Now we start defining some PWM pins. We also map these pins to GPIO
  150. # values, so users can set BRD_PWM_COUNT to choose how many of the PWM
  151. # outputs on the primary MCU are setup as PWM and how many as
  152. # GPIOs. To match HAL_PX4 we number the GPIOs for the PWM outputs
  153. # starting at 50.
  154. PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50)
  155. PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51)
  156. PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52)
  157. PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53)
  158. PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54)
  159. PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55)
  160. PI5 TIM8_CH1 TIM8 PWM(7) GPIO(56)
  161. PI6 TIM8_CH2 TIM8 PWM(8) GPIO(57)
  162. define BOARD_PWM_COUNT_DEFAULT 8
  163. # This is the invensense data-ready pin. We don't use it in the
  164. # default driver.
  165. PD15 MPU_DRDY INPUT
  166. # This is the pin to enable the sensors rail. It can be used to power
  167. # cycle sensors to recover them in case there are problems with power on
  168. # timing affecting sensor stability. We pull it high by default.
  169. PE3 VDD_3V3_SENSORS_EN OUTPUT HIGH
  170. # Power flag pins: these tell the MCU the status of the various power
  171. # supplies that are available. The pin names need to exactly match the
  172. # names used in AnalogIn.cpp.
  173. PB5 VDD_BRICK_VALID INPUT PULLUP
  174. SPIDEV dps280 SPI2 DEVID3 BARO_CS MODE3 10*MHZ 10*MHZ
  175. SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ
  176. SPIDEV icm20948 SPI1 DEVID1 ICM_20948_CS MODE3 2*MHZ 4*MHZ
  177. SPIDEV icm20608 SPI1 DEVID2 ICM_20602_CS MODE3 2*MHZ 8*MHZ
  178. SPIDEV bmi088_g SPI5 DEVID1 BMI088_GYRO_CS MODE3 10*MHZ 10*MHZ
  179. SPIDEV bmi088_a SPI5 DEVID2 BMI088_ACCEL_CS MODE3 10*MHZ 10*MHZ
  180. # Now some defines for logging and terrain data files.
  181. define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
  182. define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
  183. # allow to have have a dedicated safety switch pin
  184. define HAL_HAVE_SAFETY_SWITCH 1
  185. # Enable RAMTROM parameter storage.
  186. define HAL_WITH_RAMTRON 1
  187. # Enable FAT filesystem support (needs a microSD defined via SDMMC).
  188. define HAL_OS_FATFS_IO 1
  189. # Enable RTSCTS support. You should define this if you have any UARTs with RTS/CTS pins.
  190. define AP_FEATURE_RTSCTS 1
  191. # Now setup the default battery pins driver analog pins and default
  192. # scaling for the power brick.
  193. define HAL_BATT_VOLT_PIN 2
  194. define HAL_BATT_CURR_PIN 3
  195. define HAL_BATT_VOLT_SCALE 10.1
  196. define HAL_BATT_CURR_SCALE 17.0
  197. # Control Zero has a TriColor LED, Red, Green, Blue
  198. define HAL_HAVE_PIXRACER_LED
  199. define HAL_GPIO_LED_ON 0
  200. define HAL_GPIO_LED_OFF 1
  201. # LED setup for PixracerLED driver
  202. PB11 LED_R OUTPUT HIGH GPIO(0)
  203. PB1 LED_G OUTPUT HIGH GPIO(1)
  204. PB3 LED_B OUTPUT HIGH GPIO(2)
  205. define HAL_GPIO_A_LED_PIN 0
  206. define HAL_GPIO_B_LED_PIN 1
  207. define HAL_GPIO_C_LED_PIN 2
  208. DMA_PRIORITY SDMMC*
  209. #DMA_NOSHARE SPI1* *
  210. #DMA_NOSHARE SPI5* *
  211. # 3 IMUs
  212. IMU Invensensev2 SPI:icm20948 ROTATION_ROLL_180_YAW_90
  213. IMU Invensense SPI:icm20608 ROTATION_ROLL_180_YAW_90
  214. IMU BMI088 SPI:bmi088_a SPI:bmi088_g ROTATION_NONE
  215. # 1 baro
  216. BARO DPS280 SPI:dps280
  217. # 1 compass
  218. COMPASS AK09916:probe_ICM20948 0 ROTATION_ROLL_180
  219. define HAL_PROBE_EXTERNAL_I2C_COMPASSES