hwdef.dat 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # hw definition file for processing by chibios_pins.py
  2. # for crazyflie2.0 hardware (see bitcraze.io)
  3. # MCU class and specific type
  4. MCU STM32F4xx STM32F405xx
  5. # board ID for firmware load
  6. APJ_BOARD_ID 12
  7. define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_CRAZYFLIE2
  8. # crystal frequency
  9. OSCILLATOR_HZ 8000000
  10. STM32_PLLM_VALUE 8
  11. define STM32_ST_USE_TIMER 5
  12. FLASH_SIZE_KB 1024
  13. # board voltage
  14. STM32_VDD 330U
  15. # use USB for stdout
  16. #STDOUT_SERIAL SD3
  17. #STDOUT_BAUDRATE 57600
  18. # usart2
  19. PA2 USART2_TX USART2 # E_TX2
  20. PA3 USART2_RX USART2 # E_RX2
  21. # external SPI on SPI1
  22. PA5 SPI1_SCK SPI1 # E_SCK
  23. PA6 SPI1_MISO SPI1 # E_MISO
  24. PA7 SPI1_MOSI SPI1 # E_MOSI
  25. # I2C3 is for IMU
  26. PA8 I2C3_SCL I2C3
  27. PC9 I2C3_SDA I2C3
  28. # USB port
  29. PA10 USB_ID INPUT
  30. PA11 OTG_FS_DM OTG1
  31. PA12 OTG_FS_DP OTG1
  32. # stlink/jtag
  33. PA13 JTMS-SWDIO SWD
  34. PA14 JTCK-SWCLK SWD
  35. PA1 TIM2_CH2 TIM2 PWM(1) # front-right
  36. PB11 TIM2_CH4 TIM2 PWM(4) # rear-right
  37. PA15 TIM2_CH1 TIM2 PWM(2) # rear-left
  38. PB9 TIM4_CH4 TIM4 PWM(3) # front-left
  39. PC13 MPU_INT INPUT
  40. PC14 MPU_FSYNC OUTPUT LOW
  41. # LEDs
  42. PD2 LED_BLUE OUTPUT HIGH
  43. PC0 LED_RED_L OUTPUT HIGH
  44. PC1 LED_GREEN_L OUTPUT HIGH
  45. PC2 LED_GREEN_R OUTPUT HIGH
  46. PC3 LED_RED_R OUTPUT HIGH
  47. # misc pins, unused
  48. #PH0 OSC_IN
  49. #PH1 OSC_OUT
  50. #PB2 BOOT1
  51. # PB3 STM_SWO
  52. # CS pins for external SPI devices
  53. PC12 E_CS0 CS
  54. PB4 E_CS1 CS
  55. PB5 E_CS2 CS
  56. PB8 E_CS3 CS
  57. # external I2C on I2C1
  58. PB6 I2C1_SCL I2C1 # E_SCL
  59. PB7 I2C1_SDA I2C1 # E_SCL
  60. # radio setup
  61. PA4 NRF_FLOW_CTRL INPUT # goes low when we can write to uart
  62. #PB13 NRF_SWCLK
  63. #PB15 NRF_SWIO
  64. PC6 USART6_TX USART6 # NRF_RT
  65. PC7 USART6_RX USART6 # NRF_RX
  66. # USART3 for telemetry
  67. PC10 USART3_TX USART3 # E_TX1
  68. PC11 USART3_RX USART3 # E_RX1
  69. # setup I2C order
  70. I2C_ORDER I2C3 I2C1
  71. # we need I2C clock at 400kHz for IMU
  72. define HAL_I2C_MAX_CLOCK 400000
  73. # order of UARTs (and USB)
  74. UART_ORDER OTG1 USART2 USART3 USART6
  75. define HAL_STORAGE_SIZE 15360
  76. define STORAGE_FLASH_PAGE 1
  77. # reserve 32k for bootloader and 32k for flash storage
  78. FLASH_RESERVE_START_KB 64
  79. # one IMU
  80. IMU Invensense I2C:0:0x69 ROTATION_YAW_180
  81. # one baro, attached via I2C on IMU
  82. BARO LPS2XH:probe_InvensenseIMU I2C:0:0x5D 0x69
  83. # no built-in compass, but probe the i2c bus for all possible
  84. # external compass types
  85. define ALLOW_ARM_NO_COMPASS
  86. define HAL_COMPASS_DEFAULT HAL_COMPASS_NONE
  87. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  88. define HAL_I2C_INTERNAL_MASK 0
  89. define HAL_COMPASS_AUTO_ROT_DEFAULT 2
  90. define MAG_BOARD_ORIENTATION ROTATION_YAW_180
  91. # no ADC pins
  92. define HAL_USE_ADC FALSE