hwdef.dat 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # hw definition file for processing by chibios_pins.py
  2. # new SkyViper 2018 Journey
  3. MCU STM32F4xx STM32F412Rx
  4. # board ID for firmware load
  5. APJ_BOARD_ID 9
  6. # crystal frequency
  7. OSCILLATOR_HZ 24000000
  8. STM32_HSE_ENABLED FALSE
  9. STM32_PLLM_VALUE 16
  10. STM32_PLLN_VALUE 384
  11. STM32_PLLP_VALUE 4
  12. STM32_PLLQ_VALUE 8
  13. STM32_PLLSRC STM32_PLLSRC_HSI
  14. STM32_PREE1 STM32_PREE1_DIV2
  15. STM32_PREE2 STM32_PREE2_DIV1
  16. STM32_PWM_USE_TIM3 TRUE
  17. # board voltage
  18. STM32_VDD 330U
  19. # flash size
  20. FLASH_SIZE_KB 1024
  21. # serial port for stdout
  22. STDOUT_SERIAL SD1
  23. STDOUT_BAUDRATE 115200
  24. # order of I2C buses
  25. I2C_ORDER I2C2 I2C1
  26. # we need I2C clock at 400kHz for IMU
  27. define HAL_I2C_MAX_CLOCK 400000
  28. # run I2C bus thread at high priority for IMU
  29. define APM_I2C_PRIORITY 181
  30. # order of UARTs
  31. UART_ORDER USART1 USART6 USART2
  32. PC0 MGND ADC1
  33. PC1 PWM4_SENSE ADC1
  34. PC2 PWM2_SENSE ADC1
  35. PC3 PWM1_SENSE ADC1
  36. PA0 PWM3_SENSE ADC1
  37. # USART2 is for sonix
  38. PA2 USART2_TX USART2
  39. PA3 USART2_RX USART2
  40. # SPI1 is radio
  41. PA4 RADIO_CS CS
  42. PA5 SPI1_SCK SPI1
  43. PA6 SPI1_MISO SPI1
  44. PA7 SPI1_MOSI SPI1
  45. PC4 RADIO_CE OUTPUT
  46. PC5 RADIO_PA_CTL OUTPUT
  47. PB0 RADIO_IRQ INPUT GPIO(100)
  48. PB1 BATT_MON ADC1 SCALE(11)
  49. PB2 BOOT1 INPUT
  50. PB10 I2C2_SCL I2C2
  51. PA13 JTMS-SWDIO SWD
  52. PA14 JTCK-SWCLK SWD
  53. PB9 I2C1_SDA I2C1
  54. PB8 I2C1_SCL I2C1
  55. PB7 LEDF OUTPUT HIGH GPIO(0)
  56. PB6 LEDR OUTPUT HIGH GPIO(1)
  57. PB5 TIM3_CH2 TIM3 PWM(2) # marked CN15 front-right
  58. PB3 I2C2_SDA I2C2
  59. PD2 OF_MOTION INPUT
  60. PB4 OF_RESET OUTPUT HIGH
  61. # USART6 is for GPS
  62. PA11 USART6_TX USART6
  63. PC7 USART6_RX USART6
  64. # USART1 is for debug console
  65. PA10 USART1_RX USART1
  66. PA9 USART1_TX USART1
  67. PC9 TIM3_CH4 TIM3 PWM(4) # marked CN17, rear-right
  68. PC8 TIM3_CH3 TIM3 PWM(3) # marked CN13, rear-left
  69. PC6 TIM3_CH1 TIM3 PWM(1) # marked CN3, front-left
  70. # SPI2 is optical flow
  71. PB15 SPI2_MOSI SPI2
  72. PB14 SPI2_MISO SPI2
  73. PB13 SPI2_SCK SPI2
  74. PB12 FLOW_CS CS
  75. # SPI Device table
  76. SPIDEV cypress SPI1 DEVID1 RADIO_CS MODE0 2*MHZ 2*MHZ
  77. SPIDEV cc2500 SPI1 DEVID1 RADIO_CS MODE0 4*MHZ 4*MHZ
  78. SPIDEV pixartflow SPI2 DEVID2 FLOW_CS MODE3 2*MHZ 2*MHZ
  79. # reserve 16k for bootloader and 32k for storage
  80. FLASH_RESERVE_START_KB 48
  81. define HAL_CHIBIOS_ARCH_F412 1
  82. IMU Invensense I2C:1:0x68 ROTATION_NONE
  83. # radio IRQ is on GPIO(100)
  84. define HAL_GPIO_RADIO_IRQ 100
  85. define HAL_RCINPUT_WITH_AP_RADIO 1
  86. define STORAGE_FLASH_PAGE 1
  87. define HAL_STORAGE_SIZE 15360
  88. # setup defines for ArduCopter config
  89. define TOY_MODE_ENABLED ENABLED
  90. define ARMING_DELAY_SEC 0
  91. define LAND_START_ALT 700
  92. define LAND_DETECTOR_ACCEL_MAX 2.0f
  93. define ALLOW_ARM_NO_COMPASS
  94. define CHIBIOS_ADC_MAVLINK_DEBUG 1
  95. COMPASS BMM150 I2C:0:0x10 ROTATION_NONE
  96. define HAL_BARO_DEFAULT HAL_BARO_20789_I2C_I2C
  97. define HAL_BARO_20789_I2C_BUS 1
  98. define HAL_BARO_20789_I2C_ADDR_PRESS 0x63
  99. define HAL_BARO_20789_I2C_ADDR_ICM 0x68
  100. # unstick 20789 on I2C on boot
  101. define HAL_I2C_CLEAR_BUS
  102. env DEFINES CONFIG_HAL_BOARD_SUBTYPE='HAL_BOARD_SUBTYPE_CHIBIOS_SKYVIPER_F412'
  103. # the web UI uses an abin file for firmware uploads
  104. env BUILD_ABIN True