Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
mcuconf_h7.h
Go to the documentation of this file.
1
/*
2
ChibiOS - Copyright (C) 2006..2023 Giovanni Di Sirio
3
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
8
http://www.apache.org/licenses/LICENSE-2.0
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16
17
#ifndef MCUCONF_H7_H
18
#define MCUCONF_H7_H
19
20
/* Always enforce the old version */
21
#define STM32_ENFORCE_H7_REV_XY
22
23
/* Default clock configuration */
24
#ifndef STM32_LSECLK
25
#define STM32_LSECLK 32768U
26
#endif
27
28
#ifndef STM32_LSEDRV
29
#define STM32_LSEDRV (3U << 3U)
30
#endif
31
32
/*
33
* STM32H7xx drivers configuration.
34
* The following settings override the default settings present in
35
* the various device driver implementation headers.
36
* Note that the settings for each driver only have effect if the whole
37
* driver is enabled in halconf.h.
38
*
39
* IRQ priorities:
40
* 15...0 Lowest...Highest.
41
*
42
* DMA priorities:
43
* 0...3 Lowest...Highest.
44
*/
45
46
#define STM32H7xx_MCUCONF
47
#define STM32H742_MCUCONF
48
#define STM32H743_MCUCONF
49
#define STM32H753_MCUCONF
50
#define STM32H745_MCUCONF
51
#define STM32H755_MCUCONF
52
#define STM32H747_MCUCONF
53
#define STM32H757_MCUCONF
54
#define STM32H750_MCUCONF
55
56
/*
57
* General settings.
58
*/
59
#define STM32_NO_INIT FALSE
60
#define STM32_TARGET_CORE 1
61
62
/*
63
* Memory attributes settings.
64
*/
65
#define STM32_NOCACHE_ENABLE FALSE
66
#define STM32_NOCACHE_MPU_REGION MPU_REGION_6
67
#define STM32_NOCACHE_RBAR 0x24000000U
68
#define STM32_NOCACHE_RASR MPU_RASR_SIZE_64K
69
70
/*
71
* PWR system settings.
72
* Reading STM32 Reference Manual is required, settings in PWR_CR3 are
73
* very critical.
74
* Register constants are taken from the ST header.
75
*/
76
#define STM32_VOS STM32_VOS_SCALE1
77
#define STM32_PWR_CR1 (PWR_CR1_SVOS_1 | PWR_CR1_SVOS_0)
78
#define STM32_PWR_CR2 (PWR_CR2_BREN)
79
#if SMPS_PWR
80
#define STM32_PWR_CR3 (PWR_CR3_SMPSEN | PWR_CR3_USB33DEN)
81
#else
82
#define STM32_PWR_CR3 (PWR_CR3_LDOEN | PWR_CR3_USB33DEN)
83
#endif
84
#define STM32_PWR_CPUCR 0
85
86
/*
87
* Clock tree static settings.
88
* Reading STM32 Reference Manual is required.
89
*/
90
#define STM32_HSI_ENABLED FALSE
91
#define STM32_LSI_ENABLED FALSE
92
#define STM32_CSI_ENABLED FALSE
93
#define STM32_HSI48_ENABLED TRUE
94
#define STM32_HSE_ENABLED TRUE
95
#define STM32_LSE_ENABLED FALSE
96
#define STM32_HSIDIV STM32_HSIDIV_DIV1
97
98
/*
99
* PLLs static settings.
100
* Reading STM32 Reference Manual is required.
101
*/
102
#if STM32_HSECLK == 16000000U
103
#define STM32_PLLSRC STM32_PLLSRC_HSE_CK
104
#define STM32_PLLCFGR_MASK ~0
105
#define STM32_PLL1_ENABLED TRUE
106
#define STM32_PLL1_P_ENABLED TRUE
107
#define STM32_PLL1_Q_ENABLED TRUE
108
#define STM32_PLL1_R_ENABLED TRUE
109
#define STM32_PLL1_DIVM_VALUE 2
110
#define STM32_PLL1_DIVN_VALUE 100
111
#define STM32_PLL1_FRACN_VALUE 0
112
#define STM32_PLL1_DIVP_VALUE 2
113
#define STM32_PLL1_DIVQ_VALUE 10
114
#define STM32_PLL1_DIVR_VALUE 2
115
#define STM32_PLL2_ENABLED TRUE
116
#define STM32_PLL2_P_ENABLED TRUE
117
#define STM32_PLL2_Q_ENABLED TRUE
118
#define STM32_PLL2_R_ENABLED TRUE
119
#define STM32_PLL2_DIVM_VALUE 2
120
#define STM32_PLL2_DIVN_VALUE 75
121
#define STM32_PLL2_FRACN_VALUE 0
122
#define STM32_PLL2_DIVP_VALUE 3
123
#define STM32_PLL2_DIVQ_VALUE 6
124
#define STM32_PLL2_DIVR_VALUE 3
125
#define STM32_PLL3_ENABLED TRUE
126
#define STM32_PLL3_P_ENABLED FALSE
127
#define STM32_PLL3_Q_ENABLED TRUE
128
#define STM32_PLL3_R_ENABLED TRUE
129
#define STM32_PLL3_DIVM_VALUE 4
130
#define STM32_PLL3_DIVN_VALUE 72
131
#define STM32_PLL3_FRACN_VALUE 0
132
#define STM32_PLL3_DIVP_VALUE 2
133
#define STM32_PLL3_DIVQ_VALUE 6
134
#define STM32_PLL3_DIVR_VALUE 9
135
136
#elif STM32_HSECLK == 24000000U
137
#define STM32_PLLSRC STM32_PLLSRC_HSE_CK
138
#define STM32_PLLCFGR_MASK ~0
139
#define STM32_PLL1_ENABLED TRUE
140
#define STM32_PLL1_P_ENABLED TRUE
141
#define STM32_PLL1_Q_ENABLED TRUE
142
#define STM32_PLL1_R_ENABLED TRUE
143
#define STM32_PLL1_DIVM_VALUE 3
144
#define STM32_PLL1_DIVN_VALUE 100
145
#define STM32_PLL1_FRACN_VALUE 0
146
#define STM32_PLL1_DIVP_VALUE 2
147
#define STM32_PLL1_DIVQ_VALUE 10
148
#define STM32_PLL1_DIVR_VALUE 2
149
#define STM32_PLL2_ENABLED TRUE
150
#define STM32_PLL2_P_ENABLED TRUE
151
#define STM32_PLL2_Q_ENABLED TRUE
152
#define STM32_PLL2_R_ENABLED TRUE
153
#define STM32_PLL2_DIVM_VALUE 2
154
#define STM32_PLL2_DIVN_VALUE 30
155
#define STM32_PLL2_FRACN_VALUE 0
156
#define STM32_PLL2_DIVP_VALUE 2
157
#define STM32_PLL2_DIVQ_VALUE 5
158
#define STM32_PLL2_DIVR_VALUE 1
159
#define STM32_PLL3_ENABLED TRUE
160
#define STM32_PLL3_P_ENABLED TRUE
161
#define STM32_PLL3_Q_ENABLED TRUE
162
#define STM32_PLL3_R_ENABLED TRUE
163
#define STM32_PLL3_DIVM_VALUE 6
164
#define STM32_PLL3_DIVN_VALUE 72
165
#define STM32_PLL3_FRACN_VALUE 0
166
#define STM32_PLL3_DIVP_VALUE 2
167
#define STM32_PLL3_DIVQ_VALUE 6
168
#define STM32_PLL3_DIVR_VALUE 9
169
#endif
/* STM32_HSECLK */
170
171
/*
172
* Core clocks dynamic settings (can be changed at runtime).
173
* Reading STM32 Reference Manual is required.
174
*/
175
#define STM32_SW STM32_SW_PLL1_P_CK
176
#define STM32_RTCSEL STM32_RTCSEL_NOCLK
177
#define STM32_D1CPRE STM32_D1CPRE_DIV1
178
#define STM32_D1HPRE STM32_D1HPRE_DIV2
179
#define STM32_D1PPRE3 STM32_D1PPRE3_DIV2
180
#define STM32_D2PPRE1 STM32_D2PPRE1_DIV2
181
#define STM32_D2PPRE2 STM32_D2PPRE2_DIV2
182
#define STM32_D3PPRE4 STM32_D3PPRE4_DIV2
183
184
/*
185
* Peripherals clocks static settings.
186
* Reading STM32 Reference Manual is required.
187
*/
188
#define STM32_MCO1SEL STM32_MCO1SEL_HSE_CK
189
#define STM32_MCO1PRE_VALUE 4
190
#define STM32_MCO2SEL STM32_MCO2SEL_SYS_CK
191
#define STM32_MCO2PRE_VALUE 4
192
#define STM32_TIMPRE_ENABLE TRUE
193
#define STM32_HRTIMSEL 0
194
#define STM32_STOPKERWUCK 0
195
#define STM32_STOPWUCK 0
196
#define STM32_RTCPRE_VALUE 8
197
#define STM32_CKPERSEL STM32_CKPERSEL_HSE_CK
198
#define STM32_SDMMCSEL STM32_SDMMCSEL_PLL1_Q_CK
199
#define STM32_QSPISEL STM32_QSPISEL_PLL2_R_CK
200
#define STM32_FMCSEL STM32_FMCSEL_HCLK
201
#define STM32_SWPSEL STM32_SWPSEL_PCLK1
202
#define STM32_FDCANSEL STM32_FDCANSEL_PLL1_Q_CK
203
#define STM32_DFSDM1SEL STM32_DFSDM1SEL_PCLK2
204
#define STM32_SPDIFSEL STM32_SPDIFSEL_PLL1_Q_CK
205
#define STM32_SPI45SEL STM32_SPI45SEL_PCLK2
206
#define STM32_SPI123SEL STM32_SPI123SEL_PLL1_Q_CK
207
#define STM32_SAI23SEL STM32_SAI23SEL_PLL1_Q_CK
208
#define STM32_SAI1SEL STM32_SAI1SEL_PLL1_Q_CK
209
#define STM32_LPTIM1SEL STM32_LPTIM1SEL_PCLK1
210
#define STM32_CECSEL STM32_CECSEL_DISABLE
211
#define STM32_USBSEL STM32_USBSEL_PLL3_Q_CK
212
#define STM32_I2C123SEL STM32_I2C123SEL_PLL3_R_CK
213
#define STM32_RNGSEL STM32_RNGSEL_HSI48_CK
214
#define STM32_USART16SEL STM32_USART16SEL_PCLK2
215
#define STM32_USART234578SEL STM32_USART234578SEL_PCLK1
216
#define STM32_SPI6SEL STM32_SPI6SEL_PCLK4
217
#define STM32_SAI4BSEL STM32_SAI4BSEL_PLL1_Q_CK
218
#define STM32_SAI4ASEL STM32_SAI4ASEL_PLL1_Q_CK
219
#define STM32_ADCSEL STM32_ADCSEL_PLL3_R_CK
220
#define STM32_LPTIM345SEL STM32_LPTIM345SEL_PCLK4
221
#define STM32_LPTIM2SEL STM32_LPTIM2SEL_PCLK4
222
#define STM32_I2C4SEL STM32_I2C4SEL_PLL3_R_CK
223
#define STM32_LPUART1SEL STM32_LPUART1SEL_PCLK4
224
225
/*
226
* IRQ system settings.
227
*/
228
#define STM32_IRQ_EXTI0_PRIORITY 6
229
#define STM32_IRQ_EXTI1_PRIORITY 6
230
#define STM32_IRQ_EXTI2_PRIORITY 6
231
#define STM32_IRQ_EXTI3_PRIORITY 6
232
#define STM32_IRQ_EXTI4_PRIORITY 6
233
#define STM32_IRQ_EXTI5_9_PRIORITY 6
234
#define STM32_IRQ_EXTI10_15_PRIORITY 6
235
#define STM32_IRQ_EXTI16_PRIORITY 6
236
#define STM32_IRQ_EXTI17_PRIORITY 15
//#TODO: is this correct?
237
#define STM32_IRQ_EXTI18_PRIORITY 6
238
#define STM32_IRQ_EXTI19_PRIORITY 6
239
#define STM32_IRQ_EXTI20_21_PRIORITY 6
240
241
#define STM32_IRQ_FDCAN1_PRIORITY 10
242
#define STM32_IRQ_FDCAN2_PRIORITY 10
243
244
#define STM32_IRQ_MDMA_PRIORITY 9
245
246
#define STM32_IRQ_QUADSPI1_PRIORITY 10
247
248
#define STM32_IRQ_SDMMC1_PRIORITY 9
249
#define STM32_IRQ_SDMMC2_PRIORITY 9
250
251
#define STM32_IRQ_TIM1_UP_PRIORITY 7
252
#define STM32_IRQ_TIM1_CC_PRIORITY 7
253
#define STM32_IRQ_TIM2_PRIORITY 7
254
#define STM32_IRQ_TIM3_PRIORITY 7
255
#define STM32_IRQ_TIM4_PRIORITY 7
256
#define STM32_IRQ_TIM5_PRIORITY 7
257
#define STM32_IRQ_TIM6_PRIORITY 7
258
#define STM32_IRQ_TIM7_PRIORITY 7
259
#define STM32_IRQ_TIM8_BRK_TIM12_PRIORITY 7
260
#define STM32_IRQ_TIM8_UP_TIM13_PRIORITY 7
261
#define STM32_IRQ_TIM8_TRGCO_TIM14_PRIORITY 7
262
#define STM32_IRQ_TIM8_CC_PRIORITY 7
263
#define STM32_IRQ_TIM15_PRIORITY 7
264
#define STM32_IRQ_TIM16_PRIORITY 7
265
#define STM32_IRQ_TIM17_PRIORITY 7
266
267
#define STM32_IRQ_USART1_PRIORITY 12
268
#define STM32_IRQ_USART2_PRIORITY 12
269
#define STM32_IRQ_USART3_PRIORITY 12
270
#define STM32_IRQ_UART4_PRIORITY 12
271
#define STM32_IRQ_UART5_PRIORITY 12
272
#define STM32_IRQ_USART6_PRIORITY 12
273
#define STM32_IRQ_UART7_PRIORITY 12
274
#define STM32_IRQ_UART8_PRIORITY 12
275
#define STM32_IRQ_LPUART1_PRIORITY 12
276
277
/*
278
* ADC driver system settings.
279
*/
280
#define STM32_ADC_DUAL_MODE FALSE
281
#define STM32_ADC_SAMPLES_SIZE 16
282
#define STM32_ADC_USE_ADC12 TRUE
283
#define STM32_ADC_USE_ADC3 TRUE
284
#define STM32_ADC_ADC12_DMA_STREAM STM32_DMA_STREAM_ID_ANY
285
#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID_ANY
286
#define STM32_ADC_ADC3_USE_BDMA TRUE
287
#define STM32_ADC_ADC3_BDMA_STREAM STM32_BDMA_STREAM_ID_ANY
288
#define STM32_ADC_ADC12_DMA_PRIORITY 2
289
#define STM32_ADC_ADC3_DMA_PRIORITY 2
290
#define STM32_ADC_ADC12_IRQ_PRIORITY 5
291
#define STM32_ADC_ADC3_IRQ_PRIORITY 5
292
#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_ADCCK
293
#define STM32_ADC_ADC3_CLOCK_MODE ADC_CCR_CKMODE_ADCCK
294
295
/*
296
* CAN driver system settings.
297
*/
298
#if USE_CAN1
299
#define STM32_CAN_USE_FDCAN1 TRUE
300
#else
301
#define STM32_CAN_USE_FDCAN1 FALSE
302
#endif
303
#if USE_CAN2
304
#define STM32_CAN_USE_FDCAN2 TRUE
305
#else
306
#define STM32_CAN_USE_FDCAN2 FALSE
307
#endif
308
309
/*
310
* DAC driver system settings.
311
*/
312
#define STM32_DAC_DUAL_MODE FALSE
313
#define STM32_DAC_USE_DAC1_CH1 FALSE
314
#define STM32_DAC_USE_DAC1_CH2 FALSE
315
#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10
316
#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10
317
#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
318
#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
319
#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID_ANY
320
#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID_ANY
321
322
/*
323
* GPT driver system settings.
324
*/
325
#define STM32_GPT_USE_TIM1 FALSE
326
#define STM32_GPT_USE_TIM2 FALSE
327
#define STM32_GPT_USE_TIM3 FALSE
328
#define STM32_GPT_USE_TIM4 FALSE
329
#define STM32_GPT_USE_TIM5 FALSE
330
#define STM32_GPT_USE_TIM6 FALSE
331
#define STM32_GPT_USE_TIM7 FALSE
332
#define STM32_GPT_USE_TIM8 FALSE
333
#define STM32_GPT_USE_TIM12 FALSE
334
#define STM32_GPT_USE_TIM13 FALSE
335
#define STM32_GPT_USE_TIM14 FALSE
336
#define STM32_GPT_USE_TIM15 FALSE
337
#define STM32_GPT_USE_TIM16 FALSE
338
#define STM32_GPT_USE_TIM17 FALSE
339
340
/*
341
* I2C driver system settings.
342
*/
343
#if USE_I2C1
344
#define STM32_I2C_USE_I2C1 TRUE
345
#else
346
#define STM32_I2C_USE_I2C1 FALSE
347
#endif
348
#if USE_I2C2
349
#define STM32_I2C_USE_I2C2 TRUE
350
#else
351
#define STM32_I2C_USE_I2C2 FALSE
352
#endif
353
#if USE_I2C3
354
#define STM32_I2C_USE_I2C3 TRUE
355
#else
356
#define STM32_I2C_USE_I2C3 FALSE
357
#endif
358
#if USE_I2C4
359
#define STM32_I2C_USE_I2C4 TRUE
360
#else
361
#define STM32_I2C_USE_I2C4 FALSE
362
#endif
363
//TODO #define STM32_I2C_ISR_LIMIT 6
364
#define STM32_I2C_BUSY_TIMEOUT 0
365
#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
366
#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
367
#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
368
#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
369
#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
370
#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
371
#define STM32_I2C_I2C4_RX_BDMA_STREAM 1
372
#define STM32_I2C_I2C4_TX_BDMA_STREAM 2
373
#define STM32_I2C_I2C1_IRQ_PRIORITY 5
374
#define STM32_I2C_I2C2_IRQ_PRIORITY 5
375
#define STM32_I2C_I2C3_IRQ_PRIORITY 5
376
#define STM32_I2C_I2C4_IRQ_PRIORITY 5
377
#define STM32_I2C_I2C1_DMA_PRIORITY 3
378
#define STM32_I2C_I2C2_DMA_PRIORITY 3
379
#define STM32_I2C_I2C3_DMA_PRIORITY 3
380
#define STM32_I2C_I2C4_DMA_PRIORITY 3
381
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
382
383
/*
384
* ICU driver system settings.
385
*/
386
#define STM32_ICU_USE_TIM1 FALSE
387
#define STM32_ICU_USE_TIM2 FALSE
388
#define STM32_ICU_USE_TIM3 FALSE
389
#define STM32_ICU_USE_TIM4 FALSE
390
#define STM32_ICU_USE_TIM5 FALSE
391
#define STM32_ICU_USE_TIM8 FALSE
392
#define STM32_ICU_USE_TIM12 FALSE
393
#define STM32_ICU_USE_TIM13 FALSE
394
#define STM32_ICU_USE_TIM14 FALSE
395
#define STM32_ICU_USE_TIM15 FALSE
396
#define STM32_ICU_USE_TIM16 FALSE
397
#define STM32_ICU_USE_TIM17 FALSE
398
399
/*
400
* MAC driver system settings.
401
*/
402
#define STM32_MAC_TRANSMIT_BUFFERS 2
403
#define STM32_MAC_RECEIVE_BUFFERS 4
404
#define STM32_MAC_BUFFERS_SIZE 1522
405
#define STM32_MAC_PHY_TIMEOUT 100
406
#define STM32_MAC_ETH1_CHANGE_PHY_STATE TRUE
407
#define STM32_MAC_ETH1_IRQ_PRIORITY 13
408
#define STM32_MAC_IP_CHECKSUM_OFFLOAD 0
409
410
/*
411
* PWM driver system settings.
412
*/
413
#if USE_PWM_TIM1 || USE_DSHOT_TIM1
414
#define STM32_PWM_USE_TIM1 TRUE
415
#else
416
#define STM32_PWM_USE_TIM1 FALSE
417
#endif
418
#if USE_PWM_TIM2 || USE_DSHOT_TIM2
419
#define STM32_PWM_USE_TIM2 TRUE
420
#else
421
#define STM32_PWM_USE_TIM2 FALSE
422
#endif
423
#if USE_PWM_TIM3 || USE_DSHOT_TIM3
424
#define STM32_PWM_USE_TIM3 TRUE
425
#else
426
#define STM32_PWM_USE_TIM3 FALSE
427
#endif
428
#if USE_PWM_TIM4 || USE_DSHOT_TIM4
429
#define STM32_PWM_USE_TIM4 TRUE
430
#else
431
#define STM32_PWM_USE_TIM4 FALSE
432
#endif
433
#if USE_PWM_TIM5 || USE_DSHOT_TIM5
434
#define STM32_PWM_USE_TIM5 TRUE
435
#else
436
#define STM32_PWM_USE_TIM5 FALSE
437
#endif
438
#if USE_PWM_TIM8 || USE_DSHOT_TIM8
439
#define STM32_PWM_USE_TIM8 TRUE
440
#else
441
#define STM32_PWM_USE_TIM8 FALSE
442
#endif
443
#if USE_PWM_TIM12 || USE_DSHOT_TIM12
444
#define STM32_PWM_USE_TIM12 TRUE
445
#else
446
#define STM32_PWM_USE_TIM12 FALSE
447
#endif
448
#define STM32_PWM_USE_TIM13 FALSE
449
#define STM32_PWM_USE_TIM14 FALSE
450
#define STM32_PWM_USE_TIM15 FALSE
451
#define STM32_PWM_USE_TIM16 FALSE
452
#define STM32_PWM_USE_TIM17 FALSE
453
454
/*
455
* RTC driver system settings.
456
*/
457
#define STM32_RTC_PRESA_VALUE 32
458
#define STM32_RTC_PRESS_VALUE 1024
459
#define STM32_RTC_CR_INIT 0
460
#define STM32_RTC_TAMPCR_INIT 0
461
462
/*
463
* SDC driver system settings.
464
*/
465
#if USE_SDCD1
466
#define STM32_SDC_USE_SDMMC1 TRUE
467
#else
468
#define STM32_SDC_USE_SDMMC1 FALSE
469
#endif
470
#if USE_SDCD2
471
#define STM32_SDC_USE_SDMMC2 TRUE
472
#else
473
#define STM32_SDC_USE_SDMMC2 FALSE
474
#endif
475
#define STM32_SDC_SDMMC_UNALIGNED_SUPPORT TRUE
476
#define STM32_SDC_SDMMC_WRITE_TIMEOUT 6000000
477
#define STM32_SDC_SDMMC_READ_TIMEOUT 6000000
478
#define STM32_SDC_SDMMC_CLOCK_DELAY 20
479
#define STM32_SDC_SDMMC_PWRSAV TRUE
480
//TODO #define STM32_SDC_FORCE_25MHZ TRUE
481
482
/*
483
* SERIAL driver system settings.
484
*/
485
#if USE_UART1
486
#define STM32_SERIAL_USE_USART1 TRUE
487
#else
488
#define STM32_SERIAL_USE_USART1 FALSE
489
#endif
490
#if USE_UART2
491
#define STM32_SERIAL_USE_USART2 TRUE
492
#else
493
#define STM32_SERIAL_USE_USART2 FALSE
494
#endif
495
#if USE_UART3
496
#define STM32_SERIAL_USE_USART3 TRUE
497
#else
498
#define STM32_SERIAL_USE_USART3 FALSE
499
#endif
500
#if USE_UART4
501
#define STM32_SERIAL_USE_UART4 TRUE
502
#else
503
#define STM32_SERIAL_USE_UART4 FALSE
504
#endif
505
#if USE_UART5
506
#define STM32_SERIAL_USE_UART5 TRUE
507
#else
508
#define STM32_SERIAL_USE_UART5 FALSE
509
#endif
510
#if USE_UART6
511
#define STM32_SERIAL_USE_USART6 TRUE
512
#else
513
#define STM32_SERIAL_USE_USART6 FALSE
514
#endif
515
#if USE_UART7
516
#define STM32_SERIAL_USE_UART7 TRUE
517
#else
518
#define STM32_SERIAL_USE_UART7 FALSE
519
#endif
520
#if USE_UART8
521
#define STM32_SERIAL_USE_UART8 TRUE
522
#else
523
#define STM32_SERIAL_USE_UART8 FALSE
524
#endif
525
#define STM32_SERIAL_USE_LPUART1 FALSE
526
527
/*
528
* SIO driver system settings.
529
*/
530
#define STM32_SIO_USE_USART1 FALSE
531
#define STM32_SIO_USE_USART2 FALSE
532
#define STM32_SIO_USE_USART3 FALSE
533
#define STM32_SIO_USE_UART4 FALSE
534
#define STM32_SIO_USE_UART5 FALSE
535
#define STM32_SIO_USE_USART6 FALSE
536
#define STM32_SIO_USE_UART7 FALSE
537
#define STM32_SIO_USE_UART8 FALSE
538
#define STM32_SIO_USE_LPUART1 FALSE
539
540
/*
541
* SPI driver system settings.
542
*/
543
#if USE_SPI1
544
#define STM32_SPI_USE_SPI1 TRUE
545
#else
546
#define STM32_SPI_USE_SPI1 FALSE
547
#endif
548
#if USE_SPI2
549
#define STM32_SPI_USE_SPI2 TRUE
550
#else
551
#define STM32_SPI_USE_SPI2 FALSE
552
#endif
553
#if USE_SPI3
554
#define STM32_SPI_USE_SPI3 TRUE
555
#else
556
#define STM32_SPI_USE_SPI3 FALSE
557
#endif
558
#if USE_SPI4
559
#define STM32_SPI_USE_SPI4 TRUE
560
#else
561
#define STM32_SPI_USE_SPI4 FALSE
562
#endif
563
#if USE_SPI4
564
#define STM32_SPI_USE_SPI5 TRUE
565
#else
566
#define STM32_SPI_USE_SPI5 FALSE
567
#endif
568
#if USE_SPI6
569
#define STM32_SPI_USE_SPI6 TRUE
570
#else
571
#define STM32_SPI_USE_SPI6 FALSE
572
#endif
573
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
574
#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
575
#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
576
#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
577
#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
578
#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
579
#define STM32_SPI_SPI4_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
580
#define STM32_SPI_SPI4_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
581
#define STM32_SPI_SPI5_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
582
#define STM32_SPI_SPI5_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
583
#define STM32_SPI_SPI6_RX_BDMA_STREAM STM32_BDMA_STREAM_ID_ANY
584
#define STM32_SPI_SPI6_TX_BDMA_STREAM STM32_BDMA_STREAM_ID_ANY
585
#define STM32_SPI_SPI1_DMA_PRIORITY 1
586
#define STM32_SPI_SPI2_DMA_PRIORITY 1
587
#define STM32_SPI_SPI3_DMA_PRIORITY 1
588
#define STM32_SPI_SPI4_DMA_PRIORITY 1
589
#define STM32_SPI_SPI5_DMA_PRIORITY 1
590
#define STM32_SPI_SPI6_DMA_PRIORITY 1
591
#define STM32_SPI_SPI1_IRQ_PRIORITY 10
592
#define STM32_SPI_SPI2_IRQ_PRIORITY 10
593
#define STM32_SPI_SPI3_IRQ_PRIORITY 10
594
#define STM32_SPI_SPI4_IRQ_PRIORITY 10
595
#define STM32_SPI_SPI5_IRQ_PRIORITY 10
596
#define STM32_SPI_SPI6_IRQ_PRIORITY 10
597
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
598
599
/*
600
* ST driver system settings.
601
*/
602
#define STM32_ST_IRQ_PRIORITY 8
603
#define STM32_ST_USE_TIMER 5
604
605
/*
606
* TRNG driver system settings.
607
*/
608
#define STM32_TRNG_USE_RNG1 FALSE
609
610
/*
611
* UART driver system settings.
612
*/
613
#define STM32_UART_USE_USART1 FALSE
614
#define STM32_UART_USE_USART2 FALSE
615
#define STM32_UART_USE_USART3 FALSE
616
#define STM32_UART_USE_UART4 FALSE
617
#define STM32_UART_USE_UART5 FALSE
618
#define STM32_UART_USE_USART6 FALSE
619
#define STM32_UART_USE_UART7 FALSE
620
#define STM32_UART_USE_UART8 FALSE
621
#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
622
#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
623
#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
624
#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
625
#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
626
#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
627
#define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
628
#define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
629
#define STM32_UART_UART5_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
630
#define STM32_UART_UART5_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
631
#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
632
#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
633
#define STM32_UART_UART7_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
634
#define STM32_UART_UART7_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
635
#define STM32_UART_UART8_RX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
636
#define STM32_UART_UART8_TX_DMA_STREAM STM32_DMA_STREAM_ID_ANY
637
#define STM32_UART_USART1_DMA_PRIORITY 1
638
#define STM32_UART_USART2_DMA_PRIORITY 0
639
#define STM32_UART_USART3_DMA_PRIORITY 0
640
#define STM32_UART_UART4_DMA_PRIORITY 0
641
#define STM32_UART_UART5_DMA_PRIORITY 0
642
#define STM32_UART_USART6_DMA_PRIORITY 0
643
#define STM32_UART_UART7_DMA_PRIORITY 0
644
#define STM32_UART_UART8_DMA_PRIORITY 0
645
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
646
647
/*
648
* USB driver system settings.
649
*/
650
#define STM32_USB_USE_OTG1 TRUE
// FS, DFU_BOOT
651
#define STM32_USB_USE_OTG2 FALSE
// HS
652
#define STM32_USB_OTG1_IRQ_PRIORITY 14
653
#define STM32_USB_OTG2_IRQ_PRIORITY 14
654
#define STM32_USB_OTG1_RX_FIFO_SIZE 512
655
#define STM32_USB_OTG2_RX_FIFO_SIZE 512
656
#define STM32_USB_HOST_WAKEUP_DURATION 2
657
658
/*
659
* WDG driver system settings.
660
*/
661
#define STM32_WDG_USE_IWDG FALSE
662
663
/*
664
* WSPI driver system settings.
665
*/
666
#define STM32_WSPI_USE_QUADSPI1 FALSE
667
#define STM32_WSPI_QUADSPI1_PRESCALER_VALUE ((STM32_QSPICLK / HAL_QSPI1_CLK) - 1)
668
#define STM32_WSPI_SET_CR_SSHIFT TRUE
669
#define STM32_WSPI_QUADSPI1_MDMA_CHANNEL STM32_MDMA_CHANNEL_ID_ANY
670
#define STM32_WSPI_QUADSPI1_MDMA_PRIORITY 1
671
#define STM32_WSPI_MDMA_ERROR_HOOK(wspip) osalSysHalt("MDMA failure")
672
673
/*
674
sdlog message buffer and queue configuration
675
*/
676
#define SDLOG_QUEUE_BUCKETS 1024
677
#define SDLOG_MAX_MESSAGE_LEN 300
678
#define SDLOG_NUM_FILES 2
679
#define SDLOG_ALL_BUFFERS_SIZE (SDLOG_NUM_FILES*16*1024)
680
681
#endif
/* MCUCONF_H7_H */
sw
airborne
arch
chibios
mcuconf_h7.h
Generated on Mon Apr 27 2026 19:48:15 for Paparazzi UAS by
1.9.8