stm32h7_mcuconf.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /*
  14. this header is modelled on the one for the Nucleo-144 H743 board from ChibiOS
  15. */
  16. #pragma once
  17. #ifndef STM32_LSECLK
  18. #define STM32_LSECLK 32768U
  19. #endif
  20. #ifndef STM32_LSEDRV
  21. #define STM32_LSEDRV (3U << 3U)
  22. #endif
  23. /*
  24. * General settings.
  25. */
  26. #define STM32_NO_INIT FALSE
  27. #define STM32_SYS_CK_ENFORCED_VALUE STM32_HSICLK
  28. /*
  29. * Memory attributes settings.
  30. */
  31. #define STM32_NOCACHE_SRAM1_SRAM2 FALSE
  32. #define STM32_NOCACHE_SRAM3 TRUE
  33. /*
  34. * PWR system settings.
  35. * Reading STM32 Reference Manual is required.
  36. * Register constants are taken from the ST header.
  37. */
  38. #define STM32_VOS STM32_VOS_SCALE1
  39. #define STM32_PWR_CR1 (PWR_CR1_SVOS_1 | PWR_CR1_SVOS_0)
  40. #define STM32_PWR_CR2 (PWR_CR2_BREN)
  41. #define STM32_PWR_CR3 (PWR_CR3_LDOEN | PWR_CR3_USB33DEN)
  42. #define STM32_PWR_CPUCR 0
  43. /*
  44. * Clock tree static settings.
  45. * Reading STM32 Reference Manual is required.
  46. */
  47. #define STM32_HSI_ENABLED FALSE
  48. #define STM32_LSI_ENABLED FALSE
  49. #define STM32_CSI_ENABLED TRUE
  50. #define STM32_HSI48_ENABLED TRUE
  51. #define STM32_HSE_ENABLED TRUE
  52. #define STM32_LSE_ENABLED FALSE
  53. #define STM32_HSIDIV STM32_HSIDIV_DIV1
  54. /*
  55. * PLLs static settings.
  56. * Reading STM32 Reference Manual is required.
  57. */
  58. #define STM32_PLLSRC STM32_PLLSRC_HSE_CK
  59. #define STM32_PLLCFGR_MASK ~0
  60. /*
  61. setup PLLs based on HSE clock
  62. */
  63. #if STM32_HSECLK == 8000000U
  64. // this gives 384MHz system clock
  65. #define STM32_PLL1_DIVM_VALUE 1
  66. #define STM32_PLL1_DIVN_VALUE 96
  67. #define STM32_PLL1_DIVP_VALUE 2
  68. #define STM32_PLL1_DIVQ_VALUE 16
  69. #define STM32_PLL1_DIVR_VALUE 2
  70. #define STM32_PLL2_DIVM_VALUE 1
  71. #define STM32_PLL2_DIVN_VALUE 19
  72. #define STM32_PLL2_DIVP_VALUE 1
  73. #define STM32_PLL2_DIVQ_VALUE 2
  74. #define STM32_PLL2_DIVR_VALUE 2
  75. #define STM32_PLL3_DIVM_VALUE 2
  76. #define STM32_PLL3_DIVN_VALUE 64
  77. #define STM32_PLL3_DIVP_VALUE 2
  78. #define STM32_PLL3_DIVQ_VALUE 2
  79. #define STM32_PLL3_DIVR_VALUE 2
  80. #elif STM32_HSECLK == 16000000U
  81. // this gives 384MHz system clock
  82. #define STM32_PLL1_DIVM_VALUE 2
  83. #define STM32_PLL1_DIVN_VALUE 96
  84. #define STM32_PLL1_DIVP_VALUE 2
  85. #define STM32_PLL1_DIVQ_VALUE 16
  86. #define STM32_PLL1_DIVR_VALUE 2
  87. #define STM32_PLL2_DIVM_VALUE 2
  88. #define STM32_PLL2_DIVN_VALUE 19
  89. #define STM32_PLL2_DIVP_VALUE 1
  90. #define STM32_PLL2_DIVQ_VALUE 2
  91. #define STM32_PLL2_DIVR_VALUE 2
  92. #define STM32_PLL3_DIVM_VALUE 4
  93. #define STM32_PLL3_DIVN_VALUE 64
  94. #define STM32_PLL3_DIVP_VALUE 2
  95. #define STM32_PLL3_DIVQ_VALUE 2
  96. #define STM32_PLL3_DIVR_VALUE 2
  97. #elif STM32_HSECLK == 24000000U
  98. // this gives 384MHz system clock
  99. #define STM32_PLL1_DIVM_VALUE 2
  100. #define STM32_PLL1_DIVN_VALUE 64
  101. #define STM32_PLL1_DIVP_VALUE 2
  102. #define STM32_PLL1_DIVQ_VALUE 16
  103. #define STM32_PLL1_DIVR_VALUE 2
  104. #define STM32_PLL2_DIVM_VALUE 2
  105. #define STM32_PLL2_DIVN_VALUE 13
  106. #define STM32_PLL2_DIVP_VALUE 1
  107. #define STM32_PLL2_DIVQ_VALUE 2
  108. #define STM32_PLL2_DIVR_VALUE 2
  109. #define STM32_PLL3_DIVM_VALUE 12
  110. #define STM32_PLL3_DIVN_VALUE 129
  111. #define STM32_PLL3_DIVP_VALUE 2
  112. #define STM32_PLL3_DIVQ_VALUE 2
  113. #define STM32_PLL3_DIVR_VALUE 2
  114. #else
  115. #error "Unsupported HSE clock"
  116. #endif
  117. #define STM32_PLL1_ENABLED TRUE
  118. #define STM32_PLL1_P_ENABLED TRUE
  119. #define STM32_PLL1_Q_ENABLED TRUE
  120. #define STM32_PLL1_R_ENABLED TRUE
  121. #define STM32_PLL1_FRACN_VALUE 0
  122. #define STM32_PLL2_ENABLED TRUE
  123. #define STM32_PLL2_P_ENABLED TRUE
  124. #define STM32_PLL2_Q_ENABLED TRUE
  125. #define STM32_PLL2_R_ENABLED TRUE
  126. #define STM32_PLL2_FRACN_VALUE 0
  127. #define STM32_PLL3_ENABLED TRUE
  128. #define STM32_PLL3_P_ENABLED TRUE
  129. #define STM32_PLL3_Q_ENABLED TRUE
  130. #define STM32_PLL3_R_ENABLED TRUE
  131. #define STM32_PLL3_FRACN_VALUE 0
  132. /*
  133. * Core clocks dynamic settings (can be changed at runtime).
  134. * Reading STM32 Reference Manual is required.
  135. */
  136. #define STM32_SW STM32_SW_PLL1_P_CK
  137. #define STM32_RTCSEL STM32_RTCSEL_NOCLK
  138. #define STM32_D1CPRE STM32_D1CPRE_DIV1
  139. #define STM32_D1HPRE STM32_D1HPRE_DIV4
  140. #define STM32_D1PPRE3 STM32_D1PPRE3_DIV1
  141. #define STM32_D2PPRE1 STM32_D2PPRE1_DIV1
  142. #define STM32_D2PPRE2 STM32_D2PPRE2_DIV1
  143. #define STM32_D3PPRE4 STM32_D3PPRE4_DIV1
  144. /*
  145. * Peripherals clocks static settings.
  146. * Reading STM32 Reference Manual is required.
  147. */
  148. #define STM32_MCO1SEL STM32_MCO1SEL_HSE_CK
  149. #define STM32_MCO1PRE_VALUE 4
  150. #define STM32_MCO2SEL STM32_MCO2SEL_SYS_CK
  151. #define STM32_MCO2PRE_VALUE 4
  152. #define STM32_TIMPRE_ENABLE TRUE
  153. #define STM32_HRTIMSEL 0
  154. #define STM32_STOPKERWUCK 0
  155. #define STM32_STOPWUCK 0
  156. #define STM32_RTCPRE_VALUE 8
  157. #define STM32_CKPERSEL STM32_CKPERSEL_HSE_CK
  158. #define STM32_SDMMCSEL STM32_SDMMCSEL_PLL1_Q_CK
  159. #define STM32_QSPISEL STM32_QSPISEL_HCLK
  160. #define STM32_FMCSEL STM32_QSPISEL_HCLK
  161. #define STM32_SWPSEL STM32_SWPSEL_PCLK1
  162. #define STM32_FDCANSEL STM32_FDCANSEL_HSE_CK
  163. #define STM32_DFSDM1SEL STM32_DFSDM1SEL_PCLK2
  164. #define STM32_SPDIFSEL STM32_SPDIFSEL_PLL1_Q_CK
  165. #define STM32_SPI45SEL STM32_SPI45SEL_PCLK2
  166. #define STM32_SPI123SEL STM32_SPI123SEL_PLL1_Q_CK
  167. #define STM32_SAI23SEL STM32_SAI23SEL_PLL1_Q_CK
  168. #define STM32_SAI1SEL STM32_SAI1SEL_PLL1_Q_CK
  169. #define STM32_LPTIM1SEL STM32_LPTIM1SEL_PCLK1
  170. #define STM32_CECSEL STM32_CECSEL_DISABLE
  171. #define STM32_USBSEL STM32_USBSEL_PLL1_Q_CK
  172. #define STM32_I2C123SEL STM32_I2C123SEL_PCLK1
  173. #define STM32_RNGSEL STM32_RNGSEL_HSI48_CK
  174. #define STM32_USART16SEL STM32_USART16SEL_PCLK2
  175. #define STM32_USART234578SEL STM32_USART234578SEL_PCLK1
  176. #define STM32_SPI6SEL STM32_SPI6SEL_PCLK4
  177. #define STM32_SAI4BSEL STM32_SAI4BSEL_PLL1_Q_CK
  178. #define STM32_SAI4ASEL STM32_SAI4ASEL_PLL1_Q_CK
  179. #define STM32_ADCSEL STM32_ADCSEL_PLL2_P_CK
  180. #define STM32_LPTIM345SEL STM32_LPTIM345SEL_PCLK4
  181. #define STM32_LPTIM2SEL STM32_LPTIM2SEL_PCLK4
  182. #define STM32_I2C4SEL STM32_I2C4SEL_PCLK4
  183. #define STM32_LPUART1SEL STM32_LPUART1SEL_PCLK4
  184. /*
  185. * IRQ system settings.
  186. */
  187. #define STM32_IRQ_EXTI0_PRIORITY 6
  188. #define STM32_IRQ_EXTI1_PRIORITY 6
  189. #define STM32_IRQ_EXTI2_PRIORITY 6
  190. #define STM32_IRQ_EXTI3_PRIORITY 6
  191. #define STM32_IRQ_EXTI4_PRIORITY 6
  192. #define STM32_IRQ_EXTI5_9_PRIORITY 6
  193. #define STM32_IRQ_EXTI10_15_PRIORITY 6
  194. #define STM32_IRQ_EXTI16_PRIORITY 6
  195. #define STM32_IRQ_EXTI17_PRIORITY 15
  196. #define STM32_IRQ_EXTI18_PRIORITY 6
  197. #define STM32_IRQ_EXTI19_PRIORITY 6
  198. #define STM32_IRQ_EXTI20_PRIORITY 6
  199. #define STM32_IRQ_EXTI21_PRIORITY 15
  200. #define STM32_IRQ_EXTI22_PRIORITY 15
  201. /*
  202. * ADC driver system settings.
  203. */
  204. #define STM32_ADC_DUAL_MODE FALSE
  205. #define STM32_ADC_COMPACT_SAMPLES FALSE
  206. #define STM32_ADC_USE_ADC12 TRUE
  207. #define STM32_ADC_USE_ADC3 FALSE
  208. #define STM32_ADC_ADC12_DMA_PRIORITY 2
  209. #define STM32_ADC_ADC3_DMA_PRIORITY 2
  210. #define STM32_ADC_ADC12_IRQ_PRIORITY 5
  211. #define STM32_ADC_ADC3_IRQ_PRIORITY 5
  212. #define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV4
  213. #define STM32_ADC_ADC3_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV4
  214. // we call it ADC1 in hwdef.dat, but driver uses ADC12 for DMA stream
  215. #define STM32_ADC_ADC12_DMA_STREAM STM32_ADC_ADC1_DMA_STREAM
  216. /*
  217. * CAN driver system settings.
  218. */
  219. #define STM32_CAN_USE_CAN1 FALSE
  220. #define STM32_CAN_USE_CAN2 FALSE
  221. #define STM32_CAN_USE_CAN3 FALSE
  222. #define STM32_CAN_CAN1_IRQ_PRIORITY 11
  223. #define STM32_CAN_CAN2_IRQ_PRIORITY 11
  224. #define STM32_CAN_CAN3_IRQ_PRIORITY 11
  225. /*
  226. * DAC driver system settings.
  227. */
  228. #define STM32_DAC_DUAL_MODE FALSE
  229. #define STM32_DAC_USE_DAC1_CH1 FALSE
  230. #define STM32_DAC_USE_DAC1_CH2 FALSE
  231. #define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10
  232. #define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10
  233. #define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
  234. #define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
  235. /*
  236. * GPT driver system settings.
  237. */
  238. #define STM32_GPT_USE_TIM1 FALSE
  239. #define STM32_GPT_USE_TIM2 FALSE
  240. #define STM32_GPT_USE_TIM3 FALSE
  241. #define STM32_GPT_USE_TIM4 FALSE
  242. #define STM32_GPT_USE_TIM5 FALSE
  243. #define STM32_GPT_USE_TIM6 FALSE
  244. #define STM32_GPT_USE_TIM7 FALSE
  245. #define STM32_GPT_USE_TIM8 FALSE
  246. #define STM32_GPT_USE_TIM9 FALSE
  247. #define STM32_GPT_USE_TIM11 FALSE
  248. #define STM32_GPT_USE_TIM12 FALSE
  249. #define STM32_GPT_USE_TIM14 FALSE
  250. #define STM32_GPT_TIM1_IRQ_PRIORITY 7
  251. #define STM32_GPT_TIM2_IRQ_PRIORITY 7
  252. #define STM32_GPT_TIM3_IRQ_PRIORITY 7
  253. #define STM32_GPT_TIM4_IRQ_PRIORITY 7
  254. #define STM32_GPT_TIM5_IRQ_PRIORITY 7
  255. #define STM32_GPT_TIM6_IRQ_PRIORITY 7
  256. #define STM32_GPT_TIM7_IRQ_PRIORITY 7
  257. #define STM32_GPT_TIM8_IRQ_PRIORITY 7
  258. #define STM32_GPT_TIM9_IRQ_PRIORITY 7
  259. #define STM32_GPT_TIM11_IRQ_PRIORITY 7
  260. #define STM32_GPT_TIM12_IRQ_PRIORITY 7
  261. #define STM32_GPT_TIM14_IRQ_PRIORITY 7
  262. /*
  263. * I2C driver system settings.
  264. */
  265. #define STM32_I2C_BUSY_TIMEOUT 50
  266. #define STM32_I2C_I2C1_IRQ_PRIORITY 5
  267. #define STM32_I2C_I2C2_IRQ_PRIORITY 5
  268. #define STM32_I2C_I2C3_IRQ_PRIORITY 5
  269. #define STM32_I2C_I2C4_IRQ_PRIORITY 5
  270. #define STM32_I2C_I2C1_DMA_PRIORITY 3
  271. #define STM32_I2C_I2C2_DMA_PRIORITY 3
  272. #define STM32_I2C_I2C3_DMA_PRIORITY 3
  273. #define STM32_I2C_I2C4_DMA_PRIORITY 3
  274. #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
  275. /*
  276. * ICU driver system settings.
  277. */
  278. #define STM32_ICU_USE_TIM1 FALSE
  279. #define STM32_ICU_USE_TIM2 FALSE
  280. #define STM32_ICU_USE_TIM3 FALSE
  281. #define STM32_ICU_USE_TIM4 FALSE
  282. #define STM32_ICU_USE_TIM5 FALSE
  283. #define STM32_ICU_USE_TIM8 FALSE
  284. #define STM32_ICU_USE_TIM9 FALSE
  285. #define STM32_ICU_TIM1_IRQ_PRIORITY 7
  286. #define STM32_ICU_TIM2_IRQ_PRIORITY 7
  287. #define STM32_ICU_TIM3_IRQ_PRIORITY 7
  288. #define STM32_ICU_TIM4_IRQ_PRIORITY 7
  289. #define STM32_ICU_TIM5_IRQ_PRIORITY 7
  290. #define STM32_ICU_TIM8_IRQ_PRIORITY 7
  291. #define STM32_ICU_TIM9_IRQ_PRIORITY 7
  292. /*
  293. * MAC driver system settings.
  294. */
  295. #define STM32_MAC_TRANSMIT_BUFFERS 2
  296. #define STM32_MAC_RECEIVE_BUFFERS 4
  297. #define STM32_MAC_BUFFERS_SIZE 1522
  298. #define STM32_MAC_PHY_TIMEOUT 100
  299. #define STM32_MAC_ETH1_CHANGE_PHY_STATE TRUE
  300. #define STM32_MAC_ETH1_IRQ_PRIORITY 13
  301. #define STM32_MAC_IP_CHECKSUM_OFFLOAD 0
  302. /*
  303. * PWM driver system settings.
  304. */
  305. #define STM32_PWM_TIM1_IRQ_PRIORITY 7
  306. #define STM32_PWM_TIM2_IRQ_PRIORITY 7
  307. #define STM32_PWM_TIM3_IRQ_PRIORITY 7
  308. #define STM32_PWM_TIM4_IRQ_PRIORITY 7
  309. #define STM32_PWM_TIM5_IRQ_PRIORITY 7
  310. #define STM32_PWM_TIM8_IRQ_PRIORITY 7
  311. #define STM32_PWM_TIM9_IRQ_PRIORITY 7
  312. /*
  313. * RTC driver system settings.
  314. */
  315. #define STM32_RTC_PRESA_VALUE 32
  316. #define STM32_RTC_PRESS_VALUE 1024
  317. #define STM32_RTC_CR_INIT 0
  318. #define STM32_RTC_TAMPCR_INIT 0
  319. /*
  320. * SDC driver system settings.
  321. */
  322. #define STM32_SDC_SDMMC_UNALIGNED_SUPPORT TRUE
  323. #define STM32_SDC_SDMMC_WRITE_TIMEOUT 1000
  324. #define STM32_SDC_SDMMC_READ_TIMEOUT 1000
  325. #define STM32_SDC_SDMMC_CLOCK_DELAY 10
  326. #define STM32_SDC_SDMMC1_DMA_PRIORITY 3
  327. #define STM32_SDC_SDMMC1_IRQ_PRIORITY 9
  328. /*
  329. * SERIAL driver system settings.
  330. */
  331. #define STM32_SERIAL_USART1_PRIORITY 12
  332. #define STM32_SERIAL_USART2_PRIORITY 12
  333. #define STM32_SERIAL_USART3_PRIORITY 12
  334. #define STM32_SERIAL_UART4_PRIORITY 12
  335. #define STM32_SERIAL_UART5_PRIORITY 12
  336. #define STM32_SERIAL_USART6_PRIORITY 12
  337. #define STM32_SERIAL_UART7_PRIORITY 12
  338. #define STM32_SERIAL_UART8_PRIORITY 12
  339. #define STM32_UART1CLK STM32_PCLK1
  340. #define STM32_UART2CLK STM32_PCLK1
  341. #define STM32_UART3CLK STM32_PCLK1
  342. #define STM32_UART4CLK STM32_PCLK1
  343. #define STM32_UART5CLK STM32_PCLK1
  344. #define STM32_UART6CLK STM32_PCLK1
  345. #define STM32_UART7CLK STM32_PCLK1
  346. #define STM32_UART8CLK STM32_PCLK1
  347. /*
  348. * SPI driver system settings.
  349. */
  350. #ifndef STM32_SPI_USE_SPI1
  351. #define STM32_SPI_USE_SPI1 FALSE
  352. #endif
  353. #ifndef STM32_SPI_USE_SPI2
  354. #define STM32_SPI_USE_SPI2 FALSE
  355. #endif
  356. #ifndef STM32_SPI_USE_SPI3
  357. #define STM32_SPI_USE_SPI3 FALSE
  358. #endif
  359. #ifndef STM32_SPI_USE_SPI4
  360. #define STM32_SPI_USE_SPI4 FALSE
  361. #endif
  362. #ifndef STM32_SPI_USE_SPI5
  363. #define STM32_SPI_USE_SPI5 FALSE
  364. #endif
  365. #ifndef STM32_SPI_USE_SPI6
  366. #define STM32_SPI_USE_SPI6 FALSE
  367. #endif
  368. #define STM32_SPI_SPI1_DMA_PRIORITY 1
  369. #define STM32_SPI_SPI2_DMA_PRIORITY 1
  370. #define STM32_SPI_SPI3_DMA_PRIORITY 1
  371. #define STM32_SPI_SPI4_DMA_PRIORITY 1
  372. #define STM32_SPI_SPI5_DMA_PRIORITY 1
  373. #define STM32_SPI_SPI6_DMA_PRIORITY 1
  374. #define STM32_SPI_SPI1_IRQ_PRIORITY 10
  375. #define STM32_SPI_SPI2_IRQ_PRIORITY 10
  376. #define STM32_SPI_SPI3_IRQ_PRIORITY 10
  377. #define STM32_SPI_SPI4_IRQ_PRIORITY 10
  378. #define STM32_SPI_SPI5_IRQ_PRIORITY 10
  379. #define STM32_SPI_SPI6_IRQ_PRIORITY 10
  380. #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
  381. /*
  382. * ST driver system settings.
  383. */
  384. #define STM32_ST_IRQ_PRIORITY 8
  385. #ifndef STM32_ST_USE_TIMER
  386. #define STM32_ST_USE_TIMER 5
  387. #endif
  388. /*
  389. * UART driver system settings.
  390. */
  391. #define STM32_UART_USART1_IRQ_PRIORITY 12
  392. #define STM32_UART_USART2_IRQ_PRIORITY 12
  393. #define STM32_UART_USART3_IRQ_PRIORITY 12
  394. #define STM32_UART_UART4_IRQ_PRIORITY 12
  395. #define STM32_UART_UART5_IRQ_PRIORITY 12
  396. #define STM32_UART_USART6_IRQ_PRIORITY 12
  397. #define STM32_UART_USART1_DMA_PRIORITY 0
  398. #define STM32_UART_USART2_DMA_PRIORITY 0
  399. #define STM32_UART_USART3_DMA_PRIORITY 0
  400. #define STM32_UART_UART4_DMA_PRIORITY 0
  401. #define STM32_UART_UART5_DMA_PRIORITY 0
  402. #define STM32_UART_USART6_DMA_PRIORITY 0
  403. #define STM32_UART_UART7_DMA_PRIORITY 0
  404. #define STM32_UART_UART8_DMA_PRIORITY 0
  405. #define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
  406. /*
  407. * USB driver system settings.
  408. */
  409. #define STM32_USB_USE_OTG1 TRUE
  410. #define STM32_USB_USE_OTG2 TRUE
  411. #define STM32_USB_OTG1_IRQ_PRIORITY 14
  412. #define STM32_USB_OTG2_IRQ_PRIORITY 14
  413. #define STM32_USB_OTG1_RX_FIFO_SIZE 512
  414. #define STM32_USB_OTG2_RX_FIFO_SIZE 1024
  415. #define STM32_USB_HOST_WAKEUP_DURATION 2
  416. /*
  417. * WDG driver system settings.
  418. */
  419. #define STM32_WDG_USE_IWDG FALSE
  420. #define STM32_EXTI_ENHANCED