hwdef.dat 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. # hw definition file for processing by chibios_pins.py
  2. # MCU class and specific type
  3. MCU STM32F103 STM32F103xB
  4. # bootloader starts firmware at 25k
  5. FLASH_RESERVE_START_KB 25
  6. # store parameters in pages 23 and 24
  7. define STORAGE_FLASH_PAGE 23
  8. define HAL_STORAGE_SIZE 800
  9. # board ID for firmware load
  10. APJ_BOARD_ID 1000
  11. # setup build for a peripheral firmware
  12. env AP_PERIPH 1
  13. # crystal frequency
  14. OSCILLATOR_HZ 8000000
  15. define CH_CFG_ST_FREQUENCY 1000
  16. # assume the 128k flash part for now
  17. FLASH_SIZE_KB 128
  18. # board voltage
  19. STM32_VDD 330U
  20. # order of UARTs
  21. UART_ORDER USART2 USART1
  22. # a LED to flash
  23. PA4 LED OUTPUT LOW
  24. # USART1, connected to GPS
  25. PA9 USART1_TX USART1 SPEED_HIGH NODMA
  26. PA10 USART1_RX USART1 SPEED_HIGH NODMA
  27. # USART2 for debug
  28. PA2 USART2_TX USART2 SPEED_HIGH NODMA
  29. PA3 USART2_RX USART2 SPEED_HIGH NODMA
  30. define HAL_UART_NODMA
  31. # only one I2C bus in normal config
  32. PB6 I2C1_SCL I2C1
  33. PB7 I2C1_SDA I2C1
  34. PB0 MAG_CS CS
  35. # spi bus for compass
  36. PA5 SPI1_SCK SPI1
  37. PA6 SPI1_MISO SPI1
  38. PA7 SPI1_MOSI SPI1
  39. SPIDEV rm3100 SPI1 DEVID1 MAG_CS MODE0 1*MHZ 1*MHZ
  40. # analog input
  41. # PA5 VIN5 ADC1
  42. define HAL_USE_ADC TRUE
  43. define STM32_ADC_USE_ADC1 TRUE
  44. define HAL_DISABLE_ADC_DRIVER TRUE
  45. define HAL_NO_GPIO_IRQ
  46. define CH_CFG_ST_TIMEDELTA 0
  47. #define CH_CFG_USE_DYNAMIC FALSE
  48. define SERIAL_BUFFERS_SIZE 512
  49. define PORT_INT_REQUIRED_STACK 64
  50. # avoid timer and RCIN threads to save memory
  51. define HAL_NO_TIMER_THREAD
  52. define HAL_NO_RCIN_THREAD
  53. #defined to turn off undef warnings
  54. define __FPU_PRESENT 0
  55. define HAL_USE_RTC FALSE
  56. define DISABLE_SERIAL_ESC_COMM TRUE
  57. define NO_DATAFLASH TRUE
  58. define DMA_RESERVE_SIZE 0
  59. define PERIPH_FW TRUE
  60. # MAIN_STACK is stack of initial thread
  61. MAIN_STACK 0x100
  62. # PROCESS_STACK controls stack for main thread
  63. PROCESS_STACK 0x600
  64. define HAL_DISABLE_LOOP_DELAY
  65. # enable CAN support
  66. PA11 CAN_RX CAN
  67. PA12 CAN_TX CAN
  68. define HAL_USE_CAN TRUE
  69. define STM32_CAN_USE_CAN1 TRUE
  70. # start with a fixed node ID so the board is usable without DNA
  71. define HAL_CAN_DEFAULT_NODE_ID 117
  72. define CAN_APP_VERSION_MAJOR 1
  73. define CAN_APP_VERSION_MINOR 0
  74. define CAN_APP_NODE_NAME "org.ardupilot.ap_periph"
  75. define HAL_USE_I2C TRUE
  76. define STM32_I2C_USE_I2C1 TRUE
  77. define HAL_NO_ROMFS_SUPPORT
  78. define HAL_UART_MIN_TX_SIZE 256
  79. define HAL_UART_MIN_RX_SIZE 128
  80. define CH_DBG_ENABLE_STACK_CHECK TRUE
  81. define HAL_UART_STACK_SIZE 256
  82. define STORAGE_THD_WA_SIZE 512
  83. define HAL_NO_GCS
  84. define HAL_NO_LOGGING
  85. define HAL_NO_MONITOR_THREAD
  86. define HAL_MINIMIZE_FEATURES 0
  87. define HAL_BUILD_AP_PERIPH
  88. # only one I2C bus
  89. I2C_ORDER I2C1
  90. COMPASS RM3100 SPI:rm3100 false ROTATION_NONE
  91. define HAL_I2C_CLEAR_ON_TIMEOUT 0
  92. define HAL_DEVICE_THREAD_STACK 768
  93. define AP_PARAM_MAX_EMBEDDED_PARAM 0
  94. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  95. define HAL_I2C_INTERNAL_MASK 0
  96. # disable dual GPS and GPS blending to save flash space
  97. define GPS_MAX_RECEIVERS 1
  98. define GPS_MAX_INSTANCES 1
  99. # GPS+MAG
  100. define HAL_PERIPH_ENABLE_GPS
  101. define HAL_PERIPH_ENABLE_MAG