Kconfig 15 KB

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