hwdef-bl.dat 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # hw definition file for processing by chibios_pins.py
  2. # MCU class and specific type
  3. MCU STM32F103 STM32F103xB
  4. FLASH_RESERVE_START_KB 0
  5. FLASH_BOOTLOADER_LOAD_KB 25
  6. # board ID for firmware load
  7. APJ_BOARD_ID 1000
  8. # setup build for a peripheral firmware
  9. env AP_PERIPH 1
  10. # crystal frequency
  11. OSCILLATOR_HZ 8000000
  12. define STM32_SW STM32_SW_PLL
  13. define STM32_PLLSRC STM32_PLLSRC_HSE
  14. define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
  15. define STM32_PLLMUL_VALUE 9
  16. define STM32_PPRE1 STM32_PPRE1_DIV2
  17. define STM32_PPRE2 STM32_PPRE2_DIV2
  18. define STM32_ADCPRE STM32_ADCPRE_DIV4
  19. define CH_CFG_ST_FREQUENCY 1000
  20. # assume 128k flash part
  21. FLASH_SIZE_KB 128
  22. STDOUT_SERIAL SD1
  23. STDOUT_BAUDRATE 57600
  24. # board voltage
  25. STM32_VDD 330U
  26. # order of UARTs
  27. UART_ORDER
  28. define HAL_USE_UART FALSE
  29. PA4 LED_BOOTLOADER OUTPUT LOW
  30. define HAL_LED_ON 1
  31. # USART1
  32. PA9 USART1_TX USART1 SPEED_HIGH
  33. PA10 USART1_RX USART1 SPEED_HIGH
  34. # USART2
  35. PA2 USART2_TX USART2 SPEED_HIGH
  36. PA3 USART2_RX USART2 SPEED_HIGH
  37. define HAL_USE_SERIAL TRUE
  38. define STM32_SERIAL_USE_USART1 TRUE
  39. define STM32_SERIAL_USE_USART2 TRUE
  40. define STM32_SERIAL_USE_USART3 FALSE
  41. define HAL_NO_GPIO_IRQ
  42. define CH_CFG_ST_TIMEDELTA 0
  43. #define CH_CFG_USE_DYNAMIC FALSE
  44. define SERIAL_BUFFERS_SIZE 32
  45. define HAL_USE_EMPTY_IO TRUE
  46. define PORT_INT_REQUIRED_STACK 64
  47. # avoid timer and RCIN threads to save memory
  48. define HAL_NO_TIMER_THREAD
  49. define HAL_NO_RCIN_THREAD
  50. #defined to turn off undef warnings
  51. define __FPU_PRESENT 0
  52. define HAL_USE_RTC FALSE
  53. define DISABLE_SERIAL_ESC_COMM TRUE
  54. define NO_DATAFLASH TRUE
  55. define DMA_RESERVE_SIZE 0
  56. define PERIPH_FW TRUE
  57. MAIN_STACK 0x800
  58. PROCESS_STACK 0x800
  59. define HAL_DISABLE_LOOP_DELAY
  60. define HAL_USE_EMPTY_STORAGE 1
  61. define HAL_STORAGE_SIZE 16384
  62. # enable CAN support
  63. PA11 CAN_RX CAN
  64. PA12 CAN_TX CAN
  65. define HAL_USE_CAN TRUE
  66. define STM32_CAN_USE_CAN1 TRUE
  67. define CAN_APP_VERSION_MAJOR 1
  68. define CAN_APP_VERSION_MINOR 0
  69. define CAN_APP_NODE_NAME "org.ardupilot.ap_periph"
  70. # start with a fixed node ID so the board is usable without DNA
  71. define HAL_CAN_DEFAULT_NODE_ID 117
  72. # make bl baudrate match debug baudrate for easier debugging
  73. define BOOTLOADER_BAUDRATE 57600
  74. # use a small bootloader timeout
  75. define HAL_BOOTLOADER_TIMEOUT 1000
  76. # use PB6 (normally I2C1_SCL) as "hold in bootloader" pin
  77. # this has a hw pullup, so if we set it as input floating
  78. # and look for it low then we know user has pulled it down and
  79. # want to stay in the bootloader
  80. PB6 STAY_IN_BOOTLOADER INPUT FLOATING