Kconfig 19 KB

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