Kconfig 17 KB

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