Kconfig 16 KB

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