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
32 config IDF_TARGET_ESP32
34 default "y" if IDF_TARGET="esp32"
37 config IDF_TARGET_ESP32S2BETA
39 default "y" if IDF_TARGET="esp32s2beta"
41 select FREERTOS_UNICORE
43 menu "SDK tool configuration"
45 string "Compiler toolchain path/prefix"
46 default "xtensa-esp32-elf-" if IDF_TARGET_ESP32
47 default "xtensa-esp32s2-elf-" if IDF_TARGET_ESP32S2BETA
49 The prefix/path that is used to call the toolchain. The default setting assumes
50 a crosstool-ng gcc setup that is in your PATH.
53 string "Python 2 interpreter"
57 The executable name/path that is used to run python. On some systems Python 2.x
58 may need to be invoked as python2.
60 (Note: This option is used with the legacy GNU Make build system only.)
62 config SDK_MAKE_WARN_UNDEFINED_VARIABLES
63 bool "'make' warns on undefined variables"
67 Adds --warn-undefined-variables to MAKEFLAGS. This causes make to
68 print a warning any time an undefined variable is referenced.
70 This option helps find places where a variable reference is misspelled
71 or otherwise missing, but it can be unwanted if you have Makefiles which
72 depend on undefined variables expanding to an empty string.
74 (Note: this option is used with the legacy GNU Make build system only.)
76 endmenu # SDK tool configuration
78 source "$COMPONENT_KCONFIGS_PROJBUILD"
80 menu "Compiler options"
82 choice COMPILER_OPTIMIZATION
83 prompt "Optimization Level"
84 default COMPILER_OPTIMIZATION_LEVEL_DEBUG
86 This option sets compiler optimization level (gcc -O argument).
88 - for "Release" setting, -Os flag is added to CFLAGS.
89 - for "Debug" setting, -Og flag is added to CFLAGS.
91 "Release" with -Os produces smaller & faster compiled code but it
92 may be harder to correlated code addresses to source files when debugging.
94 To add custom optimization settings, set CFLAGS and/or CPPFLAGS
95 in project makefile, before including $(IDF_PATH)/make/project.mk. Note that
96 custom optimization levels may be unsupported.
98 config COMPILER_OPTIMIZATION_LEVEL_DEBUG
100 config COMPILER_OPTIMIZATION_LEVEL_RELEASE
104 choice COMPILER_OPTIMIZATION_ASSERTION_LEVEL
105 prompt "Assertion level"
106 default COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
110 - Enabled. Failure will print verbose assertion details. This is the default.
112 - Set to "silent" to save code size (failed assertions will abort() but user
113 needs to use the aborting address to find the line number with the failed assertion.)
115 - Disabled entirely (not recommended for most configurations.) -DNDEBUG is added
116 to CPPFLAGS in this case.
118 config COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
122 Enable assertions. Assertion content and line number will be printed on failure.
124 config COMPILER_OPTIMIZATION_ASSERTIONS_SILENT
125 prompt "Silent (saves code size)"
128 Enable silent assertions. Failed assertions will abort(), user needs to
129 use the aborting address to find the line number with the failed assertion.
131 config COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
132 prompt "Disabled (sets -DNDEBUG)"
135 If assertions are disabled, -DNDEBUG is added to CPPFLAGS.
137 endchoice # assertions
139 menuconfig COMPILER_CXX_EXCEPTIONS
140 bool "Enable C++ exceptions"
143 Enabling this option compiles all IDF C++ files with exception support enabled.
145 Disabling this option disables C++ exception support in all compiled files, and any libstdc++ code
146 which throws an exception will abort instead.
148 Enabling this option currently adds an additional ~500 bytes of heap overhead
149 when an exception is thrown in user code for the first time.
151 config COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE
152 int "Emergency Pool Size"
154 depends on COMPILER_CXX_EXCEPTIONS
156 Size (in bytes) of the emergency memory pool for C++ exceptions. This pool will be used to allocate
157 memory for thrown exceptions when there is not enough memory on the heap.
159 choice COMPILER_STACK_CHECK_MODE
160 prompt "Stack smashing protection mode"
161 default COMPILER_STACK_CHECK_MODE_NONE
163 Stack smashing protection mode. Emit extra code to check for buffer overflows, such as stack
164 smashing attacks. This is done by adding a guard variable to functions with vulnerable objects.
165 The guards are initialized when a function is entered and then checked when the function exits.
166 If a guard check fails, program is halted. Protection has the following modes:
168 - In NORMAL mode (GCC flag: -fstack-protector) only functions that call alloca, and functions with
169 buffers larger than 8 bytes are protected.
171 - STRONG mode (GCC flag: -fstack-protector-strong) is like NORMAL, but includes additional functions
172 to be protected -- those that have local array definitions, or have references to local frame
175 - In OVERALL mode (GCC flag: -fstack-protector-all) all functions are protected.
177 Modes have the following impact on code performance and coverage:
179 - performance: NORMAL > STRONG > OVERALL
181 - coverage: NORMAL < STRONG < OVERALL
184 config COMPILER_STACK_CHECK_MODE_NONE
186 config COMPILER_STACK_CHECK_MODE_NORM
188 config COMPILER_STACK_CHECK_MODE_STRONG
190 config COMPILER_STACK_CHECK_MODE_ALL
194 config COMPILER_STACK_CHECK
196 default !COMPILER_STACK_CHECK_MODE_NONE
198 Stack smashing protection.
200 config COMPILER_WARN_WRITE_STRINGS
201 bool "Enable -Wwrite-strings warning flag"
204 Adds -Wwrite-strings flag for the C/C++ compilers.
206 For C, this gives string constants the type ``const char[]`` so that
207 copying the address of one into a non-const ``char *`` pointer
208 produces a warning. This warning helps to find at compile time code
209 that tries to write into a string constant.
211 For C++, this warns about the deprecated conversion from string
212 literals to ``char *``.
214 config COMPILER_DISABLE_GCC8_WARNINGS
215 bool "Disable new warnings introduced in GCC 6 - 8"
218 Enable this option if using GCC 6 or newer, and wanting to disable warnings which don't appear with
222 endmenu # Compiler Options
224 menu "Component config"
225 source "$COMPONENT_KCONFIGS"
228 menu "Compatibility options"
229 config LEGACY_INCLUDE_COMMON_HEADERS
230 bool "Include headers accross components as before IDF v4.0"
233 Soc, esp32, and driver components, the most common
234 components. Some header of these components are included
235 implicitly by headers of other components before IDF v4.0.
236 It's not required for high-level components, but still
237 included through long header chain everywhere.
239 This is harmful to the modularity. So it's changed in IDF
242 You can still include these headers in a legacy way until it
243 is totally deprecated by enable this option.
245 endmenu #Compatibility options