2 # For a description of the syntax of this configuration file,
3 # see kconfig/kconfig-language.txt.
5 mainmenu "Espressif IoT Development Framework Configuration"
7 # Hidden option to support checking for this specific target in C code and Kconfig files
8 config IDF_TARGET_ESP32
10 default "y" if IDF_TARGET="esp32"
15 option env="IDF_CMAKE"
19 # A proxy to get environment variable $IDF_TARGET
21 option env="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.
29 default "IDF_TARGET_NOT_SET" if IDF_TARGET_ENV=""
30 default IDF_TARGET_ENV
33 menu "SDK tool configuration"
35 string "Compiler toolchain path/prefix"
36 default "xtensa-esp32-elf-"
38 The prefix/path that is used to call the toolchain. The default setting assumes
39 a crosstool-ng gcc setup that is in your PATH.
42 string "Python 2 interpreter"
46 The executable name/path that is used to run python. On some systems Python 2.x
47 may need to be invoked as python2.
49 (Note: This option is used with the GNU Make build system only, not idf.py
50 or CMake-based builds.)
52 config SDK_MAKE_WARN_UNDEFINED_VARIABLES
53 bool "'make' warns on undefined variables"
56 Adds --warn-undefined-variables to MAKEFLAGS. This causes make to
57 print a warning any time an undefined variable is referenced.
59 This option helps find places where a variable reference is misspelled
60 or otherwise missing, but it can be unwanted if you have Makefiles which
61 depend on undefined variables expanding to an empty string.
63 endmenu # SDK tool configuration
65 source "$COMPONENT_KCONFIGS_PROJBUILD"
67 menu "Compiler options"
69 choice COMPILER_OPTIMIZATION
70 prompt "Optimization Level"
71 default COMPILER_OPTIMIZATION_LEVEL_DEBUG
73 This option sets compiler optimization level (gcc -O argument).
75 - for "Release" setting, -Os flag is added to CFLAGS.
76 - for "Debug" setting, -Og flag is added to CFLAGS.
78 "Release" with -Os produces smaller & faster compiled code but it
79 may be harder to correlated code addresses to source files when debugging.
81 To add custom optimization settings, set CFLAGS and/or CPPFLAGS
82 in project makefile, before including $(IDF_PATH)/make/project.mk. Note that
83 custom optimization levels may be unsupported.
85 config COMPILER_OPTIMIZATION_LEVEL_DEBUG
87 config COMPILER_OPTIMIZATION_LEVEL_RELEASE
91 choice COMPILER_OPTIMIZATION_ASSERTION_LEVEL
92 prompt "Assertion level"
93 default COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
97 - Enabled. Failure will print verbose assertion details. This is the default.
99 - Set to "silent" to save code size (failed assertions will abort() but user
100 needs to use the aborting address to find the line number with the failed assertion.)
102 - Disabled entirely (not recommended for most configurations.) -DNDEBUG is added
103 to CPPFLAGS in this case.
105 config COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
109 Enable assertions. Assertion content and line number will be printed on failure.
111 config COMPILER_OPTIMIZATION_ASSERTIONS_SILENT
112 prompt "Silent (saves code size)"
115 Enable silent assertions. Failed assertions will abort(), user needs to
116 use the aborting address to find the line number with the failed assertion.
118 config COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
119 prompt "Disabled (sets -DNDEBUG)"
122 If assertions are disabled, -DNDEBUG is added to CPPFLAGS.
124 endchoice # assertions
126 menuconfig COMPILER_CXX_EXCEPTIONS
127 bool "Enable C++ exceptions"
130 Enabling this option compiles all IDF C++ files with exception support enabled.
132 Disabling this option disables C++ exception support in all compiled files, and any libstdc++ code
133 which throws an exception will abort instead.
135 Enabling this option currently adds an additional ~500 bytes of heap overhead
136 when an exception is thrown in user code for the first time.
138 config COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE
139 int "Emergency Pool Size"
141 depends on COMPILER_CXX_EXCEPTIONS
143 Size (in bytes) of the emergency memory pool for C++ exceptions. This pool will be used to allocate
144 memory for thrown exceptions when there is not enough memory on the heap.
146 choice COMPILER_STACK_CHECK_MODE
147 prompt "Stack smashing protection mode"
148 default COMPILER_STACK_CHECK_MODE_NONE
150 Stack smashing protection mode. Emit extra code to check for buffer overflows, such as stack
151 smashing attacks. This is done by adding a guard variable to functions with vulnerable objects.
152 The guards are initialized when a function is entered and then checked when the function exits.
153 If a guard check fails, program is halted. Protection has the following modes:
155 - In NORMAL mode (GCC flag: -fstack-protector) only functions that call alloca, and functions with
156 buffers larger than 8 bytes are protected.
158 - STRONG mode (GCC flag: -fstack-protector-strong) is like NORMAL, but includes additional functions
159 to be protected -- those that have local array definitions, or have references to local frame
162 - In OVERALL mode (GCC flag: -fstack-protector-all) all functions are protected.
164 Modes have the following impact on code performance and coverage:
166 - performance: NORMAL > STRONG > OVERALL
168 - coverage: NORMAL < STRONG < OVERALL
171 config COMPILER_STACK_CHECK_MODE_NONE
173 config COMPILER_STACK_CHECK_MODE_NORM
175 config COMPILER_STACK_CHECK_MODE_STRONG
177 config COMPILER_STACK_CHECK_MODE_ALL
181 config COMPILER_STACK_CHECK
183 default !COMPILER_STACK_CHECK_MODE_NONE
185 Stack smashing protection.
187 config COMPILER_WARN_WRITE_STRINGS
188 bool "Enable -Wwrite-strings warning flag"
191 Adds -Wwrite-strings flag for the C/C++ compilers.
193 For C, this gives string constants the type ``const char[]`` so that
194 copying the address of one into a non-const ``char *`` pointer
195 produces a warning. This warning helps to find at compile time code
196 that tries to write into a string constant.
198 For C++, this warns about the deprecated conversion from string
199 literals to ``char *``.
201 config COMPILER_DISABLE_GCC8_WARNINGS
202 bool "Disable new warnings introduced in GCC 6 - 8"
205 Enable this option if using GCC 6 or newer, and wanting to disable warnings which don't appear with
209 endmenu # Compiler Options
211 menu "Component config"
212 source "$COMPONENT_KCONFIGS"
215 menu "Compatibility options"
216 config LEGACY_INCLUDE_COMMON_HEADERS
217 bool "Include headers accross components as before IDF v4.0"
220 Soc, esp32, and driver components, the most common
221 components. Some header of these components are included
222 implicitly by headers of other components before IDF v4.0.
223 It's not required for high-level components, but still
224 included through long header chain everywhere.
226 This is harmful to the modularity. So it's changed in IDF
229 You can still include these headers in a legacy way until it
230 is totally deprecated by enable this option.
232 endmenu #Compatibility options