hwdef.dat 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. # hw definition file for processing by chibios_pins.py
  2. # MCU class and specific type
  3. # MCU class and specific type
  4. MCU STM32F4xx STM32F412Rx
  5. # bootloader starts firmware at 64k
  6. FLASH_RESERVE_START_KB 64
  7. # store parameters in pages 2 and 3
  8. define STORAGE_FLASH_PAGE 2
  9. define HAL_STORAGE_SIZE 8192
  10. # board ID for firmware load
  11. APJ_BOARD_ID 1001
  12. # setup build for a peripheral firmware
  13. env AP_PERIPH 1
  14. STM32_ST_USE_TIMER 5
  15. # crystal frequency
  16. OSCILLATOR_HZ 16000000
  17. STM32_HSE_ENABLED TRUE
  18. STM32_PLLM_VALUE 16
  19. STM32_PLLN_VALUE 384
  20. STM32_PLLP_VALUE 4
  21. STM32_PLLQ_VALUE 8
  22. STM32_PLLSRC STM32_PLLSRC_HSE
  23. STM32_PREE1 STM32_PREE1_DIV1
  24. STM32_PREE2 STM32_PREE2_DIV1
  25. STM32_HPRE STM32_HPRE_DIV1
  26. STM32_PPRE1 STM32_PPRE1_DIV2
  27. STM32_PPRE2 STM32_PPRE2_DIV2
  28. define CH_CFG_ST_FREQUENCY 1000000
  29. # assume 512k flash part
  30. FLASH_SIZE_KB 512
  31. STDOUT_SERIAL SD1
  32. STDOUT_BAUDRATE 57600
  33. # board voltage
  34. STM32_VDD 330U
  35. # order of UARTs
  36. UART_ORDER USART1 USART2
  37. # a LED to flash
  38. PB12 LED OUTPUT LOW
  39. # USART1 for debug
  40. PB6 USART1_TX USART1 NODMA
  41. PB7 USART1_RX USART1 NODMA
  42. define HAL_SERIAL0_BAUD_DEFAULT 57600
  43. # USART2 for GPS
  44. PA2 USART2_TX USART2 NODMA
  45. PA3 USART2_RX USART2 NODMA
  46. # SWD debugging
  47. PA13 JTMS-SWDIO SWD
  48. PA14 JTCK-SWCLK SWD
  49. # only one I2C bus in normal config
  50. PB4 I2C3_SDA I2C3
  51. PA8 I2C3_SCL I2C3
  52. define HAL_USE_I2C TRUE
  53. define STM32_I2C_USE_I2C3 TRUE
  54. define HAL_I2C_CLEAR_ON_TIMEOUT 0
  55. define HAL_I2C_INTERNAL_MASK 0
  56. # only one I2C bus
  57. I2C_ORDER I2C3
  58. # IST compass
  59. COMPASS IST8310 I2C:0:0x0E false ROTATION_ROLL_180_YAW_90
  60. # BMP388 baro
  61. BARO BMP388 I2C:0:0x76
  62. # PWM output for buzzer
  63. PB10 TIM2_CH3 TIM2 GPIO(77) LOW ALARM
  64. # safety LED, active low
  65. PB1 SAFE_LED OUTPUT HIGH
  66. define SAFE_LED_ON 0
  67. # safety button
  68. PB3 SAFE_BUTTON INPUT PULLDOWN
  69. # WS2812 LED
  70. PB0 TIM3_CH3 TIM3 PWM(1)
  71. define HAL_BARO_ALLOW_INIT_NO_BARO
  72. define HAL_USE_ADC FALSE
  73. define STM32_ADC_USE_ADC1 FALSE
  74. define HAL_DISABLE_ADC_DRIVER TRUE
  75. define HAL_NO_GPIO_IRQ
  76. # avoid RCIN thread to save memory
  77. define HAL_NO_RCIN_THREAD
  78. define HAL_USE_RTC FALSE
  79. define DISABLE_SERIAL_ESC_COMM TRUE
  80. define NO_DATAFLASH TRUE
  81. define DMA_RESERVE_SIZE 0
  82. define PERIPH_FW TRUE
  83. define HAL_DISABLE_LOOP_DELAY
  84. # enable CAN support
  85. PB8 CAN1_RX CAN1
  86. PB9 CAN1_TX CAN1
  87. PB5 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW
  88. define HAL_USE_CAN TRUE
  89. define STM32_CAN_USE_CAN1 TRUE
  90. # start with a fixed node ID so the board is usable without DNA
  91. define HAL_CAN_DEFAULT_NODE_ID 116
  92. define CAN_APP_VERSION_MAJOR 1
  93. define CAN_APP_VERSION_MINOR 0
  94. define CAN_APP_NODE_NAME "org.ardupilot.cuav_gps"
  95. define HAL_NO_ROMFS_SUPPORT
  96. define CH_DBG_ENABLE_STACK_CHECK TRUE
  97. define HAL_NO_GCS
  98. define HAL_NO_LOGGING
  99. define HAL_NO_MONITOR_THREAD
  100. define HAL_MINIMIZE_FEATURES 0
  101. define HAL_BUILD_AP_PERIPH
  102. define HAL_DEVICE_THREAD_STACK 768
  103. define AP_PARAM_MAX_EMBEDDED_PARAM 0
  104. # disable dual GPS and GPS blending to save flash space
  105. define GPS_MAX_RECEIVERS 1
  106. define GPS_MAX_INSTANCES 1
  107. # GPS+MAG+BARO+Buzzer+NeoPixels
  108. define HAL_PERIPH_ENABLE_GPS
  109. define HAL_PERIPH_ENABLE_MAG
  110. define HAL_PERIPH_ENABLE_BARO
  111. define HAL_PERIPH_ENABLE_BUZZER
  112. define HAL_PERIPH_NEOPIXEL_COUNT 8
  113. define HAL_PERIPH_NEOPIXEL_CHAN 0