pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

pastebin private pastebin - collaborative debugging tool What's a private pastebin?

Posted by Anonymous on Thu 31 Dec 19:07
download | new post

  1. # hw definition file for processing by chibios_pins.py
  2. # MCU class and specific type
  3.  
  4. # MCU class and specific type
  5. MCU STM32F4xx STM32F427xx
  6.  
  7. # crystal frequency
  8. OSCILLATOR_HZ 24000000
  9.  
  10. # flash size
  11. FLASH_SIZE_KB 2048
  12.  
  13. STM32_ST_USE_TIMER 5
  14.  
  15. # bootloader starts firmware at 64k
  16. FLASH_RESERVE_START_KB 64
  17.  
  18. # store parameters in pages 2 and 3
  19. define STORAGE_FLASH_PAGE 2
  20. define HAL_STORAGE_SIZE 16384
  21.  
  22. # board ID for firmware load
  23. APJ_BOARD_ID 1402
  24.  
  25. # setup build for a peripheral firmware
  26. env AP_PERIPH 1
  27.  
  28. define PERIPH_FW TRUE
  29.  
  30. define HAL_BUILD_AP_PERIPH
  31.  
  32. define HAL_SUPPORT_RCOUT_SERIAL 0
  33.  
  34. # use the app descriptor needed by MissionPlanner for CAN upload
  35. env APP_DESCRIPTOR MissionPlanner
  36.  
  37. # disable dual GPS and GPS blending to save flash space
  38. define GPS_MAX_RECEIVERS 1
  39. define GPS_MAX_INSTANCES 1
  40. define HAL_COMPASS_MAX_SENSORS 1
  41.  
  42. define HAL_NO_GCS
  43. define HAL_NO_LOGGING
  44. define HAL_NO_MONITOR_THREAD
  45.  
  46. define HAL_DISABLE_LOOP_DELAY
  47.  
  48. define HAL_USE_RTC FALSE
  49. define DISABLE_SERIAL_ESC_COMM TRUE
  50. define NO_DATAFLASH TRUE
  51.  
  52. define HAL_NO_RCIN_THREAD
  53.  
  54. define HAL_BARO_ALLOW_INIT_NO_BARO
  55.  
  56. define HAL_USE_ADC TRUE
  57. define STM32_ADC_USE_ADC1 TRUE
  58. define HAL_DISABLE_ADC_DRIVER FALSE
  59.  
  60. define HAL_CAN_DEFAULT_NODE_ID 0
  61.  
  62. define CAN_APP_NODE_NAME "org.ardupilot.Pixracer_periph"
  63.  
  64. # reserve 256 bytes for comms between app and bootloader
  65. RAM_RESERVE_START 256
  66.  
  67. env DISABLE_SCRIPTING 1
  68.  
  69. MAIN_STACK 0x2000
  70. PROCESS_STACK 0x6000
  71.  
  72. # listen for reboot command from uploader.py script
  73. # undefine to disable. Use -1 to allow on all ports, otherwise serial number index defined in SERIAL_ORDER starting at 0
  74. define HAL_PERIPH_LISTEN_FOR_SERIAL_UART_REBOOT_CMD_PORT 0
  75.  
  76. # default to all pins low to avoid ESD issues
  77. DEFAULTGPIO OUTPUT LOW PULLDOWN
  78.  
  79. # --------- Peripherals -----------
  80. define HAL_PERIPH_ENABLE_ADSB
  81. define HAL_PERIPH_ADSB_PORT_DEFAULT 2
  82.  
  83. define HAL_PERIPH_ENABLE_AIRSPEED
  84. define HAL_AIRSPEED_BUS_DEFAULT 0
  85. define AIRSPEED_MAX_SENSORS 1
  86.  
  87. define HAL_PERIPH_ENABLE_GPS
  88. define HAL_PERIPH_GPS_PORT_DEFAULT 3
  89.  
  90. define HAL_PERIPH_ENABLE_MAG
  91. define HAL_PERIPH_ENABLE_BARO
  92.  
  93. define HAL_PERIPH_ENABLE_BATTERY
  94. define HAL_PERIPH_ENABLE_RC_OUT
  95.  
  96. define HAL_PERIPH_ENABLE_RANGEFINDER
  97. define HAL_PERIPH_RANGEFINDER_PORT_DEFAULT 1
  98. define RANGEFINDER_MAX_INSTANCES 1
  99.  
  100. define HAL_PERIPH_ENABLE_BUZZER
  101. define HAL_PERIPH_ENABLE_NCP5623_LED
  102.  
  103. define HAL_PERIPH_ENABLE_RC_OUT
  104. define HAL_PERIPH_ENABLE_NOTIFY
  105.  
  106. # --------- LED -----------
  107. # a LED to flash
  108. #PB1 LED OUTPUT LOW
  109.  
  110. # --------- ANALOG -----------
  111. # analog pins
  112. PA2 BATT_VOLTAGE_SENS ADC1
  113. PA3 BATT_CURRENT_SENS ADC1
  114.  
  115. # define default battery setup
  116. define HAL_BATT_VOLT_PIN 2
  117. define HAL_BATT_CURR_PIN 3
  118. define HAL_BATT_VOLT_SCALE 10.1
  119. define HAL_BATT_CURR_SCALE 17.0
  120.  
  121. #---------------- SERIAL -----------------------------
  122.  
  123. # order of UARTs
  124. #            ---------------------------------------
  125. #            | sr0 | sr1 | sr2 | sr3 | sr4 | sr5 | sr6
  126. # AP Name                        GPS
  127. #            ---------------------------------------
  128. SERIAL_ORDER OTG1 USART2 USART3 UART4 EMPTY EMPTY UART7
  129.  
  130. PA9 VBUS INPUT
  131.  
  132. PA11 OTG_FS_DM OTG1
  133. PA12 OTG_FS_DP OTG1
  134.  
  135. # USART1 is ESP8266 unused
  136. # PB6 USART1_TX USART1
  137. # PB7 USART1_RX USART1
  138.  
  139. # USART2 serial2 GPS1
  140. PD3 USART2_CTS USART2
  141. PD4 USART2_RTS USART2
  142. PD5 USART2_TX USART2
  143. PD6 USART2_RX USART2
  144.  
  145. # USART3 serial3 telem1
  146. PD8 USART3_TX USART3 NODMA
  147. PD9 USART3_RX USART3
  148. PD11 USART3_CTS USART3
  149. PD12 USART3_RTS USART3
  150.  
  151. # UART4 is GPS2
  152. PA0 UART4_TX UART4 NODMA
  153. PA1 UART4_RX UART4 NODMA
  154.  
  155. # UART7 is debug
  156. PE7 UART7_RX UART7 NODMA
  157. PE8 UART7_TX UART7 NODMA
  158.  
  159. # UART8 serial4 FrSky unused
  160. # PE0 UART8_RX UART8
  161. # PE1 UART8_TX UART8
  162.  
  163. # SWD debugging
  164. PA13 JTMS-SWDIO SWD
  165. PA14 JTCK-SWCLK SWD
  166.  
  167. #---------------- I2C -----------------------------
  168.  
  169. # only one I2C bus in normal config
  170. PB8 I2C1_SCL I2C1
  171. PB9 I2C1_SDA I2C1
  172.  
  173. define HAL_USE_I2C TRUE
  174. define STM32_I2C_USE_I2C1 TRUE
  175.  
  176. define HAL_I2C_CLEAR_ON_TIMEOUT 0
  177.  
  178. define HAL_I2C_INTERNAL_MASK 0
  179.  
  180. # only one I2C bus
  181. I2C_ORDER I2C1
  182.  
  183. # also probe all types of external I2C compasses
  184. define HAL_PROBE_EXTERNAL_I2C_COMPASSES
  185.  
  186. #------------------- SPI -----------------------------
  187. # spi bus for Sensors
  188. PA5 SPI1_SCK SPI1
  189. PA6 SPI1_MISO SPI1
  190. PA7 SPI1_MOSI SPI1
  191. PE12 MAG_DRDY INPUT
  192. PE15 MAG_CS CS
  193.  
  194. PB10 SPI2_SCK SPI2
  195. PB14 SPI2_MISO SPI2
  196. PB15 SPI2_MOSI SPI2
  197. PD7 BARO_CS CS
  198. # PD10 FRAM_CS CS
  199.  
  200. # SPI device table. The DEVID values are chosen to match the PX4 port
  201. # of ArduPilot so users don't need to re-do their accel and compass calibrations
  202. # when moving to ChibiOS
  203. SPIDEV ms5611_int  SPI2 DEVID3  BARO_CS    MODE3  20*MHZ  20*MHZ
  204. # SPIDEV mpu9250     SPI1 DEVID4  MPU9250_CS MODE3   2*MHZ   4*MHZ //future use
  205. # SPIDEV icm20608    SPI1 DEVID6  20608_CS   MODE3   2*MHZ   8*MHZ //future use
  206. SPIDEV hmc5843     SPI1 DEVID5  MAG_CS     MODE3  11*MHZ  11*MHZ
  207. SPIDEV lis3mdl     SPI1 DEVID5  MAG_CS     MODE3 500*KHZ 500*KHZ
  208. # SPIDEV ramtron     SPI2 DEVID10 FRAM_CS    MODE3   8*MHZ   8*MHZ //unused
  209.  
  210. # one barometer
  211. BARO MS56XX SPI:ms5611_int
  212.  
  213. # 2 compasses. R15 has LIS3MDL instead of HMC5843
  214. COMPASS HMC5843 SPI:hmc5843 false ROTATION_PITCH_180
  215. COMPASS LIS3MDL SPI:lis3mdl false ROTATION_NONE
  216. # COMPASS AK8963:probe_mpu9250 0 ROTATION_ROLL_180_YAW_9
  217.  
  218. --------------- ALARM -----------------
  219. # PWM output for buzzer
  220. PA15 TIM2_CH1 TIM2 GPIO(77) ALARM
  221.  
  222. --------------- CAN -----------------
  223.  
  224. # enable CAN support
  225. PD0 CAN1_RX CAN1
  226. PD1 CAN1_TX CAN1
  227.  
  228. define HAL_CAN_DRIVER_DEFAULT 1
  229.  
  230. # --------PWMS -----------
  231.  
  232. PE14 TIM1_CH4 TIM1 PWM(1) GPIO(50)
  233. PE13 TIM1_CH3 TIM1 PWM(2) GPIO(51)
  234. PE11 TIM1_CH2 TIM1 PWM(3) GPIO(52)
  235. PE9  TIM1_CH1 TIM1 PWM(4) GPIO(53)
  236. PD13 TIM4_CH2 TIM4 PWM(5) GPIO(54)
  237. PD14 TIM4_CH3 TIM4 PWM(6) GPIO(55)
  238.  
  239. define BOARD_PWM_COUNT_DEFAULT 6
  240.  
  241. --- *** ---
  242. # pixracer has 3 LEDs, Red, Green, Blue
  243. define HAL_HAVE_PIXRACER_LED
  244.  
  245. define HAL_GPIO_LED_ON  0
  246. define HAL_GPIO_LED_OFF 1
  247.  
  248. # LED setup for PixracerLED driver
  249. PB11 LED_RED   OUTPUT GPIO(0)
  250. PB1  LED_GREEN OUTPUT GPIO(1)
  251. PB3  LED_BLUE  OUTPUT GPIO(2)
  252.  
  253. define HAL_GPIO_A_LED_PIN 0
  254. define HAL_GPIO_B_LED_PIN 1
  255. define HAL_GPIO_C_LED_PIN 2

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me