rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
config
stm32f4ems
efifeatures.h
Go to the documentation of this file.
1
/**
2
* @file efifeatures.h
3
*
4
* @brief In this header we can configure which firmware modules are used.
5
* See config/boards which are often overriding some of the defaults via .mk and/or .env files
6
*
7
* @date Aug 29, 2013
8
* @author Andrey Belomutskiy, (c) 2012-2020
9
*/
10
11
#pragma once
12
13
#include <rusefi/true_false.h>
14
15
#define EFI_GPIO_HARDWARE TRUE
16
17
#ifndef SENT_CHANNELS_NUM
18
#define SENT_CHANNELS_NUM 1
19
#endif
20
21
#ifndef EFI_BOOST_CONTROL
22
#define EFI_BOOST_CONTROL TRUE
23
#endif
24
25
#ifndef EFI_BOSCH_YAW
26
#define EFI_BOSCH_YAW FALSE
27
#endif
28
29
#ifndef EFI_WIFI
30
#define EFI_WIFI FALSE
31
#endif
32
33
#ifndef EFI_WS2812
34
#define EFI_WS2812 FALSE
35
#endif
36
37
#ifndef EFI_DAC
38
#define EFI_DAC FALSE
39
#endif
40
41
#ifndef EFI_LAUNCH_CONTROL
42
#define EFI_LAUNCH_CONTROL TRUE
43
#endif
44
45
/* Long Term Fuel Trims */
46
#ifndef EFI_LTFT_CONTROL
47
#define EFI_LTFT_CONTROL TRUE
48
#endif
49
50
#ifndef EFI_STORAGE_SD
51
// Lets try saving LTFT trims on SD card by default
52
#define EFI_STORAGE_SD TRUE
53
#endif
54
55
#ifndef EFI_ANTILAG_SYSTEM
56
#define EFI_ANTILAG_SYSTEM TRUE
57
#endif
58
59
#ifndef EFI_BACKUP_SRAM
60
#define EFI_BACKUP_SRAM TRUE
61
#endif
62
63
#ifndef EFI_HELLA_OIL
64
#define EFI_HELLA_OIL FALSE
65
#endif
66
67
#ifndef EFI_USE_OPENBLT
68
#define EFI_USE_OPENBLT FALSE
69
#endif
70
71
#ifndef EFI_ETHERNET
72
#define EFI_ETHERNET FALSE
73
#endif
74
75
#ifndef EFI_DFU_JUMP
76
#define EFI_DFU_JUMP TRUE
77
#endif
78
79
#ifndef EFI_BOR_LEVEL
80
#define EFI_BOR_LEVEL TRUE
81
#endif
82
83
#ifndef EFI_DYNO_VIEW
84
#define EFI_DYNO_VIEW TRUE
85
#endif
86
87
#ifndef EFI_CDM_INTEGRATION
88
#define EFI_CDM_INTEGRATION FALSE
89
#endif
90
91
#ifndef EFI_TOOTH_LOGGER
92
#define EFI_TOOTH_LOGGER TRUE
93
#endif
94
95
#ifndef EFI_TEXT_LOGGING
96
#define EFI_TEXT_LOGGING TRUE
97
#endif
98
99
#define EFI_ACTIVE_CONFIGURATION_IN_FLASH FALSE
100
101
#ifndef EFI_MC33816
102
#define EFI_MC33816 FALSE
103
#endif
104
105
#ifndef EFI_HPFP
106
#define EFI_HPFP TRUE
107
#endif
108
109
#ifndef EFI_HD_ACR
110
#define EFI_HD_ACR FALSE
111
#endif
112
113
114
/**
115
* if you have a 60-2 trigger, or if you just want better performance, you
116
* probably want EFI_ENABLE_ASSERTS to be FALSE. Also you would probably want to FALSE
117
* CH_DBG_ENABLE_CHECKS
118
* CH_DBG_ENABLE_ASSERTS
119
* in chconf.h
120
*
121
*/
122
#if !defined(EFI_ENABLE_ASSERTS)
123
#define EFI_ENABLE_ASSERTS TRUE
124
#endif
/* EFI_ENABLE_ASSERTS */
125
126
#ifndef EFI_CLOCK_LOCKS
127
#define EFI_CLOCK_LOCKS TRUE
128
#endif
129
130
//#define EFI_UART_ECHO_TEST_MODE TRUE
131
132
/**
133
* Build-in logic analyzer support. Logic analyzer viewer is one of the java console panes.
134
*/
135
#ifndef EFI_LOGIC_ANALYZER
136
#define EFI_LOGIC_ANALYZER TRUE
137
#endif
138
139
#ifndef HAL_TRIGGER_USE_PAL
140
#define HAL_TRIGGER_USE_PAL TRUE
141
#endif
/* HAL_TRIGGER_USE_PAL */
142
143
#ifndef HAL_TRIGGER_USE_ADC
144
#define HAL_TRIGGER_USE_ADC FALSE
145
#endif
/* HAL_TRIGGER_USE_ADC */
146
147
/**
148
* TunerStudio support.
149
*/
150
#ifndef EFI_TUNER_STUDIO
151
#define EFI_TUNER_STUDIO TRUE
152
#endif
153
154
#ifndef EFI_TS_SCATTER
155
#define EFI_TS_SCATTER TRUE
156
#endif
157
158
/**
159
* Bluetooth UART setup support.
160
*/
161
#ifndef EFI_BLUETOOTH_SETUP
162
#define EFI_BLUETOOTH_SETUP TRUE
163
#endif
/* EFI_BLUETOOTH_SETUP */
164
165
/**
166
* TunerStudio debug output
167
*/
168
#define EFI_TUNER_STUDIO_VERBOSE TRUE
169
170
#define EFI_DETAILED_LOGGING FALSE
171
172
/**
173
* Dev console support.
174
*/
175
#ifndef EFI_CLI_SUPPORT
176
#define EFI_CLI_SUPPORT TRUE
177
#endif
178
179
#ifndef EFI_RTC
180
#define EFI_RTC TRUE
181
#endif
182
183
#ifndef EFI_ALTERNATOR_CONTROL
184
#define EFI_ALTERNATOR_CONTROL TRUE
185
#endif
186
187
#ifndef EFI_VVT_PID
188
#define EFI_VVT_PID TRUE
189
#endif
190
191
#define EFI_SIGNAL_EXECUTOR_SLEEP FALSE
192
#define EFI_SIGNAL_EXECUTOR_ONE_TIMER TRUE
193
194
#define FUEL_MATH_EXTREME_LOGGING FALSE
195
196
#define SPARK_EXTREME_LOGGING FALSE
197
198
#define TRIGGER_EXTREME_LOGGING FALSE
199
200
#ifndef ROTATIONAL_IDLE_CONTROLLER
201
#define ROTATIONAL_IDLE_CONTROLLER TRUE
202
#endif
203
204
/**
205
* Store configuration as raw binary to internal flash (two copies if there is enough flash)
206
* No wear leveling, one copy occupie whole sector erased on each update
207
* Legacy, should be replaced with EFI_STORAGE_MFS
208
*/
209
#ifndef EFI_STORAGE_INT_FLASH
210
// historically we've started with low-level flash access with our own redundancy logic
211
// todo: migrate to EFI_STORAGE_MFS which provides same functionality and more!
212
#define EFI_STORAGE_INT_FLASH TRUE
213
#endif
214
215
/**
216
* ChibiOS Managed Flash Storage
217
* Can store finite number of records, can update/add while there is free space in bank.
218
* Recover from power loss
219
*/
220
#ifndef EFI_STORAGE_MFS
221
// todo: this higher level API should replace EFI_STORAGE_INT_FLASH legacy implementation
222
#define EFI_STORAGE_MFS FALSE
223
#endif
224
225
/**
226
* Store settings/calibrations/learning to SD card as a files
227
*/
228
#ifndef EFI_STORAGE_SD
229
#define EFI_STORAGE_SD FALSE
230
#endif
231
232
/**
233
* Controlled defined to TRUE by USE_FATFS=yes in board mk file
234
*/
235
#ifndef EFI_SUPPORT_FATFS
236
#define EFI_SUPPORT_FATFS FALSE
237
#endif
238
239
/**
240
* Usually you need shaft position input, but maybe you do not need it?
241
*/
242
#ifndef EFI_SHAFT_POSITION_INPUT
243
#define EFI_SHAFT_POSITION_INPUT TRUE
244
#endif
245
246
/**
247
* Maybe we are just sniffing what's going on?
248
* EFI_ENGINE_CONTROL is covering injectors and spark control
249
*/
250
#ifndef EFI_ENGINE_CONTROL
251
#define EFI_ENGINE_CONTROL TRUE
252
#endif
253
254
/**
255
* MCP42010 digital potentiometer support. This could be useful if you are stimulating some
256
* stock ECU
257
*/
258
#ifndef EFI_POTENTIOMETER
259
#define EFI_POTENTIOMETER FALSE
260
#endif
261
262
#ifndef BOARD_TLE6240_COUNT
263
#define BOARD_TLE6240_COUNT 0
264
#endif
265
266
#ifndef BOARD_MC33972_COUNT
267
#define BOARD_MC33972_COUNT 0
268
#endif
269
270
#ifndef BOARD_TLE8888_COUNT
271
#define BOARD_TLE8888_COUNT 0
272
#endif
273
274
#ifndef BOARD_L9779_COUNT
275
#define BOARD_L9779_COUNT 0
276
#endif
277
278
#ifndef BOARD_DRV8860_COUNT
279
#define BOARD_DRV8860_COUNT 0
280
#endif
281
282
#ifndef BOARD_MC33810_COUNT
283
#define BOARD_MC33810_COUNT 0
284
#endif
285
286
#ifndef BOARD_TLE9104_COUNT
287
#define BOARD_TLE9104_COUNT 0
288
#endif
289
290
#ifndef BOARD_TLE9201_COUNT
291
#define BOARD_TLE9201_COUNT 0
292
#endif
293
294
#define EFI_ANALOG_SENSORS TRUE
295
296
#ifndef EFI_MAX_31855
297
#define EFI_MAX_31855 FALSE
298
#endif
299
300
#define EFI_MCP_3208 FALSE
301
302
#if !defined(EFI_ONBOARD_MEMS)
303
#define EFI_ONBOARD_MEMS FALSE
304
#endif
305
306
#ifndef EFI_INTERNAL_ADC
307
#define EFI_INTERNAL_ADC TRUE
308
#endif
309
310
#define EFI_USE_FAST_ADC TRUE
311
312
#ifndef EFI_CAN_SUPPORT
313
#define EFI_CAN_SUPPORT TRUE
314
#endif
315
316
#if !defined(EFI_CAN_SERIAL) && EFI_CAN_SUPPORT
317
#define EFI_CAN_SERIAL TRUE
318
#endif
319
320
#if !defined(EFI_CAN_GPIO) && EFI_CAN_SUPPORT
321
// see CAN_PIN_0
322
#define EFI_CAN_GPIO TRUE
323
#endif
324
325
#ifndef EFI_WIDEBAND_FIRMWARE_UPDATE
326
#define EFI_WIDEBAND_FIRMWARE_UPDATE TRUE
327
#endif
328
329
#ifndef EFI_IDLE_CONTROL
330
#define EFI_IDLE_CONTROL TRUE
331
#endif
332
333
#ifndef EFI_IDLE_PID_CIC
334
#define EFI_IDLE_PID_CIC TRUE
335
#endif
336
337
/**
338
* Control the main power relay based on measured ignition voltage (Vbatt)
339
*/
340
#ifndef EFI_MAIN_RELAY_CONTROL
341
#define EFI_MAIN_RELAY_CONTROL TRUE
342
#endif
343
344
#ifndef EFI_VEHICLE_SPEED
345
#define EFI_VEHICLE_SPEED TRUE
346
#endif
347
348
#ifndef EFI_TCU
349
#define EFI_TCU FALSE
350
#endif
351
352
#ifndef EFI_ENGINE_EMULATOR
353
#define EFI_ENGINE_EMULATOR TRUE
354
#endif
355
356
#ifndef EFI_EMULATE_POSITION_SENSORS
357
#define EFI_EMULATE_POSITION_SENSORS TRUE
358
#endif
359
360
/**
361
* Do we need file logging (like SD card) logic?
362
* See also USE_FATFS
363
*/
364
#ifndef EFI_FILE_LOGGING
365
#define EFI_FILE_LOGGING TRUE
366
#endif
367
368
#ifndef EFI_EMBED_INI_MSD
369
#define EFI_EMBED_INI_MSD TRUE
370
#endif
371
372
#ifndef EFI_USB_SERIAL
373
#define EFI_USB_SERIAL TRUE
374
#endif
375
376
#define EFI_CONSOLE_USB_DEVICE SDU1
377
378
#if defined(EFI_HAS_EXT_SDRAM)
379
#ifndef ENABLE_PERF_TRACE
380
#define ENABLE_PERF_TRACE TRUE
381
#endif
// ENABLE_PERF_TRACE
382
#define LUA_EXTRA_HEAP (1 * 1024 * 1024)
383
#elif defined(EFI_IS_F42x)
384
// F42x has more memory, so we can:
385
// - use compressed USB MSD image (requires 32k of memory)
386
// - use perf trace (requires ~16k of memory)
387
// - use spectorgram (requires ~12k of memory), need disable perf trace or compressed USB MSD image
388
#ifndef KNOCK_SPECTROGRAM
389
#ifndef EFI_USE_COMPRESSED_INI_MSD
390
#define EFI_USE_COMPRESSED_INI_MSD TRUE
391
#endif
392
#endif
393
#define ENABLE_PERF_TRACE TRUE
394
#else
395
#ifndef ENABLE_PERF_TRACE
396
// small memory F40x can't fit perf trace
397
#define ENABLE_PERF_TRACE FALSE
398
#endif
// ENABLE_PERF_TRACE
399
#endif
400
401
#ifndef EFI_USE_COMPRESSED_INI_MSD
402
#define EFI_USE_COMPRESSED_INI_MSD FALSE
403
#endif
404
405
#ifndef EFI_LUA
406
#define EFI_LUA TRUE
407
#endif
408
409
#ifndef FULL_SD_LOGS
410
// reduce RAM usage? todo: optimize RAM consumption so that all builds have full logs?
411
#define FULL_SD_LOGS FALSE
412
#endif
413
414
#ifndef EFI_LUA_LOOKUP
415
#define EFI_LUA_LOOKUP TRUE
416
#endif
417
418
#ifndef EFI_ENGINE_SNIFFER
419
#define EFI_ENGINE_SNIFFER TRUE
420
#endif
421
422
#define EFI_HISTOGRAMS FALSE
423
424
425
#ifndef EFI_PERF_METRICS
426
#define EFI_PERF_METRICS FALSE
427
#endif
428
429
#ifndef DL_OUTPUT_BUFFER
430
#define DL_OUTPUT_BUFFER 6500
431
#endif
432
433
/**
434
* Do we need GPS logic?
435
*/
436
#ifndef EFI_UART_GPS
437
#define EFI_UART_GPS FALSE
438
#endif
439
440
#ifndef EFI_ELECTRONIC_THROTTLE_BODY
441
#define EFI_ELECTRONIC_THROTTLE_BODY TRUE
442
#endif
443
444
/**
445
* Do we need Malfunction Indicator blinking logic?
446
*/
447
#ifndef EFI_MALFUNCTION_INDICATOR
448
#define EFI_MALFUNCTION_INDICATOR FALSE
449
#endif
450
451
#ifndef CONSOLE_MAX_ACTIONS
452
#define CONSOLE_MAX_ACTIONS 180
453
#endif
454
455
#ifndef EFI_MAP_AVERAGING
456
#define EFI_MAP_AVERAGING TRUE
457
#endif
458
459
// todo: most of this should become configurable
460
461
// TODO: switch to continuous ADC conversion for fast ADC?
462
// NOTE: GPT mode triggers ADC convertion through IRQ
463
#define EFI_INTERNAL_FAST_ADC_GPT &GPTD6
464
// NOTE: PWM mode triggers ADC convertion through hardware ADC trigger
465
//#define EFI_INTERNAL_FAST_ADC_PWM &PWMD8
466
467
// Continuously run internal ADC in background for all channels
468
// Do averaging in thread with no sync with convertion end
469
#define EFI_INTERNAL_SLOW_ADC_BACKGROUND TRUE
470
471
#define EFI_SPI1_AF 5
472
#define EFI_SPI2_AF 5
473
#define EFI_SPI3_AF 6
474
#define EFI_SPI4_AF 5
475
#define EFI_SPI5_AF 5
476
#define EFI_SPI6_AF 6
477
478
/**
479
* Patched version of ChibiOS/RT support extra details in the system error messages
480
*/
481
#define EFI_CUSTOM_PANIC_METHOD TRUE
482
483
#define ADC_CHANNEL_VREF ADC_CHANNEL_IN14
484
485
/**
486
* currently ChibiOS uses only first and second channels of each timer for input capture
487
*
488
* So, our options are:
489
*
490
* TIM2_CH1
491
* PA5
492
*
493
* TIM4_CH1
494
* PB6
495
* PD12
496
*
497
* TIM9_CH1
498
* PE5
499
*/
500
501
#ifndef EFI_USE_UART_DMA
502
#define EFI_USE_UART_DMA FALSE
503
#endif
504
505
#ifndef AUX_SERIAL_DEVICE
506
#define AUX_SERIAL_DEVICE (&SD6)
507
#endif
508
509
#ifndef EFI_CONSOLE_TX_BRAIN_PIN
510
#define EFI_CONSOLE_TX_BRAIN_PIN Gpio::C10
511
#endif
512
513
#ifndef EFI_CONSOLE_RX_BRAIN_PIN
514
#define EFI_CONSOLE_RX_BRAIN_PIN Gpio::C11
515
#endif
516
// todo: this should be detected automatically based on pin selection
517
// https://github.com/rusefi/rusefi/issues/3536
518
#ifndef EFI_CONSOLE_AF
519
#define EFI_CONSOLE_AF 7
520
#endif
521
522
// Rx pin should have either internal either external pull up to avoid floating and receiving random garbage
523
#ifndef EFI_CONSOLE_RX_BRAIN_PIN_MODE
524
#define EFI_CONSOLE_RX_BRAIN_PIN_MODE (PAL_MODE_ALTERNATE(EFI_CONSOLE_AF) | PAL_STM32_PUPDR_PULLUP)
525
#endif
526
527
#ifndef EFI_CONSOLE_TX_BRAIN_PIN_MODE
528
#define EFI_CONSOLE_TX_BRAIN_PIN_MODE (PAL_MODE_ALTERNATE(EFI_CONSOLE_AF))
529
#endif
530
531
// todo: this should be detected automatically based on pin selection
532
// https://github.com/rusefi/rusefi/issues/3536
533
#ifndef TS_SERIAL_AF
534
#define TS_SERIAL_AF 7
535
#endif
536
537
#ifndef TS_SERIAL_RX_BRAIN_PIN_MODE
538
#define TS_SERIAL_RX_BRAIN_PIN_MODE (PAL_MODE_ALTERNATE(TS_SERIAL_AF) | PAL_STM32_PUPDR_PULLUP)
539
#endif
540
541
#ifndef TS_SERIAL_TX_BRAIN_PIN_MODE
542
#define TS_SERIAL_TX_BRAIN_PIN_MODE (PAL_MODE_ALTERNATE(TS_SERIAL_AF))
543
#endif
544
545
#ifndef LED_CRITICAL_ERROR_BRAIN_PIN
546
#define LED_CRITICAL_ERROR_BRAIN_PIN Gpio::D14
547
#endif
548
549
// USART1 -> check defined STM32_SERIAL_USE_USART1
550
// For GPS we have USART1. We can start with PB7 USART1_RX and PB6 USART1_TX
551
#define GPS_SERIAL_DEVICE &SD1
552
#define GPS_SERIAL_SPEED 38400
553
554
#ifndef EFI_SENT_SUPPORT
555
#define EFI_SENT_SUPPORT FALSE
556
#endif
Generated on Thu Jan 22 2026 00:10:50 for rusEFI by
1.9.8