Kconfig 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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. config IDF_CMAKE
  7. bool
  8. option env="IDF_CMAKE"
  9. config IDF_ENV_FPGA
  10. # This option is for internal use only
  11. bool
  12. config IDF_TARGET
  13. # This option records the IDF target when sdkconfig is generated the first time.
  14. # It is not updated if environment variable $IDF_TARGET changes later, and
  15. # the build system is responsible for detecting the mismatch between
  16. # CONFIG_IDF_TARGET and $IDF_TARGET.
  17. string
  18. default "$IDF_TARGET"
  19. config IDF_TARGET_ESP32
  20. bool
  21. default "y" if IDF_TARGET="esp32"
  22. config IDF_TARGET_ESP32S2
  23. bool
  24. default "y" if IDF_TARGET="esp32s2"
  25. select FREERTOS_UNICORE
  26. config IDF_FIRMWARE_CHIP_ID
  27. hex
  28. default 0x0000 if IDF_TARGET_ESP32
  29. default 0x0002 if IDF_TARGET_ESP32S2
  30. default 0xFFFF
  31. menu "SDK tool configuration"
  32. config SDK_TOOLPREFIX
  33. string "Compiler toolchain path/prefix"
  34. default "xtensa-esp32-elf-" if IDF_TARGET_ESP32
  35. default "xtensa-esp32s2-elf-" if IDF_TARGET_ESP32S2
  36. help
  37. The prefix/path that is used to call the toolchain. The default setting assumes
  38. a crosstool-ng gcc setup that is in your PATH.
  39. config SDK_PYTHON
  40. string "Python interpreter"
  41. depends on !IDF_CMAKE
  42. default "python"
  43. help
  44. The executable name/path that is used to run python.
  45. (Note: This option is used with the legacy GNU Make build system only.)
  46. config SDK_MAKE_WARN_UNDEFINED_VARIABLES
  47. bool "'make' warns on undefined variables"
  48. depends on !IDF_CMAKE
  49. default "y"
  50. help
  51. Adds --warn-undefined-variables to MAKEFLAGS. This causes make to
  52. 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.
  56. (Note: this option is used with the legacy GNU Make build system only.)
  57. config SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS
  58. bool "Toolchain supports time_t wide 64-bits"
  59. default n
  60. help
  61. Enable this option in case you have a custom toolchain which supports time_t wide 64-bits.
  62. This option checks time_t is 64-bits and disables ROM time functions
  63. to use the time functions from the toolchain instead.
  64. This option allows resolving the Y2K38 problem.
  65. See "Setup Linux Toolchain from Scratch" to build
  66. a custom toolchain which supports 64-bits time_t.
  67. Note: ESP-IDF does not currently come with any pre-compiled toolchain
  68. that supports 64-bit wide time_t.
  69. This will change in a future major release,
  70. but currently 64-bit time_t requires a custom built toolchain.
  71. endmenu # SDK tool configuration
  72. menu "Build type"
  73. choice APP_BUILD_TYPE
  74. prompt "Application build type"
  75. default APP_BUILD_TYPE_APP_2NDBOOT
  76. help
  77. Select the way the application is built.
  78. By default, the application is built as a binary file in a format compatible with
  79. the ESP32 bootloader. In addition to this application, 2nd stage bootloader is
  80. also built. Application and bootloader binaries can be written into flash and
  81. loaded/executed from there.
  82. Another option, useful for only very small and limited applications, is to only link
  83. the .elf file of the application, such that it can be loaded directly into RAM over
  84. JTAG. Note that since IRAM and DRAM sizes are very limited, it is not possible to
  85. build any complex application this way. However for kinds of testing and debugging,
  86. this option may provide faster iterations, since the application does not need to be
  87. written into flash.
  88. Note that at the moment, ESP-IDF does not contain all the startup code required to
  89. initialize the CPUs and ROM memory (data/bss). Therefore it is necessary to execute
  90. a bit of ROM code prior to executing the application. A gdbinit file may look as follows:
  91. # Connect to a running instance of OpenOCD
  92. target remote :3333
  93. # Reset and halt the target
  94. mon reset halt
  95. # Run to a specific point in ROM code,
  96. # where most of initialization is complete.
  97. thb *0x40007901
  98. c
  99. # Load the application into RAM
  100. load
  101. # Run till app_main
  102. tb app_main
  103. c
  104. Execute this gdbinit file as follows:
  105. xtensa-esp32-elf-gdb build/app-name.elf -x gdbinit
  106. Recommended sdkconfig.defaults for building loadable ELF files is as follows.
  107. CONFIG_APP_BUILD_TYPE_ELF_RAM is required, other options help reduce application
  108. memory footprint.
  109. CONFIG_APP_BUILD_TYPE_ELF_RAM=y
  110. CONFIG_VFS_SUPPORT_TERMIOS=
  111. CONFIG_NEWLIB_NANO_FORMAT=y
  112. CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
  113. CONFIG_ESP_DEBUG_STUBS_ENABLE=
  114. CONFIG_ESP_ERR_TO_NAME_LOOKUP=
  115. config APP_BUILD_TYPE_APP_2NDBOOT
  116. bool
  117. prompt "Default (binary application + 2nd stage bootloader)"
  118. select APP_BUILD_GENERATE_BINARIES
  119. select APP_BUILD_BOOTLOADER
  120. select APP_BUILD_USE_FLASH_SECTIONS
  121. config APP_BUILD_TYPE_ELF_RAM
  122. bool
  123. prompt "ELF file, loadable into RAM (EXPERIMENTAL))"
  124. endchoice # APP_BUILD_TYPE
  125. # Hidden options, set according to the choice above
  126. config APP_BUILD_GENERATE_BINARIES
  127. bool # Whether to generate .bin files or not
  128. config APP_BUILD_BOOTLOADER
  129. bool # Whether to build the bootloader
  130. config APP_BUILD_USE_FLASH_SECTIONS
  131. bool # Whether to place code/data into memory-mapped flash sections
  132. endmenu # Build type
  133. source "$COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE"
  134. menu "Compiler options"
  135. choice COMPILER_OPTIMIZATION
  136. prompt "Optimization Level"
  137. default COMPILER_OPTIMIZATION_DEFAULT
  138. help
  139. This option sets compiler optimization level (gcc -O argument) for the app.
  140. - The "Default" setting will add the -0g flag to CFLAGS.
  141. - The "Size" setting will add the -0s flag to CFLAGS.
  142. - The "Performance" setting will add the -O2 flag to CFLAGS.
  143. - The "None" setting will add the -O0 flag to CFLAGS.
  144. The "Size" setting cause the compiled code to be smaller and faster, but
  145. may lead to difficulties of correlating code addresses to source file
  146. lines when debugging.
  147. The "Performance" setting causes the compiled code to be larger and faster,
  148. but will be easier to correlated code addresses to source file lines.
  149. "None" with -O0 produces compiled code without optimization.
  150. Note that custom optimization levels may be unsupported.
  151. Compiler optimization for the IDF bootloader is set separately,
  152. see the BOOTLOADER_COMPILER_OPTIMIZATION setting.
  153. config COMPILER_OPTIMIZATION_DEFAULT
  154. bool "Debug (-Og)"
  155. config COMPILER_OPTIMIZATION_SIZE
  156. bool "Optimize for size (-Os)"
  157. config COMPILER_OPTIMIZATION_PERF
  158. bool "Optimize for performance (-O2)"
  159. config COMPILER_OPTIMIZATION_NONE
  160. bool "Debug without optimization (-O0)"
  161. endchoice
  162. choice COMPILER_OPTIMIZATION_ASSERTION_LEVEL
  163. prompt "Assertion level"
  164. default COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
  165. help
  166. Assertions can be:
  167. - Enabled. Failure will print verbose assertion details. This is the default.
  168. - Set to "silent" to save code size (failed assertions will abort() but user
  169. needs to use the aborting address to find the line number with the failed assertion.)
  170. - Disabled entirely (not recommended for most configurations.) -DNDEBUG is added
  171. to CPPFLAGS in this case.
  172. config COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
  173. prompt "Enabled"
  174. bool
  175. help
  176. Enable assertions. Assertion content and line number will be printed on failure.
  177. config COMPILER_OPTIMIZATION_ASSERTIONS_SILENT
  178. prompt "Silent (saves code size)"
  179. bool
  180. help
  181. Enable silent assertions. Failed assertions will abort(), user needs to
  182. use the aborting address to find the line number with the failed assertion.
  183. config COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
  184. prompt "Disabled (sets -DNDEBUG)"
  185. bool
  186. help
  187. If assertions are disabled, -DNDEBUG is added to CPPFLAGS.
  188. endchoice # assertions
  189. menuconfig COMPILER_CXX_EXCEPTIONS
  190. bool "Enable C++ exceptions"
  191. default n
  192. help
  193. Enabling this option compiles all IDF C++ files with exception support enabled.
  194. Disabling this option disables C++ exception support in all compiled files, and any libstdc++ code
  195. which throws an exception will abort instead.
  196. Enabling this option currently adds an additional ~500 bytes of heap overhead
  197. when an exception is thrown in user code for the first time.
  198. config COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE
  199. int "Emergency Pool Size"
  200. default 0
  201. depends on COMPILER_CXX_EXCEPTIONS
  202. help
  203. Size (in bytes) of the emergency memory pool for C++ exceptions. This pool will be used to allocate
  204. memory for thrown exceptions when there is not enough memory on the heap.
  205. config COMPILER_CXX_RTTI
  206. bool "Enable C++ run-time type info (RTTI)"
  207. default n
  208. help
  209. Enabling this option compiles all C++ files with RTTI support enabled.
  210. This increases binary size (typically by tens of kB) but allows using
  211. dynamic_cast conversion and typeid operator.
  212. choice COMPILER_STACK_CHECK_MODE
  213. prompt "Stack smashing protection mode"
  214. default COMPILER_STACK_CHECK_MODE_NONE
  215. help
  216. Stack smashing protection mode. Emit extra code to check for buffer overflows, such as stack
  217. smashing attacks. This is done by adding a guard variable to functions with vulnerable objects.
  218. The guards are initialized when a function is entered and then checked when the function exits.
  219. If a guard check fails, program is halted. Protection has the following modes:
  220. - In NORMAL mode (GCC flag: -fstack-protector) only functions that call alloca, and functions with
  221. buffers larger than 8 bytes are protected.
  222. - STRONG mode (GCC flag: -fstack-protector-strong) is like NORMAL, but includes additional functions
  223. to be protected -- those that have local array definitions, or have references to local frame
  224. addresses.
  225. - In OVERALL mode (GCC flag: -fstack-protector-all) all functions are protected.
  226. Modes have the following impact on code performance and coverage:
  227. - performance: NORMAL > STRONG > OVERALL
  228. - coverage: NORMAL < STRONG < OVERALL
  229. config COMPILER_STACK_CHECK_MODE_NONE
  230. bool "None"
  231. config COMPILER_STACK_CHECK_MODE_NORM
  232. bool "Normal"
  233. config COMPILER_STACK_CHECK_MODE_STRONG
  234. bool "Strong"
  235. config COMPILER_STACK_CHECK_MODE_ALL
  236. bool "Overall"
  237. endchoice
  238. config COMPILER_STACK_CHECK
  239. bool
  240. default !COMPILER_STACK_CHECK_MODE_NONE
  241. help
  242. Stack smashing protection.
  243. config COMPILER_WARN_WRITE_STRINGS
  244. bool "Enable -Wwrite-strings warning flag"
  245. default "n"
  246. help
  247. Adds -Wwrite-strings flag for the C/C++ compilers.
  248. For C, this gives string constants the type ``const char[]`` so that
  249. copying the address of one into a non-const ``char *`` pointer
  250. produces a warning. This warning helps to find at compile time code
  251. that tries to write into a string constant.
  252. For C++, this warns about the deprecated conversion from string
  253. literals to ``char *``.
  254. config COMPILER_DISABLE_GCC8_WARNINGS
  255. bool "Disable new warnings introduced in GCC 6 - 8"
  256. default "n"
  257. help
  258. Enable this option if using GCC 6 or newer, and wanting to disable warnings which don't appear with
  259. GCC 5.
  260. endmenu # Compiler Options
  261. menu "Component config"
  262. source "$COMPONENT_KCONFIGS_SOURCE_FILE"
  263. endmenu
  264. menu "Compatibility options"
  265. config LEGACY_INCLUDE_COMMON_HEADERS
  266. bool "Include headers across components as before IDF v4.0"
  267. default n
  268. help
  269. Soc, esp32, and driver components, the most common
  270. components. Some header of these components are included
  271. implicitly by headers of other components before IDF v4.0.
  272. It's not required for high-level components, but still
  273. included through long header chain everywhere.
  274. This is harmful to the modularity. So it's changed in IDF
  275. v4.0.
  276. You can still include these headers in a legacy way until it
  277. is totally deprecated by enable this option.
  278. endmenu #Compatibility options