Kconfig 18 KB

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