2 # For a description of the syntax of this configuration file,
3 # see kconfig/kconfig-language.txt.
5 mainmenu "Espressif IoT Development Framework Configuration"
13 # A proxy to get environment variable $IDF_TARGET
15 option env="IDF_TARGET"
18 # This option records the IDF target when sdkconfig is generated the first time.
19 # It is not updated if environment variable $IDF_TARGET changes later, and
20 # the build system is responsible for detecting the mismatch between
21 # CONFIG_IDF_TARGET and $IDF_TARGET.
23 default "IDF_TARGET_NOT_SET" if IDF_TARGET_ENV=""
24 default IDF_TARGET_ENV
27 menu "SDK tool configuration"
29 string "Compiler toolchain path/prefix"
30 default "xtensa-esp32-elf-"
32 The prefix/path that is used to call the toolchain. The default setting assumes
33 a crosstool-ng gcc setup that is in your PATH.
36 string "Python 2 interpreter"
40 The executable name/path that is used to run python. On some systems Python 2.x
41 may need to be invoked as python2.
43 (Note: This option is used with the GNU Make build system only, not idf.py
44 or CMake-based builds.)
46 config MAKE_WARN_UNDEFINED_VARIABLES
47 bool "'make' warns on undefined variables"
50 Adds --warn-undefined-variables to MAKEFLAGS. This causes make to
51 print a warning any time an undefined variable is referenced.
53 This option helps find places where a variable reference is misspelled
54 or otherwise missing, but it can be unwanted if you have Makefiles which
55 depend on undefined variables expanding to an empty string.
57 endmenu # SDK tool configuration
59 source "$COMPONENT_KCONFIGS_PROJBUILD"
61 menu "Compiler options"
63 choice OPTIMIZATION_COMPILER
64 prompt "Optimization Level"
65 default OPTIMIZATION_LEVEL_DEBUG
67 This option sets compiler optimization level (gcc -O argument).
69 - for "Release" setting, -Os flag is added to CFLAGS.
70 - for "Debug" setting, -Og flag is added to CFLAGS.
72 "Release" with -Os produces smaller & faster compiled code but it
73 may be harder to correlated code addresses to source files when debugging.
75 To add custom optimization settings, set CFLAGS and/or CPPFLAGS
76 in project makefile, before including $(IDF_PATH)/make/project.mk. Note that
77 custom optimization levels may be unsupported.
79 config OPTIMIZATION_LEVEL_DEBUG
81 config OPTIMIZATION_LEVEL_RELEASE
85 choice OPTIMIZATION_ASSERTION_LEVEL
86 prompt "Assertion level"
87 default OPTIMIZATION_ASSERTIONS_ENABLED
91 - Enabled. Failure will print verbose assertion details. This is the default.
93 - Set to "silent" to save code size (failed assertions will abort() but user
94 needs to use the aborting address to find the line number with the failed assertion.)
96 - Disabled entirely (not recommended for most configurations.) -DNDEBUG is added
97 to CPPFLAGS in this case.
99 config OPTIMIZATION_ASSERTIONS_ENABLED
103 Enable assertions. Assertion content and line number will be printed on failure.
105 config OPTIMIZATION_ASSERTIONS_SILENT
106 prompt "Silent (saves code size)"
109 Enable silent assertions. Failed assertions will abort(), user needs to
110 use the aborting address to find the line number with the failed assertion.
112 config OPTIMIZATION_ASSERTIONS_DISABLED
113 prompt "Disabled (sets -DNDEBUG)"
116 If assertions are disabled, -DNDEBUG is added to CPPFLAGS.
118 endchoice # assertions
120 menuconfig CXX_EXCEPTIONS
121 bool "Enable C++ exceptions"
124 Enabling this option compiles all IDF C++ files with exception support enabled.
126 Disabling this option disables C++ exception support in all compiled files, and any libstdc++ code
127 which throws an exception will abort instead.
129 Enabling this option currently adds an additional ~500 bytes of heap overhead
130 when an exception is thrown in user code for the first time.
132 config CXX_EXCEPTIONS_EMG_POOL_SIZE
133 int "Emergency Pool Size"
135 depends on CXX_EXCEPTIONS
137 Size (in bytes) of the emergency memory pool for C++ exceptions. This pool will be used to allocate
138 memory for thrown exceptions when there is not enough memory on the heap.
140 choice STACK_CHECK_MODE
141 prompt "Stack smashing protection mode"
142 default STACK_CHECK_NONE
144 Stack smashing protection mode. Emit extra code to check for buffer overflows, such as stack
145 smashing attacks. This is done by adding a guard variable to functions with vulnerable objects.
146 The guards are initialized when a function is entered and then checked when the function exits.
147 If a guard check fails, program is halted. Protection has the following modes:
149 - In NORMAL mode (GCC flag: -fstack-protector) only functions that call alloca, and functions with
150 buffers larger than 8 bytes are protected.
152 - STRONG mode (GCC flag: -fstack-protector-strong) is like NORMAL, but includes additional functions
153 to be protected -- those that have local array definitions, or have references to local frame
156 - In OVERALL mode (GCC flag: -fstack-protector-all) all functions are protected.
158 Modes have the following impact on code performance and coverage:
160 - performance: NORMAL > STRONG > OVERALL
162 - coverage: NORMAL < STRONG < OVERALL
165 config STACK_CHECK_NONE
167 config STACK_CHECK_NORM
169 config STACK_CHECK_STRONG
171 config STACK_CHECK_ALL
177 default !STACK_CHECK_NONE
179 Stack smashing protection.
181 config WARN_WRITE_STRINGS
182 bool "Enable -Wwrite-strings warning flag"
185 Adds -Wwrite-strings flag for the C/C++ compilers.
187 For C, this gives string constants the type ``const char[]`` so that
188 copying the address of one into a non-const ``char *`` pointer
189 produces a warning. This warning helps to find at compile time code
190 that tries to write into a string constant.
192 For C++, this warns about the deprecated conversion from string
193 literals to ``char *``.
195 config DISABLE_GCC8_WARNINGS
196 bool "Disable new warnings introduced in GCC 6 - 8"
199 Enable this option if using GCC 6 or newer, and wanting to disable warnings which don't appear with
203 endmenu # Compiler Options
205 menu "Component config"
206 source "$COMPONENT_KCONFIGS"