hwdef.dat 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. # hw definition file for processing by chibios_hwdef.py
  2. # USB setup
  3. USB_VENDOR 0x2DAE # ONLY FOR USE BY HEX! NOBODY ELSE
  4. USB_PRODUCT 0x1016
  5. USB_STRING_MANUFACTURER "Hex/ProfiCNC"
  6. USB_STRING_PRODUCT "CubeOrange"
  7. USB_STRING_SERIAL "%SERIAL%"
  8. # MCU class and specific type
  9. MCU STM32H7xx STM32H743xx
  10. # crystal frequency
  11. OSCILLATOR_HZ 24000000
  12. # board ID for firmware load
  13. APJ_BOARD_ID 140
  14. FLASH_SIZE_KB 2048
  15. # with 2M flash we can afford to optimize for speed
  16. env OPTIMIZE -O2
  17. FLASH_RESERVE_START_KB 128
  18. # board voltage
  19. STM32_VDD 330U
  20. define HAL_STORAGE_SIZE 16384
  21. # order of I2C buses
  22. I2C_ORDER I2C2 I2C1
  23. # order of UARTs (and USB)
  24. UART_ORDER OTG1 UART4 USART2 USART3 UART8 UART7 OTG2
  25. # If the board has an IOMCU connected via a UART then this defines the
  26. # UART to talk to that MCU. Leave it out for boards with no IOMCU.
  27. # UART for IOMCU
  28. IOMCU_UART USART6
  29. # UART4 serial GPS
  30. PA0 UART4_TX UART4
  31. PA1 UART4_RX UART4 NODMA
  32. PA2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
  33. PA3 BATT_CURRENT_SENS ADC1 SCALE(1)
  34. # Now the VDD sense pin. This is used to sense primary board voltage.
  35. PA4 VDD_5V_SENS ADC1 SCALE(2)
  36. PA5 SPI1_SCK SPI1
  37. PA6 SPI1_MISO SPI1
  38. PA7 SPI1_MOSI SPI1
  39. PA8 VDD_5V_PERIPH_EN OUTPUT LOW
  40. # This is the pin that senses USB being connected. It is an input pin
  41. # setup as OPENDRAIN.
  42. PA9 VBUS INPUT OPENDRAIN
  43. # Now we define the pins that USB is connected on.
  44. PA11 OTG_FS_DM OTG1
  45. PA12 OTG_FS_DP OTG1
  46. # These are the pins for SWD debugging with a STlinkv2 or black-magic probe.
  47. PA13 JTMS-SWDIO SWD
  48. PA14 JTCK-SWCLK SWD
  49. # PWM output for buzzer
  50. PA15 TIM2_CH1 TIM2 GPIO(77) ALARM
  51. # This defines a couple of general purpose outputs, mapped to GPIO
  52. # numbers 1 and 2 for users.
  53. PB0 EXTERN_GPIO1 OUTPUT GPIO(1)
  54. PB1 EXTERN_GPIO2 OUTPUT GPIO(2)
  55. # This defines some input pins, currently unused.
  56. PB2 BOOT1 INPUT
  57. PB3 FMU_SW0 INPUT
  58. # This defines the pins for the 2nd CAN interface, if available.
  59. PB6 CAN2_TX CAN2
  60. PB12 CAN2_RX CAN2
  61. # Now the first I2C bus. The pin speeds are automatically setup
  62. # correctly, but can be overridden here if needed.
  63. PB8 I2C1_SCL I2C1
  64. PB9 I2C1_SDA I2C1
  65. # the 2nd I2C bus
  66. PB10 I2C2_SCL I2C2
  67. PB11 I2C2_SDA I2C2
  68. # the 2nd SPI bus
  69. PB13 SPI2_SCK SPI2
  70. PB14 SPI2_MISO SPI2
  71. PB15 SPI2_MOSI SPI2
  72. # This input pin is used to detect that power is valid on USB.
  73. PC0 VBUS_VALID INPUT
  74. # This defines the CS pin for the magnetometer and first IMU. Note
  75. # that CS pins are software controlled, and are not tied to a particular
  76. # SPI bus.
  77. PC1 MAG_CS CS
  78. PC2 MPU_CS CS
  79. # This defines more ADC inputs.
  80. PC3 AUX_POWER ADC1 SCALE(1)
  81. PC4 AUX_ADC2 ADC1 SCALE(1)
  82. # And the analog input for airspeed (rarely used these days).
  83. PC5 PRESSURE_SENS ADC1 SCALE(2)
  84. # USART6 to IO
  85. PC6 USART6_TX USART6
  86. PC7 USART6_RX USART6
  87. # Now setup the pins for the microSD card, if available.
  88. PC8 SDMMC1_D0 SDMMC1
  89. PC9 SDMMC1_D1 SDMMC1
  90. PC10 SDMMC1_D2 SDMMC1
  91. PC11 SDMMC1_D3 SDMMC1
  92. PC12 SDMMC1_CK SDMMC1
  93. PD2 SDMMC1_CMD SDMMC1
  94. # More CS pins for more sensors. The labels for all CS pins need to
  95. # match the SPI device table later in this file.
  96. PC13 GYRO_EXT_CS CS
  97. PC14 BARO_EXT_CS CS
  98. PC15 ACCEL_EXT_CS CS
  99. PD7 BARO_CS CS
  100. PE4 MPU_EXT_CS CS
  101. # the first CAN bus
  102. PD0 CAN1_RX CAN1
  103. PD1 CAN1_TX CAN1
  104. # Another USART, this one for telem1. This one has RTS and CTS lines.
  105. # USART2 serial2 telem1
  106. PD3 USART2_CTS USART2
  107. PD4 USART2_RTS USART2
  108. PD5 USART2_TX USART2
  109. PD6 USART2_RX USART2
  110. # The telem2 USART, also with RTS/CTS available.
  111. # USART3 serial3 telem2
  112. PD8 USART3_TX USART3
  113. PD9 USART3_RX USART3
  114. PD11 USART3_CTS USART3
  115. PD12 USART3_RTS USART3
  116. # The CS pin for FRAM (ramtron). This one is marked as using
  117. # SPEED_VERYLOW, which matches the HAL_PX4 setup.
  118. PD10 FRAM_CS CS SPEED_VERYLOW
  119. # Now we start defining some PWM pins. We also map these pins to GPIO
  120. # values, so users can set BRD_PWM_COUNT to choose how many of the PWM
  121. # outputs on the primary MCU are setup as PWM and how many as
  122. # GPIOs. To match HAL_PX4 we number the GPIOs for the PWM outputs
  123. # starting at 50.
  124. PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50)
  125. PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51)
  126. PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52)
  127. PE9 TIM1_CH1 TIM1 PWM(4) GPIO(53)
  128. PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54)
  129. PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55)
  130. define BOARD_PWM_COUNT_DEFAULT 4
  131. # Pin for PWM Voltage Selection
  132. PB4 PWM_VOLT_SEL OUTPUT HIGH GPIO(3)
  133. # Relays default to use GPIO pins 54 and 55.
  134. define RELAY1_PIN_DEFAULT 54
  135. define RELAY2_PIN_DEFAULT 55
  136. # This is the invensense data-ready pin. We don't use it in the
  137. # default driver.
  138. PD15 MPU_DRDY INPUT
  139. # the 2nd GPS UART
  140. # UART8 serial4 GPS2
  141. PE0 UART8_RX UART8
  142. PE1 UART8_TX UART8 NODMA
  143. # Now setup SPI bus4.
  144. PE2 SPI4_SCK SPI4
  145. PE5 SPI4_MISO SPI4
  146. PE6 SPI4_MOSI SPI4
  147. # This is the pin to enable the sensors rail. It can be used to power
  148. # cycle sensors to recover them in case there are problems with power on
  149. # timing affecting sensor stability. We pull it high by default.
  150. PE3 VDD_3V3_SENSORS_EN OUTPUT HIGH
  151. # UART7 maps to uartF in the HAL (serial5 in SERIALn_ parameters).
  152. PE7 UART7_RX UART7
  153. PE8 UART7_TX UART7
  154. # Define a LED, mapping it to GPIO(0). LOW will illuminate the LED
  155. PE12 FMU_LED_AMBER OUTPUT HIGH OPENDRAIN GPIO(0)
  156. # Power flag pins: these tell the MCU the status of the various power
  157. # supplies that are available. The pin names need to exactly match the
  158. # names used in AnalogIn.cpp.
  159. PB5 VDD_BRICK_VALID INPUT PULLUP
  160. PB7 VDD_SERVO_VALID INPUT PULLUP
  161. PE10 VDD_5V_HIPOWER_OC INPUT PULLUP
  162. PE15 VDD_5V_PERIPH_OC INPUT PULLUP
  163. SPIDEV ms5611 SPI1 DEVID3 BARO_CS MODE3 20*MHZ 20*MHZ
  164. SPIDEV ms5611_ext SPI4 DEVID2 BARO_EXT_CS MODE3 20*MHZ 20*MHZ
  165. SPIDEV mpu6000 SPI1 DEVID4 MPU_CS MODE3 2*MHZ 8*MHZ
  166. SPIDEV icm20608-am SPI1 DEVID2 ACCEL_EXT_CS MODE3 4*MHZ 8*MHZ
  167. SPIDEV mpu9250 SPI1 DEVID4 MPU_CS MODE3 4*MHZ 8*MHZ
  168. SPIDEV mpu9250_ext SPI4 DEVID1 MPU_EXT_CS MODE3 4*MHZ 8*MHZ
  169. SPIDEV icm20948 SPI1 DEVID4 MPU_CS MODE3 4*MHZ 8*MHZ
  170. SPIDEV icm20948_ext SPI4 DEVID1 MPU_EXT_CS MODE3 4*MHZ 8*MHZ
  171. SPIDEV hmc5843 SPI1 DEVID5 MAG_CS MODE3 11*MHZ 11*MHZ
  172. SPIDEV lsm9ds0_g SPI1 DEVID1 GYRO_EXT_CS MODE3 11*MHZ 11*MHZ
  173. SPIDEV lsm9ds0_am SPI1 DEVID2 ACCEL_EXT_CS MODE3 11*MHZ 11*MHZ
  174. SPIDEV lsm9ds0_ext_g SPI4 DEVID4 GYRO_EXT_CS MODE3 11*MHZ 11*MHZ
  175. SPIDEV lsm9ds0_ext_am SPI4 DEVID3 ACCEL_EXT_CS MODE3 11*MHZ 11*MHZ
  176. SPIDEV icm20602_ext SPI4 DEVID4 GYRO_EXT_CS MODE3 4*MHZ 8*MHZ
  177. SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ
  178. SPIDEV external0m0 SPI4 DEVID5 MPU_EXT_CS MODE0 2*MHZ 2*MHZ
  179. SPIDEV external0m1 SPI4 DEVID5 MPU_EXT_CS MODE1 2*MHZ 2*MHZ
  180. SPIDEV external0m2 SPI4 DEVID5 MPU_EXT_CS MODE2 2*MHZ 2*MHZ
  181. SPIDEV external0m3 SPI4 DEVID5 MPU_EXT_CS MODE3 2*MHZ 2*MHZ
  182. SPIDEV pixartPC15 SPI4 DEVID13 ACCEL_EXT_CS MODE3 2*MHZ 2*MHZ
  183. # three IMUs, but allow for different varients. First two IMUs are
  184. # isolated, 3rd isn't
  185. IMU Invensense SPI:mpu9250_ext ROTATION_PITCH_180
  186. # the 3 rotations for the LSM9DS0 driver are for the accel, the gyro
  187. # and the H varient of the gyro
  188. IMU LSM9DS0 SPI:lsm9ds0_ext_g SPI:lsm9ds0_ext_am ROTATION_ROLL_180_YAW_270 ROTATION_ROLL_180_YAW_90 ROTATION_ROLL_180_YAW_90
  189. # 3rd non-isolated IMU
  190. IMU Invensense SPI:mpu9250 ROTATION_YAW_270
  191. # alternative IMU set for newer cubes
  192. IMU Invensense SPI:icm20602_ext ROTATION_ROLL_180_YAW_270
  193. IMU Invensensev2 SPI:icm20948_ext ROTATION_PITCH_180
  194. IMU Invensensev2 SPI:icm20948 ROTATION_YAW_270
  195. define HAL_DEFAULT_INS_FAST_SAMPLE 5
  196. # two baros
  197. BARO MS56XX SPI:ms5611_ext
  198. BARO MS56XX SPI:ms5611
  199. # two compasses. First is in the LSM303D
  200. COMPASS LSM303D SPI:lsm9ds0_ext_am ROTATION_YAW_270
  201. # 2nd compass is part of the 2nd invensense IMU
  202. COMPASS AK8963:probe_mpu9250 1 ROTATION_YAW_270
  203. # compass as part of ICM20948 on newer cubes
  204. COMPASS AK09916:probe_ICM20948 0 ROTATION_ROLL_180_YAW_90
  205. # also probe for external compasses
  206. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  207. define HAL_CHIBIOS_ARCH_FMUV3 1
  208. define BOARD_TYPE_DEFAULT 3
  209. # Nnow some defines for logging and terrain data files.
  210. define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
  211. define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
  212. # allow to have have a dedicated safety switch pin
  213. define HAL_HAVE_SAFETY_SWITCH 1
  214. # Enable RAMTROM parameter storage.
  215. define HAL_WITH_RAMTRON 1
  216. # Setup for the possibility of an IMU heater since the pixhawk2 cube has
  217. # an IMU heater.
  218. define HAL_HAVE_IMU_HEATER 1
  219. # Enable FAT filesystem support (needs a microSD defined via SDMMC).
  220. define HAL_OS_FATFS_IO 1
  221. # Enable RTSCTS support. You should define this if you have any UARTs with RTS/CTS pins.
  222. define AP_FEATURE_RTSCTS 1
  223. # Enable SBUS_OUT on IOMCU (if you have an IOMCU).
  224. define AP_FEATURE_SBUS_OUT 1
  225. # Now setup the default battery pins driver analog pins and default
  226. # scaling for the power brick.
  227. define HAL_BATT_VOLT_PIN 14
  228. define HAL_BATT_CURR_PIN 15
  229. define HAL_BATT_VOLT_SCALE 10.1
  230. define HAL_BATT_CURR_SCALE 17.0
  231. define HAL_GPIO_PWM_VOLT_PIN 3
  232. # List of files to put in ROMFS. For fmuv3 we need an IO firmware so
  233. # we can automatically update the IOMCU firmware on boot. The format
  234. # is "ROMFS ROMFS-filename source-filename". Paths are relative to the
  235. # ardupilot root.
  236. ROMFS io_firmware.bin Tools/IO_Firmware/iofirmware_highpolh.bin
  237. DMA_NOSHARE SPI1* SPI4* USART6*