hwdef.dat 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. # hw definition file for processing by chibios_hwdef.py
  2. # for FMUv4pro hardware (Pixhawk 3 Pro)
  3. define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_FMUV4PRO
  4. define BOARD_TYPE_DEFAULT 14
  5. # MCU class and specific type
  6. MCU STM32F4xx STM32F469xx
  7. # board ID for firmware load
  8. APJ_BOARD_ID 13
  9. # crystal frequency
  10. OSCILLATOR_HZ 24000000
  11. # board voltage
  12. STM32_VDD 330U
  13. # ChibiOS system timer
  14. STM32_ST_USE_TIMER 5
  15. # flash size
  16. FLASH_SIZE_KB 2048
  17. env OPTIMIZE -O2
  18. # serial port for stdout, disabled so console is on USB
  19. #STDOUT_SERIAL SD7
  20. #STDOUT_BAUDRATE 57600
  21. # order of I2C buses
  22. I2C_ORDER I2C1 I2C2
  23. # now the UART order. These map to the hal.uartA to hal.uartF
  24. # objects. If you use a shorter list then HAL_Empty::UARTDriver
  25. # objects are substituted for later UARTs, or you can leave a gap by
  26. # listing one or more of the uarts as EMPTY
  27. # 1) SERIAL0: console (primary mavlink, usually USB)
  28. # 2) SERIAL3: primary GPS
  29. # 3) SERIAL1: telem1
  30. # 4) SERIAL2: telem2
  31. # 5) SERIAL4: GPS2
  32. # 6) SERIAL5: extra UART (usually RTOS debug console)
  33. # order of UARTs (and USB)
  34. UART_ORDER OTG1 UART4 USART2 USART3 UART8 USART1 UART7
  35. # UART for IOMCU
  36. IOMCU_UART USART6
  37. # we have a safety switch on IO
  38. define HAL_HAVE_SAFETY_SWITCH 1
  39. # UART4 serial GPS
  40. PA0 UART4_TX UART4
  41. PA1 UART4_RX UART4
  42. # battery connectors
  43. PA2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
  44. PA3 BATT_CURRENT_SENS ADC1 SCALE(1)
  45. # VDD sense pin. This is used to sense primary board voltags
  46. PA4 VDD_5V_SENS ADC1 SCALE(2)
  47. # SPI1 is sensors bus
  48. PA5 SPI1_SCK SPI1
  49. PA6 SPI1_MISO SPI1
  50. PA7 SPI1_MOSI SPI1
  51. # SPI1 CS pins
  52. PC2 MPU9250_CS CS
  53. PC15 20608_CS CS
  54. PD7 BARO_CS CS
  55. PE15 MAG_CS CS
  56. PH5 EEPROM_CS CS
  57. PA9 VBUS INPUT OPENDRAIN
  58. # now we define the pins that USB is connected on
  59. PA11 OTG_FS_DM OTG1
  60. PA12 OTG_FS_DP OTG1
  61. # these are the pins for SWD debugging with a STlinkv2 or black-magic probe
  62. PA13 JTMS-SWDIO SWD
  63. PA14 JTCK-SWCLK SWD
  64. # PWM output for buzzer
  65. PA15 TIM2_CH1 TIM2 GPIO(77) ALARM
  66. # this defines a couple of general purpose outputs, mapped to GPIO
  67. # numbers 1 and 2 for users
  68. # PB0 EXTERN_GPIO1 OUTPUT GPIO(1)
  69. # PB1 EXTERN_GPIO2 OUTPUT GPIO(2)
  70. #PB0 INPUT PULLUP # RC Input PPM
  71. PB1 LED_GREEN OUTPUT GPIO(0)
  72. PB2 BOOT1 INPUT
  73. PB3 LED_BLUE OUTPUT GPIO(1)
  74. PB6 USART1_TX USART1
  75. PB7 USART1_RX USART1
  76. PA8 USART1_RTS USART1
  77. # PE10 is not a hw CTS pin for USART1
  78. PE10 8266_CTS INPUT
  79. # make GPIOs for ESP8266 available via mavlink relay control as pins
  80. # 60 to 63
  81. PB4 8266_GPIO2 OUTPUT GPIO(60)
  82. PE2 8266_GPI0 INPUT PULLUP GPIO(61)
  83. PE5 8266_PD OUTPUT HIGH GPIO(62)
  84. PE6 8266_RST OUTPUT HIGH GPIO(63)
  85. PB8 I2C1_SCL I2C1
  86. PB9 I2C1_SDA I2C1
  87. PF1 I2C2_SCL I2C2
  88. PF0 I2C2_SDA I2C2
  89. # SPI2 is FRAM
  90. PB10 SPI2_SCK SPI2
  91. PB11 LED_RED OUTPUT GPIO(2)
  92. PB12 CAN2_RX CAN2
  93. PB13 CAN2_TX CAN2
  94. PB14 SPI2_MISO SPI2
  95. PB15 SPI2_MOSI SPI2
  96. PC0 VBUS_VALID INPUT
  97. PC1 BATT2_VOLTAGE_SENS ADC1 SCALE(1)
  98. PC3 BATT2_CURRENT_SENS ADC1 SCALE(1)
  99. #PC4 SAFETY_IN INPUT PULLDOWN
  100. # this sets up the UART for talking to the IOMCU. Note that it is
  101. # vital that this UART has DMA available. See the DMA settings below
  102. # for more information
  103. # USART6 to IO
  104. PC6 USART6_TX USART6
  105. PC7 USART6_RX USART6
  106. # now setup the pins for the microSD card, if available
  107. PC8 SDIO_D0 SDIO
  108. PC9 SDIO_D1 SDIO
  109. PC10 SDIO_D2 SDIO
  110. PC11 SDIO_D3 SDIO
  111. PC12 SDIO_CK SDIO
  112. PC13 SBUS_INV OUTPUT
  113. PC14 20608_DRDY INPUT
  114. PD0 CAN1_RX CAN1
  115. PD1 CAN1_TX CAN1
  116. PD2 SDIO_CMD SDIO
  117. # USART2 serial2 telem1
  118. PD3 USART2_CTS USART2
  119. PD4 USART2_RTS USART2
  120. PD5 USART2_TX USART2
  121. PD6 USART2_RX USART2
  122. # USART3 serial3 telem2
  123. PD8 USART3_TX USART3
  124. PD9 USART3_RX USART3
  125. PD10 FRAM_CS CS
  126. PD11 USART3_CTS USART3
  127. PD12 USART3_RTS USART3
  128. PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54)
  129. PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55)
  130. PD15 MPU9250_DRDY INPUT
  131. # UART8 serial4 FrSky
  132. PE0 UART8_RX UART8
  133. PE1 UART8_TX UART8
  134. # allow this uart to be inverted for transmit under user control
  135. # the polarity is the value to use on the GPIO to change the polarity
  136. # to the opposite of the default
  137. PA10 UART8_TXINV OUTPUT HIGH GPIO(78) POL(0)
  138. PE3 VDD_SENSORS_EN OUTPUT HIGH
  139. # start peripheral power off, then enable after init
  140. # this prevents a problem with radios that use RTS for
  141. # bootloader hold
  142. PC5 VDD_5V_WIFI_EN OUTPUT HIGH
  143. PF4 nVDD_5V_HIPOWER_EN OUTPUT HIGH
  144. PG10 nVDD_5V_PERIPH_EN OUTPUT HIGH
  145. # UART7 is debug
  146. PE7 UART7_RX UART7 NODMA
  147. PE8 UART7_TX UART7 NODMA
  148. PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53)
  149. PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52)
  150. PE12 MAG_DRDY INPUT
  151. PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51)
  152. PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50)
  153. # Power flag pins: these tell the MCU the status of the various power
  154. # supplies that are available. The pin names need to exactly match the
  155. # names used in AnalogIn.cpp.
  156. PB5 VDD_BRICK_VALID INPUT PULLUP
  157. PG5 VDD_BRICK2_VALID INPUT PULLUP
  158. PF3 VDD_5V_HIPOWER_OC INPUT PULLUP
  159. PG4 VDD_5V_PERIPH_OC INPUT PULLUP
  160. # SPI device table
  161. SPIDEV ms5611 SPI1 DEVID3 BARO_CS MODE3 20*MHZ 20*MHZ
  162. SPIDEV mpu9250 SPI1 DEVID4 MPU9250_CS MODE3 2*MHZ 4*MHZ
  163. SPIDEV icm20608 SPI1 DEVID6 20608_CS MODE3 2*MHZ 8*MHZ
  164. SPIDEV lis3mdl SPI1 DEVID5 MAG_CS MODE3 500*KHZ 500*KHZ
  165. SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ
  166. # two IMUs
  167. define HAL_DEFAULT_INS_FAST_SAMPLE 1
  168. IMU Invensense SPI:icm20608 ROTATION_ROLL_180_YAW_90
  169. IMU Invensense SPI:mpu9250 ROTATION_ROLL_180_YAW_90
  170. # one baro
  171. BARO MS56XX SPI:ms5611
  172. # two compasses
  173. COMPASS AK8963:probe_mpu9250 0 ROTATION_ROLL_180_YAW_90
  174. COMPASS LIS3MDL SPI:lis3mdl false ROTATION_NONE
  175. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  176. define HAL_CHIBIOS_ARCH_FMUV4PRO 1
  177. define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
  178. define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
  179. define HAL_STORAGE_SIZE 16384
  180. define HAL_WITH_RAMTRON 1
  181. # fallback to flash is no FRAM fitted
  182. define STORAGE_FLASH_PAGE 22
  183. # enable FAT filesystem support (needs a microSD defined via SDIO)
  184. define HAL_OS_FATFS_IO 1
  185. # enable RTSCTS support
  186. define AP_FEATURE_RTSCTS 1
  187. # enable SBUS_OUT on IOMCU (if you have an IOMCU)
  188. define AP_FEATURE_SBUS_OUT 1
  189. # battery setup
  190. define HAL_BATT_VOLT_PIN 2
  191. define HAL_BATT_CURR_PIN 3
  192. define HAL_BATT_VOLT_SCALE 10.1
  193. define HAL_BATT_CURR_SCALE 17.0
  194. # setup serial port defaults for ESP8266
  195. define HAL_SERIAL5_PROTOCOL SerialProtocol_MAVLink
  196. define HAL_SERIAL5_BAUD 921600
  197. # 8 PWM available by default
  198. define BOARD_PWM_COUNT_DEFAULT 6
  199. # We can't share the IO UART (USART6).
  200. DMA_NOSHARE USART6_TX USART6_RX ADC1
  201. DMA_PRIORITY USART6*
  202. ROMFS io_firmware.bin Tools/IO_Firmware/iofirmware_lowpolh.bin