]> granicus.if.org Git - esp-idf/blob - Kconfig
Merge branch 'bugfix/fix_mesh_proxy_adv_with_wrong_dev_name' into 'master'
[esp-idf] / Kconfig
1 #
2 # For a description of the syntax of this configuration file,
3 # see kconfig/kconfig-language.txt.
4 #
5 mainmenu "Espressif IoT Development Framework Configuration"
6
7     # Hidden option to support checking for this specific target in C code and Kconfig files
8     config IDF_TARGET_ESP32
9         bool
10         default "y" if IDF_TARGET="esp32"
11         default "n"
12
13     config IDF_CMAKE
14         bool
15         option env="IDF_CMAKE"
16
17
18     config IDF_TARGET_ENV
19         # A proxy to get environment variable $IDF_TARGET
20         string
21         option env="IDF_TARGET"
22
23     config IDF_TARGET
24         # This option records the IDF target when sdkconfig is generated the first time.
25         # It is not updated if environment variable $IDF_TARGET changes later, and
26         # the build system is responsible for detecting the mismatch between
27         # CONFIG_IDF_TARGET and $IDF_TARGET.
28         string
29         default "IDF_TARGET_NOT_SET" if IDF_TARGET_ENV=""
30         default IDF_TARGET_ENV
31
32     config IDF_FIRMWARE_CHIP_ID
33         hex
34         default 0x0000 if IDF_TARGET="esp32"
35         default 0xFFFF
36
37     menu "SDK tool configuration"
38         config SDK_TOOLPREFIX
39             string "Compiler toolchain path/prefix"
40             default "xtensa-esp32-elf-"
41             help
42                 The prefix/path that is used to call the toolchain. The default setting assumes
43                 a crosstool-ng gcc setup that is in your PATH.
44
45         config SDK_PYTHON
46             string "Python 2 interpreter"
47             depends on !IDF_CMAKE
48             default "python"
49             help
50                 The executable name/path that is used to run python. On some systems Python 2.x
51                 may need to be invoked as python2.
52
53                 (Note: This option is used with the legacy GNU Make build system only.)
54
55         config SDK_MAKE_WARN_UNDEFINED_VARIABLES
56             bool "'make' warns on undefined variables"
57             depends on !IDF_CMAKE
58             default "y"
59             help
60                 Adds --warn-undefined-variables to MAKEFLAGS. This causes make to
61                 print a warning any time an undefined variable is referenced.
62
63                 This option helps find places where a variable reference is misspelled
64                 or otherwise missing, but it can be unwanted if you have Makefiles which
65                 depend on undefined variables expanding to an empty string.
66
67                 (Note: this option is used with the legacy GNU Make build system only.)
68
69     endmenu  # SDK tool configuration
70
71     menu "Build type"
72
73         choice APP_BUILD_TYPE
74             prompt "Application build type"
75             default APP_BUILD_TYPE_APP_2NDBOOT
76             help
77                 Select the way the application is built.
78
79                 By default, the application is built as a binary file in a format compatible with
80                 the ESP32 bootloader. In addition to this application, 2nd stage bootloader is
81                 also built. Application and bootloader binaries can be written into flash and
82                 loaded/executed from there.
83
84                 Another option, useful for only very small and limited applications, is to only link
85                 the .elf file of the application, such that it can be loaded directly into RAM over
86                 JTAG. Note that since IRAM and DRAM sizes are very limited, it is not possible to
87                 build any complex application this way. However for kinds of testing and debugging,
88                 this option may provide faster iterations, since the application does not need to be
89                 written into flash.
90                 Note that at the moment, ESP-IDF does not contain all the startup code required to
91                 initialize the CPUs and ROM memory (data/bss). Therefore it is necessary to execute
92                 a bit of ROM code prior to executing the application. A gdbinit file may look as follows:
93
94                     # Connect to a running instance of OpenOCD
95                     target remote :3333
96                     # Reset and halt the target
97                     mon reset halt
98                     # Run to a specific point in ROM code,
99                     #  where most of initialization is complete.
100                     thb *0x40007901
101                     c
102                     # Load the application into RAM
103                     load
104                     # Run till app_main
105                     tb app_main
106                     c
107
108                 Execute this gdbinit file as follows:
109
110                     xtensa-esp32-elf-gdb build/app-name.elf -x gdbinit
111
112                 Recommended sdkconfig.defaults for building loadable ELF files is as follows.
113                 CONFIG_APP_BUILD_TYPE_ELF_RAM is required, other options help reduce application
114                 memory footprint.
115
116                     CONFIG_APP_BUILD_TYPE_ELF_RAM=y
117                     CONFIG_VFS_SUPPORT_TERMIOS=
118                     CONFIG_NEWLIB_NANO_FORMAT=y
119                     CONFIG_ESP32_PANIC_PRINT_HALT=y
120                     CONFIG_ESP32_DEBUG_STUBS_ENABLE=
121                     CONFIG_ESP_ERR_TO_NAME_LOOKUP=
122
123
124             config APP_BUILD_TYPE_APP_2NDBOOT
125                 bool
126                 prompt "Default (binary application + 2nd stage bootloader)"
127                 select APP_BUILD_GENERATE_BINARIES
128                 select APP_BUILD_BOOTLOADER
129                 select APP_BUILD_USE_FLASH_SECTIONS
130
131             config APP_BUILD_TYPE_ELF_RAM
132                 bool
133                 prompt "ELF file, loadable into RAM (EXPERIMENTAL))"
134         endchoice # APP_BUILD_TYPE
135
136         # Hidden options, set according to the choice above
137         config APP_BUILD_GENERATE_BINARIES
138             bool # Whether to generate .bin files or not
139
140         config APP_BUILD_BOOTLOADER
141             bool # Whether to build the bootloader
142
143         config APP_BUILD_USE_FLASH_SECTIONS
144             bool # Whether to place code/data into memory-mapped flash sections
145
146     endmenu # Build type
147
148     source "$COMPONENT_KCONFIGS_PROJBUILD"
149
150     menu "Compiler options"
151
152         choice COMPILER_OPTIMIZATION
153             prompt "Optimization Level"
154             default COMPILER_OPTIMIZATION_DEFAULT
155             help
156                 This option sets compiler optimization level (gcc -O argument).
157
158                 - The "Default" setting will add the -0g flag to CFLAGS.
159                 - The "Size" setting will add the -0s flag to CFLAGS.
160                 - The "Performance" setting will add the -O2 flag to CFLAGS.
161                 - The "None" setting will add the -O0 flag to CFLAGS.
162
163                 The "Size" setting cause the compiled code to be smaller and faster, but
164                 may lead to difficulties of correlating code addresses to source file
165                 lines when debugging.
166
167                 The "Performance" setting causes the compiled code to be larger and faster,
168                 but will be easier to correlated code addresses to source file lines.
169
170                 "None" with -O0 produces compiled code without optimization.
171
172                 Note that custom optimization levels may be unsupported.
173
174             config COMPILER_OPTIMIZATION_DEFAULT
175                 bool "Debug (-Og)"
176             config COMPILER_OPTIMIZATION_SIZE
177                 bool "Optimize for size (-Os)"
178             config COMPILER_OPTIMIZATION_PERF
179                 bool "Optimize for performance (-O2)"
180             config COMPILER_OPTIMIZATION_NONE
181                 bool "Debug without optimization (-O0)"
182
183         endchoice
184
185         choice COMPILER_OPTIMIZATION_ASSERTION_LEVEL
186             prompt "Assertion level"
187             default COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
188             help
189                 Assertions can be:
190
191                 - Enabled. Failure will print verbose assertion details. This is the default.
192
193                 - Set to "silent" to save code size (failed assertions will abort() but user
194                   needs to use the aborting address to find the line number with the failed assertion.)
195
196                 - Disabled entirely (not recommended for most configurations.) -DNDEBUG is added
197                   to CPPFLAGS in this case.
198
199             config COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
200                 prompt "Enabled"
201                 bool
202                 help
203                     Enable assertions. Assertion content and line number will be printed on failure.
204
205             config COMPILER_OPTIMIZATION_ASSERTIONS_SILENT
206                 prompt "Silent (saves code size)"
207                 bool
208                 help
209                     Enable silent assertions. Failed assertions will abort(), user needs to
210                     use the aborting address to find the line number with the failed assertion.
211
212             config COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
213                 prompt "Disabled (sets -DNDEBUG)"
214                 bool
215                 help
216                     If assertions are disabled, -DNDEBUG is added to CPPFLAGS.
217
218         endchoice # assertions
219
220         menuconfig COMPILER_CXX_EXCEPTIONS
221             bool "Enable C++ exceptions"
222             default n
223             help
224                 Enabling this option compiles all IDF C++ files with exception support enabled.
225
226                 Disabling this option disables C++ exception support in all compiled files, and any libstdc++ code
227                 which throws an exception will abort instead.
228
229                 Enabling this option currently adds an additional ~500 bytes of heap overhead
230                 when an exception is thrown in user code for the first time.
231
232         config COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE
233             int "Emergency Pool Size"
234             default 0
235             depends on COMPILER_CXX_EXCEPTIONS
236             help
237                 Size (in bytes) of the emergency memory pool for C++ exceptions. This pool will be used to allocate
238                 memory for thrown exceptions when there is not enough memory on the heap.
239
240         config COMPILER_CXX_RTTI
241             # Invisible option, until the toolchain with RTTI support is released.
242             # Use prompt "Enable C++ run-time type info (RTTI)" when updating.
243             bool
244             help
245                 Enabling this option compiles all C++ files with RTTI support enabled.
246                 This increases binary size (typically by tens of kB) but allows using
247                 dynamic_cast conversion and typeid operator.
248
249         choice COMPILER_STACK_CHECK_MODE
250             prompt "Stack smashing protection mode"
251             default COMPILER_STACK_CHECK_MODE_NONE
252             help
253                 Stack smashing protection mode. Emit extra code to check for buffer overflows, such as stack
254                 smashing attacks. This is done by adding a guard variable to functions with vulnerable objects.
255                 The guards are initialized when a function is entered and then checked when the function exits.
256                 If a guard check fails, program is halted. Protection has the following modes:
257
258                 - In NORMAL mode (GCC flag: -fstack-protector) only functions that call alloca, and functions with
259                   buffers larger than 8 bytes are protected.
260
261                 - STRONG mode (GCC flag: -fstack-protector-strong) is like NORMAL, but includes additional functions
262                   to be protected -- those that have local array definitions, or have references to local frame
263                   addresses.
264
265                 - In OVERALL mode (GCC flag: -fstack-protector-all) all functions are protected.
266
267                 Modes have the following impact on code performance and coverage:
268
269                 - performance: NORMAL > STRONG > OVERALL
270
271                 - coverage: NORMAL < STRONG < OVERALL
272
273
274             config COMPILER_STACK_CHECK_MODE_NONE
275                 bool "None"
276             config COMPILER_STACK_CHECK_MODE_NORM
277                 bool "Normal"
278             config COMPILER_STACK_CHECK_MODE_STRONG
279                 bool "Strong"
280             config COMPILER_STACK_CHECK_MODE_ALL
281                 bool "Overall"
282         endchoice
283
284         config COMPILER_STACK_CHECK
285             bool
286             default !COMPILER_STACK_CHECK_MODE_NONE
287             help
288                 Stack smashing protection.
289
290         config COMPILER_WARN_WRITE_STRINGS
291             bool "Enable -Wwrite-strings warning flag"
292             default "n"
293             help
294                 Adds -Wwrite-strings flag for the C/C++ compilers.
295
296                 For C, this gives string constants the type ``const char[]`` so that
297                 copying the address of one into a non-const ``char *`` pointer
298                 produces a warning. This warning helps to find at compile time code
299                 that tries to write into a string constant.
300
301                 For C++, this warns about the deprecated conversion from string
302                 literals to ``char *``.
303
304         config COMPILER_DISABLE_GCC8_WARNINGS
305             bool "Disable new warnings introduced in GCC 6 - 8"
306             default "n"
307             help
308                 Enable this option if using GCC 6 or newer, and wanting to disable warnings which don't appear with
309                 GCC 5.
310
311
312     endmenu # Compiler Options
313
314     menu "Component config"
315         source "$COMPONENT_KCONFIGS"
316     endmenu
317
318     menu "Compatibility options"
319         config LEGACY_INCLUDE_COMMON_HEADERS
320             bool "Include headers accross components as before IDF v4.0"
321             default n
322             help
323                 Soc, esp32, and driver components, the most common
324                 components. Some header of these components are included
325                 implicitly by headers of other components before IDF v4.0.
326                 It's not required for high-level components, but still
327                 included through long header chain everywhere.
328
329                 This is harmful to the modularity. So it's changed in IDF
330                 v4.0.
331
332                 You can still include these headers in a legacy way until it
333                 is totally deprecated by enable this option.
334
335     endmenu #Compatibility options