Kconfig 16 KB

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