]> granicus.if.org Git - esp-idf/blob - Kconfig
Merge branch 'feature/esp32s2beta_merge_fix_bootloader_ld' into 'feature/esp32s2beta'
[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_TARGET_ESP32
33         bool
34         default "y" if IDF_TARGET="esp32"
35         default "n"
36
37     config IDF_TARGET_ESP32S2BETA
38         bool
39         default "y" if IDF_TARGET="esp32s2beta"
40         default "n"
41         select FREERTOS_UNICORE
42
43     menu "SDK tool configuration"
44         config SDK_TOOLPREFIX
45             string "Compiler toolchain path/prefix"
46             default "xtensa-esp32-elf-" if IDF_TARGET_ESP32
47             default "xtensa-esp32s2-elf-" if IDF_TARGET_ESP32S2BETA
48             help
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.
51
52         config SDK_PYTHON
53             string "Python 2 interpreter"
54             depends on !IDF_CMAKE
55             default "python"
56             help
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.
59
60                 (Note: This option is used with the legacy GNU Make build system only.)
61
62         config SDK_MAKE_WARN_UNDEFINED_VARIABLES
63             bool "'make' warns on undefined variables"
64             depends on !IDF_CMAKE
65             default "y"
66             help
67                 Adds --warn-undefined-variables to MAKEFLAGS. This causes make to
68                 print a warning any time an undefined variable is referenced.
69
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.
73
74                 (Note: this option is used with the legacy GNU Make build system only.)
75
76     endmenu  # SDK tool configuration
77
78     source "$COMPONENT_KCONFIGS_PROJBUILD"
79
80     menu "Compiler options"
81
82         choice COMPILER_OPTIMIZATION
83             prompt "Optimization Level"
84             default COMPILER_OPTIMIZATION_LEVEL_DEBUG
85             help
86                 This option sets compiler optimization level (gcc -O argument).
87
88                 - for "Release" setting, -Os flag is added to CFLAGS.
89                 - for "Debug" setting, -Og flag is added to CFLAGS.
90
91                 "Release" with -Os produces smaller & faster compiled code but it
92                 may be harder to correlated code addresses to source files when debugging.
93
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.
97
98             config COMPILER_OPTIMIZATION_LEVEL_DEBUG
99                 bool "Debug (-Og)"
100             config COMPILER_OPTIMIZATION_LEVEL_RELEASE
101                 bool "Release (-Os)"
102         endchoice
103
104         choice COMPILER_OPTIMIZATION_ASSERTION_LEVEL
105             prompt "Assertion level"
106             default COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
107             help
108                 Assertions can be:
109
110                 - Enabled. Failure will print verbose assertion details. This is the default.
111
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.)
114
115                 - Disabled entirely (not recommended for most configurations.) -DNDEBUG is added
116                   to CPPFLAGS in this case.
117
118             config COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
119                 prompt "Enabled"
120                 bool
121                 help
122                     Enable assertions. Assertion content and line number will be printed on failure.
123
124             config COMPILER_OPTIMIZATION_ASSERTIONS_SILENT
125                 prompt "Silent (saves code size)"
126                 bool
127                 help
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.
130
131             config COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
132                 prompt "Disabled (sets -DNDEBUG)"
133                 bool
134                 help
135                     If assertions are disabled, -DNDEBUG is added to CPPFLAGS.
136
137         endchoice # assertions
138
139         menuconfig COMPILER_CXX_EXCEPTIONS
140             bool "Enable C++ exceptions"
141             default n
142             help
143                 Enabling this option compiles all IDF C++ files with exception support enabled.
144
145                 Disabling this option disables C++ exception support in all compiled files, and any libstdc++ code
146                 which throws an exception will abort instead.
147
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.
150
151         config COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE
152             int "Emergency Pool Size"
153             default 0
154             depends on COMPILER_CXX_EXCEPTIONS
155             help
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.
158
159         choice COMPILER_STACK_CHECK_MODE
160             prompt "Stack smashing protection mode"
161             default COMPILER_STACK_CHECK_MODE_NONE
162             help
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:
167
168                 - In NORMAL mode (GCC flag: -fstack-protector) only functions that call alloca, and functions with
169                   buffers larger than 8 bytes are protected.
170
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
173                   addresses.
174
175                 - In OVERALL mode (GCC flag: -fstack-protector-all) all functions are protected.
176
177                 Modes have the following impact on code performance and coverage:
178
179                 - performance: NORMAL > STRONG > OVERALL
180
181                 - coverage: NORMAL < STRONG < OVERALL
182
183
184             config COMPILER_STACK_CHECK_MODE_NONE
185                 bool "None"
186             config COMPILER_STACK_CHECK_MODE_NORM
187                 bool "Normal"
188             config COMPILER_STACK_CHECK_MODE_STRONG
189                 bool "Strong"
190             config COMPILER_STACK_CHECK_MODE_ALL
191                 bool "Overall"
192         endchoice
193
194         config COMPILER_STACK_CHECK
195             bool
196             default !COMPILER_STACK_CHECK_MODE_NONE
197             help
198                 Stack smashing protection.
199
200         config COMPILER_WARN_WRITE_STRINGS
201             bool "Enable -Wwrite-strings warning flag"
202             default "n"
203             help
204                 Adds -Wwrite-strings flag for the C/C++ compilers.
205
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.
210
211                 For C++, this warns about the deprecated conversion from string
212                 literals to ``char *``.
213
214         config COMPILER_DISABLE_GCC8_WARNINGS
215             bool "Disable new warnings introduced in GCC 6 - 8"
216             default "n"
217             help
218                 Enable this option if using GCC 6 or newer, and wanting to disable warnings which don't appear with
219                 GCC 5.
220
221
222     endmenu # Compiler Options
223
224     menu "Component config"
225         source "$COMPONENT_KCONFIGS"
226     endmenu
227
228     menu "Compatibility options"
229         config LEGACY_INCLUDE_COMMON_HEADERS
230             bool "Include headers accross components as before IDF v4.0"
231             default n
232             help
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.
238
239                 This is harmful to the modularity. So it's changed in IDF
240                 v4.0.
241
242                 You can still include these headers in a legacy way until it
243                 is totally deprecated by enable this option.
244
245     endmenu #Compatibility options