Kconfig 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. # Hidden option to support checking for this specific target in C code and Kconfig files
  7. config IDF_TARGET_ESP32
  8. bool
  9. default "y" if IDF_TARGET="esp32"
  10. default "n"
  11. config IDF_CMAKE
  12. bool
  13. option env="IDF_CMAKE"
  14. config IDF_TARGET_ENV
  15. # A proxy to get environment variable $IDF_TARGET
  16. string
  17. option env="IDF_TARGET"
  18. config IDF_TARGET
  19. # This option records the IDF target when sdkconfig is generated the first time.
  20. # It is not updated if environment variable $IDF_TARGET changes later, and
  21. # the build system is responsible for detecting the mismatch between
  22. # CONFIG_IDF_TARGET and $IDF_TARGET.
  23. string
  24. default "IDF_TARGET_NOT_SET" if IDF_TARGET_ENV=""
  25. default IDF_TARGET_ENV
  26. config IDF_FIRMWARE_CHIP_ID
  27. hex
  28. default 0x0000 if IDF_TARGET="esp32"
  29. default 0xFFFF
  30. menu "SDK tool configuration"
  31. config SDK_TOOLPREFIX
  32. string "Compiler toolchain path/prefix"
  33. default "xtensa-esp32-elf-"
  34. help
  35. The prefix/path that is used to call the toolchain. The default setting assumes
  36. a crosstool-ng gcc setup that is in your PATH.
  37. config SDK_PYTHON
  38. string "Python interpreter"
  39. depends on !IDF_CMAKE
  40. default "python"
  41. help
  42. The executable name/path that is used to run python.
  43. (Note: This option is used with the legacy GNU Make build system only.)
  44. config SDK_MAKE_WARN_UNDEFINED_VARIABLES
  45. bool "'make' warns on undefined variables"
  46. depends on !IDF_CMAKE
  47. default "y"
  48. help
  49. Adds --warn-undefined-variables to MAKEFLAGS. This causes make to
  50. print a warning any time an undefined variable is referenced.
  51. This option helps find places where a variable reference is misspelled
  52. or otherwise missing, but it can be unwanted if you have Makefiles which
  53. depend on undefined variables expanding to an empty string.
  54. (Note: this option is used with the legacy GNU Make build system only.)
  55. endmenu # SDK tool configuration
  56. source "$COMPONENT_KCONFIGS_PROJBUILD"
  57. menu "Compiler options"
  58. choice COMPILER_OPTIMIZATION
  59. prompt "Optimization Level"
  60. default COMPILER_OPTIMIZATION_LEVEL_DEBUG
  61. help
  62. This option sets compiler optimization level (gcc -O argument).
  63. - for "Release" setting, -Os flag is added to CFLAGS.
  64. - for "Debug" setting, -Og flag is added to CFLAGS.
  65. "Release" with -Os produces smaller & faster compiled code but it
  66. may be harder to correlated code addresses to source files when debugging.
  67. To add custom optimization settings, set CFLAGS and/or CPPFLAGS
  68. in project makefile, before including $(IDF_PATH)/make/project.mk. Note that
  69. custom optimization levels may be unsupported.
  70. config COMPILER_OPTIMIZATION_LEVEL_DEBUG
  71. bool "Debug (-Og)"
  72. config COMPILER_OPTIMIZATION_LEVEL_RELEASE
  73. bool "Release (-Os)"
  74. endchoice
  75. choice COMPILER_OPTIMIZATION_ASSERTION_LEVEL
  76. prompt "Assertion level"
  77. default COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
  78. help
  79. Assertions can be:
  80. - Enabled. Failure will print verbose assertion details. This is the default.
  81. - Set to "silent" to save code size (failed assertions will abort() but user
  82. needs to use the aborting address to find the line number with the failed assertion.)
  83. - Disabled entirely (not recommended for most configurations.) -DNDEBUG is added
  84. to CPPFLAGS in this case.
  85. config COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
  86. prompt "Enabled"
  87. bool
  88. help
  89. Enable assertions. Assertion content and line number will be printed on failure.
  90. config COMPILER_OPTIMIZATION_ASSERTIONS_SILENT
  91. prompt "Silent (saves code size)"
  92. bool
  93. help
  94. Enable silent assertions. Failed assertions will abort(), user needs to
  95. use the aborting address to find the line number with the failed assertion.
  96. config COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
  97. prompt "Disabled (sets -DNDEBUG)"
  98. bool
  99. help
  100. If assertions are disabled, -DNDEBUG is added to CPPFLAGS.
  101. endchoice # assertions
  102. menuconfig COMPILER_CXX_EXCEPTIONS
  103. bool "Enable C++ exceptions"
  104. default n
  105. help
  106. Enabling this option compiles all IDF C++ files with exception support enabled.
  107. Disabling this option disables C++ exception support in all compiled files, and any libstdc++ code
  108. which throws an exception will abort instead.
  109. Enabling this option currently adds an additional ~500 bytes of heap overhead
  110. when an exception is thrown in user code for the first time.
  111. config COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE
  112. int "Emergency Pool Size"
  113. default 0
  114. depends on COMPILER_CXX_EXCEPTIONS
  115. help
  116. Size (in bytes) of the emergency memory pool for C++ exceptions. This pool will be used to allocate
  117. memory for thrown exceptions when there is not enough memory on the heap.
  118. config COMPILER_CXX_RTTI
  119. # Invisible option, until the toolchain with RTTI support is released.
  120. # Use prompt "Enable C++ run-time type info (RTTI)" when updating.
  121. bool
  122. help
  123. Enabling this option compiles all C++ files with RTTI support enabled.
  124. This increases binary size (typically by tens of kB) but allows using
  125. dynamic_cast conversion and typeid operator.
  126. choice COMPILER_STACK_CHECK_MODE
  127. prompt "Stack smashing protection mode"
  128. default COMPILER_STACK_CHECK_MODE_NONE
  129. help
  130. Stack smashing protection mode. Emit extra code to check for buffer overflows, such as stack
  131. smashing attacks. This is done by adding a guard variable to functions with vulnerable objects.
  132. The guards are initialized when a function is entered and then checked when the function exits.
  133. If a guard check fails, program is halted. Protection has the following modes:
  134. - In NORMAL mode (GCC flag: -fstack-protector) only functions that call alloca, and functions with
  135. buffers larger than 8 bytes are protected.
  136. - STRONG mode (GCC flag: -fstack-protector-strong) is like NORMAL, but includes additional functions
  137. to be protected -- those that have local array definitions, or have references to local frame
  138. addresses.
  139. - In OVERALL mode (GCC flag: -fstack-protector-all) all functions are protected.
  140. Modes have the following impact on code performance and coverage:
  141. - performance: NORMAL > STRONG > OVERALL
  142. - coverage: NORMAL < STRONG < OVERALL
  143. config COMPILER_STACK_CHECK_MODE_NONE
  144. bool "None"
  145. config COMPILER_STACK_CHECK_MODE_NORM
  146. bool "Normal"
  147. config COMPILER_STACK_CHECK_MODE_STRONG
  148. bool "Strong"
  149. config COMPILER_STACK_CHECK_MODE_ALL
  150. bool "Overall"
  151. endchoice
  152. config COMPILER_STACK_CHECK
  153. bool
  154. default !COMPILER_STACK_CHECK_MODE_NONE
  155. help
  156. Stack smashing protection.
  157. config COMPILER_WARN_WRITE_STRINGS
  158. bool "Enable -Wwrite-strings warning flag"
  159. default "n"
  160. help
  161. Adds -Wwrite-strings flag for the C/C++ compilers.
  162. For C, this gives string constants the type ``const char[]`` so that
  163. copying the address of one into a non-const ``char *`` pointer
  164. produces a warning. This warning helps to find at compile time code
  165. that tries to write into a string constant.
  166. For C++, this warns about the deprecated conversion from string
  167. literals to ``char *``.
  168. config COMPILER_DISABLE_GCC8_WARNINGS
  169. bool "Disable new warnings introduced in GCC 6 - 8"
  170. default "n"
  171. help
  172. Enable this option if using GCC 6 or newer, and wanting to disable warnings which don't appear with
  173. GCC 5.
  174. endmenu # Compiler Options
  175. menu "Component config"
  176. source "$COMPONENT_KCONFIGS"
  177. endmenu
  178. menu "Compatibility options"
  179. config LEGACY_INCLUDE_COMMON_HEADERS
  180. bool "Include headers accross components as before IDF v4.0"
  181. default n
  182. help
  183. Soc, esp32, and driver components, the most common
  184. components. Some header of these components are included
  185. implicitly by headers of other components before IDF v4.0.
  186. It's not required for high-level components, but still
  187. included through long header chain everywhere.
  188. This is harmful to the modularity. So it's changed in IDF
  189. v4.0.
  190. You can still include these headers in a legacy way until it
  191. is totally deprecated by enable this option.
  192. endmenu #Compatibility options