Kconfig 15 KB

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