hwdef.dat 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. # hw definition file for processing by chibios_hwdef.py
  2. # for MindPX-v2 hardware
  3. # MCU class and specific type
  4. MCU STM32F4xx STM32F427xx
  5. define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_MINDPXV2
  6. # board ID for firmware load
  7. APJ_BOARD_ID 88
  8. # crystal frequency
  9. OSCILLATOR_HZ 8000000
  10. STM32_PLLM_VALUE 8
  11. STM32_ST_USE_TIMER 5
  12. # board voltage
  13. STM32_VDD 330U
  14. # flash size
  15. FLASH_SIZE_KB 2048
  16. # space to reserve for bootloader and storage at start of flash
  17. FLASH_RESERVE_START_KB 16
  18. # space to reserve for storage at end of flash
  19. FLASH_RESERVE_END_KB 0
  20. # serial port for stdout disabled, uses USB instead
  21. # STDOUT_SERIAL SD7
  22. # STDOUT_BAUDRATE 57600
  23. # order of I2C buses
  24. I2C_ORDER I2C1 I2C2
  25. # order of UARTs (and USB)
  26. UART_ORDER OTG1 UART4 USART2 USART3 UART8 USART1 UART7
  27. # UART4 is GPS
  28. PA0 UART4_TX UART4
  29. PA1 UART4_RX UART4
  30. PA4 VDD_5V_SENS ADC1 SCALE(2)
  31. # SPI1 is fram bus
  32. PA5 SPI1_SCK SPI1
  33. PA6 SPI1_MISO SPI1
  34. # Timers 1-4 are used for (servo) PWM outputs and 5/6 are used for clocks
  35. # Use Timer 14 for tone generation
  36. PA7 TIM14_CH1 TIM14 GPIO(32) ALARM
  37. PA8 RUN_LED OUTPUT GPIO(0)
  38. PA9 VBUS INPUT
  39. PA10 SBUS_INV OUTPUT
  40. PA11 OTG_FS_DM OTG1
  41. PA12 OTG_FS_DP OTG1
  42. PA13 JTMS-SWDIO SWD
  43. PA14 JTCK-SWCLK SWD
  44. # PWM outputs
  45. PE9 TIM1_CH1 TIM1 PWM(1)
  46. PE11 TIM1_CH2 TIM1 PWM(2)
  47. PE13 TIM1_CH3 TIM1 PWM(3)
  48. PE14 TIM1_CH4 TIM1 PWM(4)
  49. PD12 TIM4_CH1 TIM4 PWM(5)
  50. PD13 TIM4_CH2 TIM4 PWM(6)
  51. PD14 TIM4_CH3 TIM4 PWM(7)
  52. PD15 TIM4_CH4 TIM4 PWM(8)
  53. PB4 TIM3_CH1 TIM3 PWM(9) GPIO(50)
  54. PC7 TIM3_CH2 TIM3 PWM(10) GPIO(51)
  55. PB0 TIM3_CH3 TIM3 PWM(11) GPIO(52)
  56. PB1 TIM3_CH4 TIM3 PWM(12) GPIO(53)
  57. PA15 TIM2_CH1 TIM2 PWM(13) GPIO(54)
  58. PB3 TIM2_CH2 TIM2 PWM(14) GPIO(55)
  59. PA2 TIM2_CH3 TIM2 PWM(15)
  60. PA3 TIM2_CH4 TIM2 PWM(16)
  61. PB2 GYRO_CS CS
  62. PB5 SPI1_MOSI SPI1
  63. # USART1 is SBUS
  64. PB6 USART1_TX USART1
  65. PB7 USART1_RX USART1
  66. # I2C1 is mag I2C
  67. PB8 I2C1_SCL I2C1
  68. PB9 I2C1_SDA I2C1
  69. # I2C2 is FMU I2C
  70. PB10 I2C2_SCL I2C2
  71. PB11 I2C2_SDA I2C2
  72. # SPI2 is external SPI (radio NRF)
  73. PB13 SPI2_SCK SPI2
  74. PB14 SPI2_MISO SPI2
  75. PB15 SPI2_MOSI SPI2
  76. PC0 BAT_CURR_SENS ADC1
  77. PC1 FMU_GPIO3 INPUT # RSSI
  78. PC2 BAT_VOLT_SENS ADC1
  79. PC3 FMU_ADC1 ADC1
  80. PC4 FMU_ADC2 ADC1
  81. PC5 FMU_ADC3 ADC1
  82. PC6 TIM8_CH1 TIM8 RCIN PULLDOWN LOW # also USART6_RX for serial RC
  83. PC8 SDIO_D0 SDIO
  84. PC9 SDIO_D1 SDIO
  85. PC10 SDIO_D2 SDIO
  86. PC11 SDIO_D3 SDIO
  87. PC12 SDIO_CK SDIO
  88. PC13 ACCEL_DRDY INPUT
  89. PC14 MAG_DRDY INPUT
  90. PC15 BARO_CS CS
  91. PD0 CAN1_RX CAN1
  92. PD1 CAN1_TX CAN1
  93. PD2 SDIO_CMD SDIO
  94. # USART2 serial2 telem1
  95. PD3 USART2_CTS USART2
  96. PD4 USART2_RTS USART2
  97. PD5 USART2_TX USART2
  98. PD6 USART2_RX USART2
  99. PD7 NRF_CSN INPUT
  100. # USART3 serial3 telem2
  101. PD8 USART3_TX USART3
  102. PD9 USART3_RX USART3
  103. PD10 NRF_INT INPUT
  104. PD11 ACCEL_MAG_CS CS
  105. # UART8 is FrSky
  106. PE0 UART8_RX UART8
  107. PE1 UART8_TX UART8
  108. # allow this uart to be inverted for transmit under user control
  109. # the polarity is the value to use on the GPIO to change the polarity
  110. # to the opposite of the default
  111. PB12 UART8_TXINV OUTPUT HIGH GPIO(78) POL(0)
  112. # SPI4 is M_SPI (main sensors)
  113. PE2 SPI4_SCK SPI4
  114. PE3 MPU_CS CS
  115. PE4 GYRO_DRDY INPUT
  116. PE5 SPI4_MISO SPI4
  117. PE6 SPI4_MOSI SPI4
  118. # UART7 is debug
  119. PE7 UART7_RX UART7
  120. PE8 UART7_TX UART7
  121. PE10 MPU_DRDY INPUT
  122. PE12 FRAM_CS CS
  123. PE15 NRF_CS CS
  124. # SPI device table
  125. SPIDEV ms5611 SPI4 DEVID1 BARO_CS MODE3 2*MHZ 2*MHZ
  126. SPIDEV mpu6500 SPI4 DEVID2 MPU_CS MODE3 500*KHZ 4*MHZ
  127. SPIDEV lsm9ds0_am SPI4 DEVID3 ACCEL_MAG_CS MODE3 11*MHZ 11*MHZ
  128. SPIDEV lsm9ds0_g SPI4 DEVID4 GYRO_CS MODE3 11*MHZ 11*MHZ
  129. SPIDEV ramtron SPI1 DEVID5 FRAM_CS MODE3 8*MHZ 8*MHZ
  130. SPIDEV radio SPI2 DEVID6 NRF_CS MODE3 2*MHZ 2*MHZ
  131. # two IMUs
  132. IMU Invensense SPI:mpu6500 ROTATION_NONE
  133. IMU LSM9DS0 SPI:lsm9ds0_g SPI:lsm9ds0_am ROTATION_YAW_90 ROTATION_YAW_90 ROTATION_YAW_90
  134. # one baro
  135. BARO MS56XX SPI:ms5611
  136. # two compasses
  137. COMPASS HMC5843 I2C:0:0x1e false ROTATION_YAW_90
  138. COMPASS LSM303D SPI:lsm9ds0_am ROTATION_PITCH_180_YAW_270
  139. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  140. define HAL_CHIBIOS_ARCH_MINDPXV2 1
  141. define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
  142. define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
  143. define HAL_STORAGE_SIZE 16384
  144. # enable RAMTROM parameter storage
  145. define HAL_WITH_RAMTRON 1
  146. # fallback to flash storage
  147. define STORAGE_FLASH_PAGE 22
  148. # allow to have have a dedicated safety switch pin
  149. define HAL_HAVE_SAFETY_SWITCH 1
  150. # enable FAT filesystem
  151. define HAL_OS_FATFS_IO 1
  152. # enable RTSCTS
  153. define AP_FEATURE_RTSCTS 1
  154. # battery setup
  155. define HAL_BATT_VOLT_PIN 12
  156. define HAL_BATT_CURR_PIN 10
  157. define HAL_BATT_VOLT_SCALE 10.1
  158. define HAL_BATT_CURR_SCALE 17.0
  159. # 12 PWM available by default
  160. define BOARD_PWM_COUNT_DEFAULT 12