rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
hw_layer
ports
stm32
mcuconf_common_f4_f7.h
Go to the documentation of this file.
1
/**
2
* @file mcuconf_common_f4_f7.cpp
3
* @brief Common MCU definitions for both the STM32F4 and STM32F7
4
*
5
* @date Feb 18, 2021
6
* @author Matthew Kennedy
7
*/
8
9
#pragma once
10
11
#include "efifeatures.h"
12
13
/**
14
* This is about SingleTimerExecutor - rusEfi 12MHz precise scheduling timer
15
* this is not about ChibiOS virtual timer which rusEfi uses for
16
* periodicFastCallback and periodicSlowCallback
17
* See STM32_ST_IRQ_PRIORITY
18
*
19
* http://www.chibios.org/dokuwiki/doku.php?id=chibios:kb:priority
20
*/
21
#define PRECISE_SCHEDULING_TIMER_PRIORITY 4
22
/**
23
* Input Capture Unit is how we capture shaft position sensors output
24
*/
25
#define ICU_PRIORITY 3
26
27
/**
28
* UART DMA-mode byte capture (low latency)
29
*/
30
#define UART_DMA_IRQ_PRIORITY (PRECISE_SCHEDULING_TIMER_PRIORITY + 2)
31
32
/*
33
* SysTick driver system settings.
34
*/
35
#define STM32_ST_IRQ_PRIORITY 8
36
#define STM32_ST_USE_TIMER 2
37
38
/*
39
* ADC driver system settings.
40
*/
41
#define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4
42
43
#ifndef STM32_ADC_USE_ADC1
44
#define STM32_ADC_USE_ADC1 TRUE
45
#endif
/* STM32_ADC_USE_ADC1 */
46
47
#ifndef STM32_ADC_USE_ADC2
48
#define STM32_ADC_USE_ADC2 TRUE
49
#endif
/* STM32_ADC_USE_ADC2 */
50
51
#ifndef STM32_ADC_USE_ADC3
52
#define STM32_ADC_USE_ADC3 FALSE
53
#endif
/* STM32_ADC_USE_ADC3 */
54
55
#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(2, 4)
56
#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
57
#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
58
#define STM32_ADC_ADC1_DMA_PRIORITY 3
59
#define STM32_ADC_ADC2_DMA_PRIORITY 3
60
#define STM32_ADC_ADC3_DMA_PRIORITY 3
61
#define STM32_ADC_IRQ_PRIORITY PRECISE_SCHEDULING_TIMER_PRIORITY + 2
62
#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY PRECISE_SCHEDULING_TIMER_PRIORITY + 2
63
#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY PRECISE_SCHEDULING_TIMER_PRIORITY + 2
64
#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY PRECISE_SCHEDULING_TIMER_PRIORITY + 2
65
66
/*
67
* CAN driver system settings.
68
*/
69
#ifndef STM32_CAN_USE_CAN1
70
#define STM32_CAN_USE_CAN1 TRUE
71
#endif
72
73
#ifndef STM32_CAN_USE_CAN2
74
#define STM32_CAN_USE_CAN2 TRUE
75
#endif
76
77
#ifndef STM32_CAN_USE_CAN3
78
#define STM32_CAN_USE_CAN3 FALSE
79
#endif
80
81
#define STM32_CAN_CAN1_IRQ_PRIORITY PRECISE_SCHEDULING_TIMER_PRIORITY + 7
82
#define STM32_CAN_CAN2_IRQ_PRIORITY PRECISE_SCHEDULING_TIMER_PRIORITY + 7
83
#define STM32_CAN_CAN3_IRQ_PRIORITY PRECISE_SCHEDULING_TIMER_PRIORITY + 7
84
85
/*
86
* DAC driver system settings.
87
*/
88
#define STM32_DAC_DUAL_MODE FALSE
89
#ifndef STM32_DAC_USE_DAC1_CH1
90
#define STM32_DAC_USE_DAC1_CH1 FALSE
91
#endif
92
#ifndef STM32_DAC_USE_DAC1_CH2
93
#define STM32_DAC_USE_DAC1_CH2 FALSE
94
#endif
95
#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY PRECISE_SCHEDULING_TIMER_PRIORITY + 6
96
#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY PRECISE_SCHEDULING_TIMER_PRIORITY + 6
97
#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
98
#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
99
#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
100
#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
101
102
/*
103
* EXT driver system settings.
104
*/
105
106
#define STM32_DISABLE_EXTI0_HANDLER
107
#define STM32_DISABLE_EXTI1_HANDLER
108
#define STM32_DISABLE_EXTI2_HANDLER
109
#define STM32_DISABLE_EXTI3_HANDLER
110
#define STM32_DISABLE_EXTI4_HANDLER
111
#define STM32_DISABLE_EXTI5_9_HANDLER
112
#define STM32_DISABLE_EXTI10_15_HANDLER
113
114
// we hijack this interrupt handler as the EXTI chained handler, see digital_input_exti.cpp
115
#define STM32_I2C_I2C1_IRQ_PRIORITY ICU_PRIORITY
116
117
/*
118
* IRQ system settings.
119
*/
120
#define STM32_IRQ_EXTI_PRIORITY CORTEX_MAXIMUM_PRIORITY
121
#define STM32_IRQ_EXTI0_PRIORITY STM32_IRQ_EXTI_PRIORITY
122
#define STM32_IRQ_EXTI1_PRIORITY STM32_IRQ_EXTI_PRIORITY
123
#define STM32_IRQ_EXTI2_PRIORITY STM32_IRQ_EXTI_PRIORITY
124
#define STM32_IRQ_EXTI3_PRIORITY STM32_IRQ_EXTI_PRIORITY
125
#define STM32_IRQ_EXTI4_PRIORITY STM32_IRQ_EXTI_PRIORITY
126
#define STM32_IRQ_EXTI5_9_PRIORITY STM32_IRQ_EXTI_PRIORITY
127
#define STM32_IRQ_EXTI10_15_PRIORITY STM32_IRQ_EXTI_PRIORITY
128
#define STM32_IRQ_EXTI16_PRIORITY 15
129
#define STM32_IRQ_EXTI17_PRIORITY 15
/* why? */
130
#define STM32_IRQ_EXTI18_PRIORITY 15
131
#define STM32_IRQ_EXTI19_PRIORITY 15
132
#define STM32_IRQ_EXTI20_PRIORITY 15
133
#define STM32_IRQ_EXTI21_PRIORITY 15
/* why? */
134
#define STM32_IRQ_EXTI22_PRIORITY 15
/* why? */
135
#define STM32_IRQ_EXTI23_PRIORITY 15
136
137
#define STM32_IRQ_TIM1_BRK_TIM9_PRIORITY 7
138
#define STM32_IRQ_TIM1_UP_TIM10_PRIORITY 7
139
#define STM32_IRQ_TIM1_TRGCO_TIM11_PRIORITY 7
140
#define STM32_IRQ_TIM1_CC_PRIORITY 7
141
#define STM32_IRQ_TIM2_PRIORITY 7
142
#define STM32_IRQ_TIM3_PRIORITY 7
143
#define STM32_IRQ_TIM4_PRIORITY 7
144
#define STM32_IRQ_TIM5_PRIORITY 7
145
#define STM32_IRQ_TIM6_PRIORITY 7
146
#define STM32_IRQ_TIM7_PRIORITY 7
147
#define STM32_IRQ_TIM8_BRK_TIM12_PRIORITY 7
148
#define STM32_IRQ_TIM8_UP_TIM13_PRIORITY 7
149
#define STM32_IRQ_TIM8_TRGCO_TIM14_PRIORITY 7
150
#define STM32_IRQ_TIM8_CC_PRIORITY 7
151
152
/*
153
* GPT driver system settings.
154
*/
155
#define STM32_GPT_USE_TIM1 FALSE
156
#define STM32_GPT_USE_TIM2 FALSE
157
#define STM32_GPT_USE_TIM3 FALSE
158
#define STM32_GPT_USE_TIM4 FALSE
159
#define STM32_GPT_USE_TIM5 FALSE
160
#define STM32_GPT_USE_TIM6 TRUE
161
#define STM32_GPT_USE_TIM7 FALSE
162
#define STM32_GPT_USE_TIM8 FALSE
163
#define STM32_GPT_USE_TIM9 FALSE
164
#define STM32_GPT_USE_TIM11 FALSE
165
#define STM32_GPT_USE_TIM12 FALSE
166
#define STM32_GPT_USE_TIM14 FALSE
167
168
/*
169
* I2C driver system settings.
170
*/
171
#ifndef STM32_I2C_USE_I2C1
172
#define STM32_I2C_USE_I2C1 FALSE
173
#endif
174
175
#ifndef STM32_I2C_USE_I2C2
176
/* PB10/PB11 like some Hellen likes AF4 */
177
#define STM32_I2C_USE_I2C2 TRUE
178
#endif
179
180
#ifndef STM32_I2C_USE_I2C3
181
// PC9 I2C3_SDA AF4
182
// PA8 I2C3_SCL AF4
183
#define STM32_I2C_USE_I2C3 FALSE
184
#endif
185
186
#ifndef STM32_I2C_USE_I2C4
187
#define STM32_I2C_USE_I2C4 FALSE
188
#endif
189
190
#define STM32_I2C_BUSY_TIMEOUT 50
191
#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
192
#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
193
#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
194
#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
195
#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
196
#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
197
#define STM32_I2C_I2C4_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
198
#define STM32_I2C_I2C4_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
199
#define STM32_I2C_I2C2_IRQ_PRIORITY 5
200
#define STM32_I2C_I2C3_IRQ_PRIORITY 5
201
#define STM32_I2C_I2C4_IRQ_PRIORITY 5
202
#define STM32_I2C_I2C1_DMA_PRIORITY 3
203
#define STM32_I2C_I2C2_DMA_PRIORITY 3
204
#define STM32_I2C_I2C3_DMA_PRIORITY 3
205
#define STM32_I2C_I2C4_DMA_PRIORITY 3
206
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
207
208
/*
209
* ICU driver system settings.
210
*/
211
#ifndef STM32_ICU_USE_TIM1
212
#define STM32_ICU_USE_TIM1 FALSE
213
#endif
214
215
#ifndef STM32_ICU_USE_TIM2
216
#define STM32_ICU_USE_TIM2 TRUE
217
#endif
218
219
#ifndef STM32_ICU_USE_TIM3
220
#define STM32_ICU_USE_TIM3 FALSE
221
#endif
222
223
#ifndef STM32_ICU_USE_TIM4
224
#define STM32_ICU_USE_TIM4 FALSE
225
#endif
226
227
#ifndef STM32_ICU_USE_TIM5
228
#define STM32_ICU_USE_TIM5 FALSE
229
#endif
230
231
#ifndef STM32_ICU_USE_TIM8
232
#define STM32_ICU_USE_TIM8 FALSE
233
#endif
234
235
#ifndef STM32_ICU_USE_TIM9
236
#define STM32_ICU_USE_TIM9 FALSE
237
#endif
238
239
#define STM32_ICU_TIM1_IRQ_PRIORITY ICU_PRIORITY
240
#define STM32_ICU_TIM2_IRQ_PRIORITY ICU_PRIORITY
241
#define STM32_ICU_TIM3_IRQ_PRIORITY ICU_PRIORITY
242
#define STM32_ICU_TIM4_IRQ_PRIORITY ICU_PRIORITY
243
#define STM32_ICU_TIM5_IRQ_PRIORITY ICU_PRIORITY
244
#define STM32_ICU_TIM8_IRQ_PRIORITY ICU_PRIORITY
245
#define STM32_ICU_TIM9_IRQ_PRIORITY ICU_PRIORITY
246
247
/*
248
* MAC driver system settings.
249
*/
250
#define STM32_MAC_TRANSMIT_BUFFERS 2
251
#define STM32_MAC_RECEIVE_BUFFERS 4
252
#define STM32_MAC_BUFFERS_SIZE 1522
253
#define STM32_MAC_PHY_TIMEOUT 100
254
#define STM32_MAC_ETH1_CHANGE_PHY_STATE TRUE
255
#define STM32_MAC_ETH1_IRQ_PRIORITY 13
256
#define STM32_MAC_IP_CHECKSUM_OFFLOAD 3
257
258
/*
259
* PWM driver system settings.
260
*/
261
#ifndef STM32_PWM_USE_TIM1
262
#define STM32_PWM_USE_TIM1 TRUE
263
#endif
264
265
#ifndef STM32_PWM_USE_TIM2
266
#define STM32_PWM_USE_TIM2 FALSE
267
#endif
268
269
#ifndef STM32_PWM_USE_TIM3
270
// Hellen often uses TIM3 for ETB
271
#define STM32_PWM_USE_TIM3 TRUE
272
#endif
273
274
#ifndef STM32_PWM_USE_TIM4
275
#define STM32_PWM_USE_TIM4 TRUE
276
#endif
277
278
#ifndef STM32_PWM_USE_TIM5
279
#define STM32_PWM_USE_TIM5 TRUE
280
#endif
281
282
#ifndef STM32_PWM_USE_TIM8
283
#define STM32_PWM_USE_TIM8 TRUE
284
#endif
285
286
#ifndef STM32_PWM_USE_TIM9
287
#define STM32_PWM_USE_TIM9 FALSE
288
#endif
289
290
#define STM32_PWM_TIM1_IRQ_PRIORITY 7
291
#define STM32_PWM_TIM2_IRQ_PRIORITY 7
292
#define STM32_PWM_TIM3_IRQ_PRIORITY 7
293
#define STM32_PWM_TIM4_IRQ_PRIORITY 7
294
#define STM32_PWM_TIM5_IRQ_PRIORITY PRECISE_SCHEDULING_TIMER_PRIORITY
295
#define STM32_PWM_TIM8_IRQ_PRIORITY 7
296
#define STM32_PWM_TIM9_IRQ_PRIORITY 7
297
298
/*
299
* SERIAL driver system settings.
300
*/
301
#ifndef STM32_SERIAL_USE_USART1
302
#define STM32_SERIAL_USE_USART1 FALSE
303
#endif
304
305
#ifndef STM32_SERIAL_USE_USART2
306
#define STM32_SERIAL_USE_USART2 FALSE
307
#endif
308
309
#ifndef STM32_SERIAL_USE_USART3
310
#define STM32_SERIAL_USE_USART3 FALSE
311
#endif
312
313
#ifndef STM32_SERIAL_USE_UART4
314
#define STM32_SERIAL_USE_UART4 FALSE
315
#endif
316
317
#ifndef STM32_SERIAL_USE_UART5
318
#define STM32_SERIAL_USE_UART5 FALSE
319
#endif
320
321
#ifndef STM32_SERIAL_USE_USART6
322
#define STM32_SERIAL_USE_USART6 TRUE
323
#endif
324
325
#define STM32_SERIAL_USE_UART7 FALSE
326
#define STM32_SERIAL_USE_UART8 FALSE
327
#define STM32_IRQ_USART1_PRIORITY (PRECISE_SCHEDULING_TIMER_PRIORITY + 2)
328
#define STM32_IRQ_USART2_PRIORITY (PRECISE_SCHEDULING_TIMER_PRIORITY + 2)
329
#define STM32_IRQ_USART3_PRIORITY (PRECISE_SCHEDULING_TIMER_PRIORITY + 2)
330
#define STM32_IRQ_UART4_PRIORITY (PRECISE_SCHEDULING_TIMER_PRIORITY + 2)
331
#define STM32_IRQ_UART5_PRIORITY (PRECISE_SCHEDULING_TIMER_PRIORITY + 2)
332
#define STM32_IRQ_USART6_PRIORITY (PRECISE_SCHEDULING_TIMER_PRIORITY + 2)
333
#define STM32_IRQ_UART7_PRIORITY (PRECISE_SCHEDULING_TIMER_PRIORITY + 2)
334
#define STM32_IRQ_UART8_PRIORITY (PRECISE_SCHEDULING_TIMER_PRIORITY + 2)
335
336
/*
337
* SPI driver system settings.
338
*/
339
#ifndef STM32_SPI_USE_SPI1
340
#define STM32_SPI_USE_SPI1 TRUE
341
#endif
342
343
#ifndef STM32_SPI_USE_SPI2
344
#define STM32_SPI_USE_SPI2 TRUE
345
#endif
346
347
#ifndef STM32_SPI_USE_SPI3
348
#define STM32_SPI_USE_SPI3 TRUE
349
#endif
350
351
#ifndef STM32_SPI_USE_SPI4
352
#define STM32_SPI_USE_SPI4 FALSE
353
#endif
354
355
#ifndef STM32_SPI_USE_SPI5
356
#define STM32_SPI_USE_SPI5 FALSE
357
#endif
358
359
#ifndef STM32_SPI_USE_SPI6
360
#define STM32_SPI_USE_SPI6 FALSE
361
#endif
362
363
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0)
364
#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
365
#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
366
#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
367
#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
368
#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
369
#define STM32_SPI_SPI4_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0)
370
#define STM32_SPI_SPI4_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
371
#define STM32_SPI_SPI5_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
372
/* STM32_DMA_STREAM_ID(2, 4) is used by ADC1 */
373
//#define STM32_SPI_SPI5_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 4)
374
#define STM32_SPI_SPI5_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 6)
375
#define STM32_SPI_SPI6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 6)
376
#define STM32_SPI_SPI6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
377
#define STM32_SPI_SPI1_DMA_PRIORITY 1
378
#define STM32_SPI_SPI2_DMA_PRIORITY 1
379
#define STM32_SPI_SPI3_DMA_PRIORITY 1
380
#define STM32_SPI_SPI4_DMA_PRIORITY 1
381
#define STM32_SPI_SPI5_DMA_PRIORITY 1
382
#define STM32_SPI_SPI6_DMA_PRIORITY 1
383
#define STM32_SPI_SPI1_IRQ_PRIORITY 10
384
#define STM32_SPI_SPI2_IRQ_PRIORITY 10
385
#define STM32_SPI_SPI3_IRQ_PRIORITY 10
386
#define STM32_SPI_SPI4_IRQ_PRIORITY 10
387
#define STM32_SPI_SPI5_IRQ_PRIORITY 10
388
#define STM32_SPI_SPI6_IRQ_PRIORITY 10
389
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
390
391
/*
392
* UART driver system settings.
393
*/
394
#ifndef STM32_UART_USE_USART1
395
#define STM32_UART_USE_USART1 FALSE
396
#endif
397
398
#ifndef STM32_UART_USE_USART2
399
#define STM32_UART_USE_USART2 FALSE
400
#endif
401
402
#ifndef STM32_UART_USE_USART3
403
#define STM32_UART_USE_USART3 TRUE
404
#endif
405
406
#define STM32_UART_USE_UART4 FALSE
407
#define STM32_UART_USE_UART5 FALSE
408
#define STM32_UART_USE_USART6 FALSE
409
#define STM32_UART_USE_UART7 FALSE
410
411
#ifndef STM32_UART_USE_UART8
412
#define STM32_UART_USE_UART8 FALSE
413
#endif
414
415
#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
416
#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7)
417
#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
418
#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
419
#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
420
#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
421
#define STM32_UART_UART4_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
422
#define STM32_UART_UART4_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
423
#define STM32_UART_UART5_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
424
#define STM32_UART_UART5_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
425
#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
426
#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7)
427
#define STM32_UART_UART7_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
428
#define STM32_UART_UART7_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
429
#define STM32_UART_UART8_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
430
#define STM32_UART_UART8_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
431
#define STM32_UART_USART1_IRQ_PRIORITY UART_DMA_IRQ_PRIORITY
432
#define STM32_UART_USART2_IRQ_PRIORITY UART_DMA_IRQ_PRIORITY
433
#define STM32_UART_USART3_IRQ_PRIORITY UART_DMA_IRQ_PRIORITY
434
#define STM32_UART_UART4_IRQ_PRIORITY UART_DMA_IRQ_PRIORITY
435
#define STM32_UART_UART5_IRQ_PRIORITY UART_DMA_IRQ_PRIORITY
436
#define STM32_UART_USART6_IRQ_PRIORITY UART_DMA_IRQ_PRIORITY
437
#define STM32_UART_USART1_DMA_PRIORITY 0
438
#define STM32_UART_USART2_DMA_PRIORITY 0
439
#define STM32_UART_USART3_DMA_PRIORITY 0
440
#define STM32_UART_UART4_DMA_PRIORITY 0
441
#define STM32_UART_UART5_DMA_PRIORITY 0
442
#define STM32_UART_USART6_DMA_PRIORITY 0
443
#define STM32_UART_UART7_DMA_PRIORITY 0
444
#define STM32_UART_UART8_DMA_PRIORITY 0
445
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
446
447
/*
448
* USB driver system settings.
449
*/
450
#ifndef STM32_USB_USE_OTG1
451
#define STM32_USB_USE_OTG1 TRUE
452
#endif
453
454
#ifndef STM32_USB_USE_OTG2
455
#define STM32_USB_USE_OTG2 FALSE
456
#endif
457
458
#define STM32_USB_OTG1_IRQ_PRIORITY 14
459
#define STM32_USB_OTG2_IRQ_PRIORITY 14
460
#define STM32_USB_OTG1_RX_FIFO_SIZE 512
461
#define STM32_USB_OTG2_RX_FIFO_SIZE 1024
462
#define STM32_USB_OTG_THREAD_STACK_SIZE 1024
463
#define STM32_USB_OTGFIFO_FILL_BASEPRI 0
464
465
/*
466
* WDG driver system settings.
467
*/
468
#ifndef STM32_WDG_USE_IWDG
469
#define STM32_WDG_USE_IWDG TRUE
470
#endif
471
472
/* Some boards need to know clock early on boot.
473
* F429-Discovery board configures clock and then SDRAM early on boot */
474
#ifndef STM32_HSECLK
475
// Some boards has no HSE oscillator at all and obviously disable HSE detections
476
#ifndef ENABLE_AUTO_DETECT_HSE
477
// Pretend we have a 25MHz external crystal. This value isn't actually used since we
478
// configure the PLL to start on the HSI oscillator, then compute HSE's speed at runtime
479
// and reconfigure the PLL appropriately.
480
#define STM32_HSECLK 25000000
481
482
// After boot, we will detect the real frequency, and adjust the PLL M value to suit
483
#define ENABLE_AUTO_DETECT_HSE TRUE
484
#endif
485
#endif
Generated on Sat Sep 27 2025 00:10:07 for rusEFI by
1.9.8