hwdef.dat 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. # hw definition file for processing by chibios_hwdef.py
  2. # MCU class and specific type
  3. MCU STM32H7xx STM32H743xx
  4. # crystal frequency
  5. OSCILLATOR_HZ 16000000
  6. # USB setup
  7. USB_VENDOR 0x3162 # ONLY FOR USE BY Holybro
  8. USB_PRODUCT 0x004B
  9. USB_STRING_MANUFACTURER "Holybro"
  10. USB_STRING_PRODUCT "Durandal"
  11. USB_STRING_SERIAL "%SERIAL%"
  12. # board ID for firmware load
  13. APJ_BOARD_ID 139
  14. FLASH_SIZE_KB 2048
  15. # with 2M flash we can afford to optimize for speed
  16. env OPTIMIZE -O2
  17. # bootloader takes first sector
  18. FLASH_RESERVE_START_KB 128
  19. # board voltage
  20. STM32_VDD 330U
  21. # order of UARTs (and USB)
  22. UART_ORDER OTG1 USART1 USART2 USART3 UART4 USART6 UART7 OTG2
  23. # default the 2nd interface to MAVLink2 until MissionPlanner updates drivers
  24. define HAL_OTG2_PROTOCOL SerialProtocol_MAVLink2
  25. define HAL_STORAGE_SIZE 16384
  26. define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_FMUV5
  27. define HAL_CHIBIOS_ARCH_FMUV5 1
  28. define BOARD_TYPE_DEFAULT 24
  29. # now we define the pins that USB is connected on
  30. PA11 OTG_FS_DM OTG1
  31. PA12 OTG_FS_DP OTG1
  32. # these are the pins for SWD debugging with a STlinkv2 or black-magic probe
  33. PA13 JTMS-SWDIO SWD
  34. PA14 JTCK-SWCLK SWD
  35. # SPI1 - internal sensors
  36. PG11 SPI1_SCK SPI1
  37. PA6 SPI1_MISO SPI1
  38. PD7 SPI1_MOSI SPI1
  39. # SPI2 - FRAM
  40. PI1 SPI2_SCK SPI2
  41. PI2 SPI2_MISO SPI2
  42. PI3 SPI2_MOSI SPI2
  43. # SPI4 - sensors2
  44. PE2 SPI4_SCK SPI4
  45. PE13 SPI4_MISO SPI4
  46. PE6 SPI4_MOSI SPI4
  47. # SPI5 - external1
  48. PF7 SPI5_SCK SPI5
  49. PF8 SPI5_MISO SPI5
  50. PF9 SPI5_MOSI SPI5
  51. # SPI6 - external2
  52. PG13 SPI6_SCK SPI6
  53. PG12 SPI6_MISO SPI6
  54. PB5 SPI6_MOSI SPI6
  55. # sensor CS
  56. PF10 MS5611_CS CS
  57. PF2 ICM20689_CS CS SPEED_VERYLOW
  58. PF3 ICM20602_CS CS SPEED_VERYLOW
  59. PF4 BMI055_G_CS CS
  60. PG10 BMI055_A_CS CS
  61. PF5 FRAM_CS CS SPEED_VERYLOW
  62. # external CS pins, SPI5 connector
  63. PI4 EXT1_CS1 CS
  64. PI10 EXT1_CS2 CS
  65. # external CS pins, SPI6 connector
  66. PI6 EXT2_CS1 CS
  67. PI7 EXT2_CS2 CS
  68. PI8 EXT2_CS3 CS
  69. # I2C buses
  70. # I2C1 is on GPS port
  71. PB8 I2C1_SCL I2C1
  72. PB9 I2C1_SDA I2C1
  73. # I2C on telem4 connector
  74. PF1 I2C2_SCL I2C2
  75. PF0 I2C2_SDA I2C2
  76. # I2C for onboard mag
  77. PH7 I2C3_SCL I2C3
  78. PH8 I2C3_SDA I2C3
  79. # I2C4 is on BDMA on DMAMUX2, connected to I2CA connector
  80. PF14 I2C4_SCL I2C4
  81. PF15 I2C4_SDA I2C4
  82. # order of I2C buses
  83. I2C_ORDER I2C3 I2C1 I2C2 I2C4
  84. define HAL_I2C_INTERNAL_MASK 1
  85. # enable pins
  86. PE3 VDD_3V3_SENSORS_EN OUTPUT LOW
  87. # start peripheral power off, then enable after init
  88. # this prevents a problem with radios that use RTS for
  89. # bootloader hold
  90. PF12 nVDD_5V_HIPOWER_EN OUTPUT HIGH
  91. PG4 nVDD_5V_PERIPH_EN OUTPUT HIGH
  92. PG5 VDD_5V_RC_EN OUTPUT HIGH
  93. PG6 VDD_5V_WIFI_EN OUTPUT HIGH
  94. PG7 VDD_3V3_SD_CARD_EN OUTPUT HIGH
  95. # drdy pins
  96. PE7 DRDY8_NC INPUT
  97. PB4 DRDY1_ICM20689 INPUT
  98. PB14 DRDY2_BMI055_GYRO INPUT
  99. PB15 DRDY3_BMI055_ACC INPUT
  100. PC5 DRDY4_ICM20602 INPUT
  101. PC13 DRDY5_BMI055_GYRO INPUT
  102. PD10 DRDY6_BMI055_ACC INPUT
  103. PD15 DRDY7_EXTERNAL1 INPUT
  104. # UARTs
  105. # USART2 is telem1
  106. PD6 USART2_RX USART2
  107. PD5 USART2_TX USART2
  108. PD3 USART2_CTS USART2
  109. PD4 USART2_RTS USART2
  110. # USART1 is GPS1
  111. PB7 USART1_RX USART1 NODMA
  112. PB6 USART1_TX USART1 NODMA
  113. # USART3 is telem2
  114. PD9 USART3_RX USART3
  115. PD8 USART3_TX USART3
  116. PD11 USART3_CTS USART3
  117. PD12 USART3_RTS USART3
  118. # UART4 GPS2
  119. PD0 UART4_RX UART4 NODMA
  120. PD1 UART4_TX UART4 NODMA
  121. # USART6 is telem3
  122. PG9 USART6_RX USART6 NODMA
  123. # we leave PG14 as an input to prevent it acting as a pullup
  124. # on the IOMCU SBUS input
  125. # PG14 USART6_TX USART6
  126. PG15 USART6_CTS USART6
  127. PG8 USART6_RTS USART6
  128. # UART7 is debug
  129. PF6 UART7_RX UART7 NODMA
  130. PE8 UART7_TX UART7 NODMA
  131. # UART8 is for IOMCU
  132. PE0 UART8_RX UART8
  133. PE1 UART8_TX UART8
  134. # UART for IOMCU
  135. IOMCU_UART UART8
  136. # enable RTSCTS support
  137. define AP_FEATURE_RTSCTS 1
  138. # enable SBUS_OUT on IOMCU (if you have an IOMCU)
  139. define AP_FEATURE_SBUS_OUT 1
  140. # PWM AUX channels
  141. PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50)
  142. PA10 TIM1_CH3 TIM1 PWM(2) GPIO(51)
  143. PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52)
  144. PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53)
  145. PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54)
  146. PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55)
  147. # we need to disable DMA on the last 2 FMU channels
  148. # as timer 12 doesn't have a TIMn_UP DMA option
  149. PH6 TIM12_CH1 TIM12 PWM(7) GPIO(56) NODMA
  150. PH9 TIM12_CH2 TIM12 PWM(8) GPIO(57) NODMA
  151. define BOARD_PWM_COUNT_DEFAULT 8
  152. # PWM output for buzzer
  153. PE5 TIM15_CH1 TIM15 GPIO(77) ALARM
  154. # analog in
  155. PA0 BATT_VOLTAGE_SENS ADC1 SCALE(1)
  156. PA1 BATT_CURRENT_SENS ADC1 SCALE(1)
  157. PA2 BATT2_VOLTAGE_SENS ADC1 SCALE(1)
  158. PA3 BATT2_CURRENT_SENS ADC1 SCALE(1)
  159. PC4 SPARE1_ADC1 ADC1 SCALE(1)
  160. PA4 SPARE2_ADC1 ADC1 SCALE(1)
  161. PB0 RSSI_IN ADC1 SCALE(1)
  162. #PC3 HW_REV_SENS ADC1 SCALE(1)
  163. #PC2 HW_VER_SENS ADC1 SCALE(1)
  164. PC0 VDD_5V_SENS ADC1 SCALE(2)
  165. PC1 SCALED_V3V3 ADC1 SCALE(2)
  166. # CAN bus
  167. PI9 CAN1_RX CAN1
  168. PH13 CAN1_TX CAN1
  169. PB12 CAN2_RX CAN2
  170. PB13 CAN2_TX CAN2
  171. PH2 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(70)
  172. PH3 GPIO_CAN2_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(71)
  173. PH4 GPIO_CAN3_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(72)
  174. # GPIOs
  175. PA7 HEATER_EN OUTPUT LOW GPIO(80)
  176. define HAL_HEATER_GPIO_PIN 80
  177. define HAL_HAVE_IMU_HEATER 1
  178. define HAL_IMU_TEMP_DEFAULT 45
  179. # SPI temperature sensor
  180. PH5 TSENSE_CS CS
  181. PG1 VDD_BRICK_VALID INPUT PULLUP
  182. PG2 VDD_BRICK2_VALID INPUT PULLUP
  183. PA9 VBUS INPUT
  184. PF13 VDD_5V_HIPOWER_OC INPUT PULLUP
  185. PE15 VDD_5V_PERIPH_OC INPUT PULLUP
  186. PB10 nSPI5_RESET_EXTERNAL1 OUTPUT HIGH
  187. # capture pins
  188. PA5 FMU_CAP1 INPUT GPIO(58)
  189. PB3 FMU_CAP2 INPUT GPIO(59)
  190. PB11 FMU_CAP3 INPUT GPIO(60)
  191. PI0 FMU_SPARE_4 INPUT GPIO(61)
  192. # SPI devices
  193. SPIDEV ms5611 SPI4 DEVID1 MS5611_CS MODE3 20*MHZ 20*MHZ
  194. SPIDEV icm20689 SPI1 DEVID1 ICM20689_CS MODE3 2*MHZ 8*MHZ
  195. SPIDEV icm20602 SPI1 DEVID2 ICM20602_CS MODE3 2*MHZ 8*MHZ
  196. SPIDEV bmi055_g SPI1 DEVID3 BMI055_G_CS MODE3 10*MHZ 10*MHZ
  197. SPIDEV bmi055_a SPI1 DEVID4 BMI055_A_CS MODE3 10*MHZ 10*MHZ
  198. SPIDEV ramtron SPI2 DEVID1 FRAM_CS MODE3 8*MHZ 8*MHZ
  199. # SPI5 external connections
  200. SPIDEV external1m0 SPI5 DEVID1 EXT1_CS1 MODE0 2*MHZ 2*MHZ
  201. SPIDEV external1m1 SPI5 DEVID1 EXT1_CS1 MODE1 2*MHZ 2*MHZ
  202. SPIDEV external1m2 SPI5 DEVID1 EXT1_CS1 MODE2 2*MHZ 2*MHZ
  203. SPIDEV external1m3 SPI5 DEVID1 EXT1_CS1 MODE3 2*MHZ 2*MHZ
  204. SPIDEV external2m0 SPI5 DEVID2 EXT1_CS2 MODE0 2*MHZ 2*MHZ
  205. SPIDEV external2m1 SPI5 DEVID2 EXT1_CS2 MODE1 2*MHZ 2*MHZ
  206. SPIDEV external2m2 SPI5 DEVID2 EXT1_CS2 MODE2 2*MHZ 2*MHZ
  207. SPIDEV external2m3 SPI5 DEVID2 EXT1_CS2 MODE3 2*MHZ 2*MHZ
  208. # SPI6 external connections
  209. SPIDEV external3m0 SPI6 DEVID1 EXT2_CS1 MODE0 2*MHZ 2*MHZ
  210. SPIDEV external3m1 SPI6 DEVID1 EXT2_CS1 MODE1 2*MHZ 2*MHZ
  211. SPIDEV external3m2 SPI6 DEVID1 EXT2_CS1 MODE2 2*MHZ 2*MHZ
  212. SPIDEV external3m3 SPI6 DEVID1 EXT2_CS1 MODE3 2*MHZ 2*MHZ
  213. SPIDEV external4m0 SPI6 DEVID2 EXT2_CS2 MODE0 2*MHZ 2*MHZ
  214. SPIDEV external4m1 SPI6 DEVID2 EXT2_CS2 MODE1 2*MHZ 2*MHZ
  215. SPIDEV external4m2 SPI6 DEVID2 EXT2_CS2 MODE2 2*MHZ 2*MHZ
  216. SPIDEV external4m3 SPI6 DEVID2 EXT2_CS2 MODE3 2*MHZ 2*MHZ
  217. SPIDEV external5m0 SPI6 DEVID2 EXT2_CS3 MODE0 2*MHZ 2*MHZ
  218. SPIDEV external5m1 SPI6 DEVID2 EXT2_CS3 MODE1 2*MHZ 2*MHZ
  219. SPIDEV external5m2 SPI6 DEVID2 EXT2_CS3 MODE2 2*MHZ 2*MHZ
  220. SPIDEV external5m3 SPI6 DEVID2 EXT2_CS3 MODE3 2*MHZ 2*MHZ
  221. # microSD support (disabled for now)
  222. PC8 SDMMC1_D0 SDMMC1
  223. PC9 SDMMC1_D1 SDMMC1
  224. PC10 SDMMC1_D2 SDMMC1
  225. PC11 SDMMC1_D3 SDMMC1
  226. PC12 SDMMC1_CK SDMMC1
  227. PD2 SDMMC1_CMD SDMMC1
  228. # red LED marked as B/E
  229. PB1 LED_RED OUTPUT GPIO(90)
  230. # green LED marked as PWR. We leave this solid on, but allow
  231. # for it to be controlled as a relay if needed
  232. PC6 LED_GREEN OUTPUT GPIO(91) LOW
  233. # blue LED marked as ACT
  234. PC7 LED_BLUE OUTPUT GPIO(92) HIGH
  235. # setup for BoardLED2
  236. define HAL_GPIO_A_LED_PIN 90
  237. define HAL_GPIO_B_LED_PIN 92
  238. define HAL_GPIO_LED_ON 0
  239. # enable RAMTROM parameter storage
  240. define HAL_STORAGE_SIZE 16384
  241. define HAL_WITH_RAMTRON 1
  242. # allow to have have a dedicated safety switch pin
  243. define HAL_HAVE_SAFETY_SWITCH 1
  244. # one baro
  245. BARO MS56XX SPI:ms5611
  246. define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
  247. define HAL_COMPASS_AUTO_ROT_DEFAULT 2
  248. # enable FAT filesystem support (needs a microSD defined via SDMMC)
  249. define HAL_OS_FATFS_IO 1
  250. define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
  251. define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
  252. ROMFS io_firmware.bin Tools/IO_Firmware/iofirmware_lowpolh.bin
  253. # don't share IOMCU DMA
  254. DMA_NOSHARE UART8* SPI1* TIM*UP*
  255. DMA_PRIORITY UART8* ADC* SPI1*
  256. # battery setup
  257. define HAL_BATT_MONITOR_DEFAULT 4
  258. define HAL_BATT_VOLT_PIN 16
  259. define HAL_BATT_CURR_PIN 17
  260. define HAL_BATT2_VOLT_PIN 14
  261. define HAL_BATT2_CURR_PIN 15
  262. define HAL_BATT_VOLT_SCALE 18.182
  263. define HAL_BATT_CURR_SCALE 36.364
  264. # there is an issue with DMA on SPI which needs to be solved
  265. # before we enable it
  266. #define HAL_SPI_USE_POLLED