hwdef.dat 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. # hw definition file for processing by chibios_hwdef.py
  2. # for VRCOREv10 hardware
  3. define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_VRCORE_V10
  4. # MCU class and specific type
  5. MCU STM32F4xx STM32F407xx
  6. # board ID for firmware load
  7. APJ_BOARD_ID 1910
  8. # crystal frequency
  9. OSCILLATOR_HZ 8000000
  10. STM32_PLLM_VALUE 8
  11. # flash size
  12. FLASH_SIZE_KB 1024
  13. # board voltage
  14. STM32_VDD 330U
  15. # USB setup
  16. USB_VENDOR 0x27AC
  17. USB_PRODUCT 0x1910
  18. USB_STRING_MANUFACTURER "Laser Navigation"
  19. USB_STRING_SERIAL "%SERIAL%"
  20. # ChibiOS system timer
  21. STM32_ST_USE_TIMER 5
  22. # only one I2C bus
  23. I2C_ORDER I2C2 I2C1
  24. # order of UARTs (and USB)
  25. UART_ORDER OTG1 USART1 USART3 USART2
  26. STDOUT_SERIAL SD3
  27. STDOUT_BAUDRATE 57600
  28. PA0 BUZZER OUTPUT LOW GPIO(32)
  29. PA1 TIM2_CH2 TIM2 PWM(1) GPIO(50)
  30. PA2 TIM2_CH3 TIM2 PWM(2) GPIO(51)
  31. PA3 TIM2_CH4 TIM2 PWM(3) GPIO(52)
  32. PA4 SDCARD_CS CS
  33. PA5 SPI1_SCK SPI1
  34. PA6 SPI1_MISO SPI1
  35. PA7 SPI1_MOSI SPI1
  36. #PA8
  37. PA9 VBUS INPUT
  38. #P10
  39. PA11 OTG_FS_DM OTG1
  40. PA12 OTG_FS_DP OTG1
  41. PA13 JTMS-SWDIO SWD
  42. PA14 JTCK-SWCLK SWD
  43. #PA15
  44. PB0 TIM3_CH3 TIM3 PWM(5) GPIO(54)
  45. PB1 TIM3_CH4 TIM3 PWM(6) GPIO(55)
  46. #PB2
  47. PB3 LED_EXT3 OUTPUT GPIO(30)
  48. PB4 LED_EXT4 OUTPUT GPIO(31)
  49. PB5 TIM3_CH2 TIM3 PWM(4) GPIO(53)
  50. PB6 USART1_TX USART1
  51. PB7 USART1_RX USART1
  52. PB8 I2C1_SCL I2C1
  53. PB9 I2C1_SDA I2C1
  54. PB10 I2C2_SCL I2C2
  55. PB11 I2C2_SDA I2C2
  56. #PB12
  57. PB13 SPI2_SCK SPI2
  58. PB14 SPI2_MISO SPI2
  59. PB15 SPI2_MOSI SPI2
  60. PC0 BATT_VOLTAGE_SENS ADC1
  61. PC1 BATT_CURRENT_SENS ADC1
  62. #PC2
  63. #PC3
  64. #PC4
  65. PC5 LED_GREEN OUTPUT GPIO(25)
  66. #PC6
  67. PC7 TIM8_CH2 TIM8 RCIN FLOAT LOW
  68. PC8 RELAY_1 OUTPUT LOW GPIO(33)
  69. PC9 RELAY_2 OUTPUT LOW GPIO(34)
  70. PC10 SPI3_SCK SPI3
  71. PC11 SPI3_MISO SPI3
  72. PC12 SPI3_MOSI SPI3
  73. #PC13
  74. #PC14
  75. #PC15
  76. #PD0
  77. #PD1
  78. #PD2
  79. #PD3
  80. #PD4
  81. PD5 USART2_TX USART2
  82. PD6 USART2_RX USART2
  83. PD7 SBUS_INV OUTPUT
  84. PD8 USART3_TX USART3
  85. PD9 USART3_RX USART3
  86. #PD10
  87. #PD11
  88. PD12 TIM4_CH1 TIM4 PWM(8) GPIO(57)
  89. PD13 TIM4_CH2 TIM4 PWM(7) GPIO(56)
  90. PD15 LED_RED OUTPUT GPIO(27)
  91. PD14 LED_BLUE OUTPUT GPIO(26)
  92. PE0 BARO_CS CS
  93. #PE1
  94. PE2 LED_EXT1 OUTPUT GPIO(29)
  95. PE3 LED_EXT2 OUTPUT GPIO(28)
  96. PE4 RELAY_3 OUTPUT LOW GPIO(35)
  97. #PE5 TIM9_CH1 TIM9 PWM(13) GPIO(62)
  98. #PE6 TIM9_CH2 TIM9 PWM(14) GPIO(63)
  99. #PE7
  100. #PE8
  101. PE9 TIM1_CH1 TIM1 PWM(9) GPIO(58)
  102. PE10 MPU_CS CS
  103. PE11 TIM1_CH2 TIM1 PWM(10) GPIO(59)
  104. #PE12
  105. PE13 TIM1_CH3 TIM1 PWM(11) GPIO(60)
  106. PE14 TIM1_CH4 TIM1 PWM(12) GPIO(61)
  107. PE15 FRAM_CS CS
  108. # SPI device table. The DEVID values are chosen to match the PX4 port
  109. # of ArduPilot so users don't need to re-do their accel and compass calibrations
  110. # when moving to ChibiOS
  111. SPIDEV ms5611 SPI1 DEVID3 BARO_CS MODE3 20*MHZ 20*MHZ
  112. SPIDEV mpu9250 SPI2 DEVID4 MPU_CS MODE3 4*MHZ 8*MHZ
  113. SPIDEV ramtron SPI3 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ
  114. SPIDEV sdcard SPI3 DEVID1 SDCARD_CS MODE0 400*KHZ 25*MHZ
  115. define HAL_CHIBIOS_ARCH_COREV10 1
  116. define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
  117. define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
  118. define HAL_STORAGE_SIZE 16384
  119. define STORAGE_FLASH_PAGE 22
  120. # enable RAMTROM parameter storage
  121. define HAL_WITH_RAMTRON 1
  122. # enable FAT filesystem
  123. define HAL_OS_FATFS_IO 1
  124. define HAL_GPIO_LED_ON 0
  125. define HAL_GPIO_LED_OFF 1
  126. define HAL_GPIO_A_LED_PIN 25
  127. define HAL_GPIO_B_LED_PIN 26
  128. define HAL_GPIO_C_LED_PIN 27
  129. define EXTERNAL_LED_GPS 28
  130. define EXTERNAL_LED_ARMED 29
  131. define EXTERNAL_LED_MOTOR1 30
  132. define EXTERNAL_LED_MOTOR2 31
  133. define RELAY1_PIN_DEFAULT 33
  134. define RELAY2_PIN_DEFAULT 34
  135. define RELAY3_PIN_DEFAULT 35
  136. define HAL_BUZZER_PIN 32
  137. define HAL_BUZZER_ON 1
  138. define HAL_BUZZER_OFF 0
  139. # battery setup
  140. define HAL_BATT_VOLT_PIN 10
  141. define HAL_BATT_CURR_PIN 11
  142. define HAL_BATT_VOLT_SCALE 10.1
  143. define HAL_BATT_CURR_SCALE 17.0
  144. define STM32_PWM_USE_ADVANCED TRUE
  145. # 12 PWM available by default
  146. define BOARD_PWM_COUNT_DEFAULT 14