Kconfig 19 KB

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