Kconfig 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  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. 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_ARCH
  21. string
  22. default "riscv" if IDF_TARGET_ARCH_RISCV
  23. default "xtensa" if IDF_TARGET_ARCH_XTENSA
  24. config IDF_TARGET
  25. # This option records the IDF target when sdkconfig is generated the first time.
  26. # It is not updated if environment variable $IDF_TARGET changes later, and
  27. # the build system is responsible for detecting the mismatch between
  28. # CONFIG_IDF_TARGET and $IDF_TARGET.
  29. string
  30. default "$IDF_TARGET"
  31. config IDF_TARGET_LINUX
  32. bool
  33. default "y" if IDF_TARGET="linux"
  34. config IDF_TARGET_ESP32
  35. bool
  36. default "y" if IDF_TARGET="esp32"
  37. select IDF_TARGET_ARCH_XTENSA
  38. config IDF_TARGET_ESP32S2
  39. bool
  40. default "y" if IDF_TARGET="esp32s2"
  41. select FREERTOS_UNICORE
  42. select IDF_TARGET_ARCH_XTENSA
  43. config IDF_TARGET_ESP32S3
  44. bool
  45. default "y" if IDF_TARGET="esp32s3"
  46. select IDF_TARGET_ARCH_XTENSA
  47. config IDF_TARGET_ESP32C3
  48. bool
  49. default "y" if IDF_TARGET="esp32c3"
  50. select FREERTOS_UNICORE
  51. select IDF_TARGET_ARCH_RISCV
  52. config IDF_TARGET_ESP32H2
  53. bool
  54. default "y" if IDF_TARGET="esp32h2"
  55. select FREERTOS_UNICORE
  56. select IDF_TARGET_ARCH_RISCV
  57. choice IDF_TARGET_ESP32H2_BETA_VERSION
  58. prompt "ESP32-H2 beta version"
  59. depends on IDF_TARGET_ESP32H2
  60. default IDF_TARGET_ESP32H2_BETA_VERSION_1
  61. help
  62. Currently ESP32-H2 has several beta versions for internal use only.
  63. Select the one that matches your chip model.
  64. config IDF_TARGET_ESP32H2_BETA_VERSION_1
  65. bool
  66. prompt "ESP32-H2 beta1"
  67. config IDF_TARGET_ESP32H2_BETA_VERSION_2
  68. bool
  69. prompt "ESP32-H2 beta2"
  70. select ESPTOOLPY_NO_STUB # TODO: IDF-4288
  71. endchoice
  72. config IDF_TARGET_ESP32C2
  73. bool
  74. default "y" if IDF_TARGET="esp32c2"
  75. select FREERTOS_UNICORE
  76. select IDF_TARGET_ARCH_RISCV
  77. config IDF_TARGET_LINUX
  78. bool
  79. default "y" if IDF_TARGET="linux"
  80. config IDF_FIRMWARE_CHIP_ID
  81. hex
  82. default 0x0000 if IDF_TARGET_ESP32
  83. default 0x0002 if IDF_TARGET_ESP32S2
  84. default 0x0005 if IDF_TARGET_ESP32C3
  85. default 0x0009 if IDF_TARGET_ESP32S3
  86. default 0x000C if IDF_TARGET_ESP32C2
  87. default 0x000A if IDF_TARGET_ESP32H2_BETA_VERSION_1
  88. default 0x000E if IDF_TARGET_ESP32H2_BETA_VERSION_2 # ESP32H2-TODO: IDF-3475
  89. default 0xFFFF
  90. menu "Build type"
  91. choice APP_BUILD_TYPE
  92. prompt "Application build type"
  93. default APP_BUILD_TYPE_APP_2NDBOOT
  94. help
  95. Select the way the application is built.
  96. By default, the application is built as a binary file in a format compatible with
  97. the ESP-IDF bootloader. In addition to this application, 2nd stage bootloader is
  98. also built. Application and bootloader binaries can be written into flash and
  99. loaded/executed from there.
  100. Another option, useful for only very small and limited applications, is to only link
  101. the .elf file of the application, such that it can be loaded directly into RAM over
  102. JTAG. Note that since IRAM and DRAM sizes are very limited, it is not possible to
  103. build any complex application this way. However for kinds of testing and debugging,
  104. this option may provide faster iterations, since the application does not need to be
  105. written into flash.
  106. Note that at the moment, ESP-IDF does not contain all the startup code required to
  107. initialize the CPUs and ROM memory (data/bss). Therefore it is necessary to execute
  108. a bit of ROM code prior to executing the application. A gdbinit file may look as follows (for ESP32):
  109. # Connect to a running instance of OpenOCD
  110. target remote :3333
  111. # Reset and halt the target
  112. mon reset halt
  113. # Run to a specific point in ROM code,
  114. # where most of initialization is complete.
  115. thb *0x40007d54
  116. c
  117. # Load the application into RAM
  118. load
  119. # Run till app_main
  120. tb app_main
  121. c
  122. Execute this gdbinit file as follows:
  123. xtensa-esp32-elf-gdb build/app-name.elf -x gdbinit
  124. Example gdbinit files for other targets can be found in tools/test_apps/system/gdb_loadable_elf/
  125. Recommended sdkconfig.defaults for building loadable ELF files is as follows.
  126. CONFIG_APP_BUILD_TYPE_ELF_RAM is required, other options help reduce application
  127. memory footprint.
  128. CONFIG_APP_BUILD_TYPE_ELF_RAM=y
  129. CONFIG_VFS_SUPPORT_TERMIOS=
  130. CONFIG_NEWLIB_NANO_FORMAT=y
  131. CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
  132. CONFIG_ESP_DEBUG_STUBS_ENABLE=
  133. CONFIG_ESP_ERR_TO_NAME_LOOKUP=
  134. config APP_BUILD_TYPE_APP_2NDBOOT
  135. bool
  136. prompt "Default (binary application + 2nd stage bootloader)"
  137. depends on !IDF_TARGET_LINUX
  138. select APP_BUILD_GENERATE_BINARIES
  139. select APP_BUILD_BOOTLOADER
  140. select APP_BUILD_USE_FLASH_SECTIONS
  141. config APP_BUILD_TYPE_ELF_RAM
  142. bool
  143. prompt "ELF file, loadable into RAM (EXPERIMENTAL))"
  144. endchoice # APP_BUILD_TYPE
  145. # Hidden options, set according to the choice above
  146. config APP_BUILD_GENERATE_BINARIES
  147. bool # Whether to generate .bin files or not
  148. config APP_BUILD_BOOTLOADER
  149. bool # Whether to build the bootloader
  150. config APP_BUILD_USE_FLASH_SECTIONS
  151. bool # Whether to place code/data into memory-mapped flash sections
  152. config APP_REPRODUCIBLE_BUILD
  153. bool "Enable reproducible build"
  154. default n
  155. select COMPILER_HIDE_PATHS_MACROS
  156. help
  157. If enabled, all date, time, and path information would be eliminated. A .gdbinit file would be create
  158. automatically. (or will be append if you have one already)
  159. config APP_NO_BLOBS
  160. bool "No Binary Blobs"
  161. default n
  162. help
  163. If enabled, this disables the linking of binary libraries in the application build. Note
  164. that after enabling this Wi-Fi/Bluetooth will not work.
  165. endmenu # Build type
  166. source "$COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE"
  167. menu "Compiler options"
  168. choice COMPILER_OPTIMIZATION
  169. prompt "Optimization Level"
  170. default COMPILER_OPTIMIZATION_DEFAULT
  171. help
  172. This option sets compiler optimization level (gcc -O argument) for the app.
  173. - The "Default" setting will add the -0g flag to CFLAGS.
  174. - The "Size" setting will add the -0s flag to CFLAGS.
  175. - The "Performance" setting will add the -O2 flag to CFLAGS.
  176. - The "None" setting will add the -O0 flag to CFLAGS.
  177. The "Size" setting cause the compiled code to be smaller and faster, but
  178. may lead to difficulties of correlating code addresses to source file
  179. lines when debugging.
  180. The "Performance" setting causes the compiled code to be larger and faster,
  181. but will be easier to correlated code addresses to source file lines.
  182. "None" with -O0 produces compiled code without optimization.
  183. Note that custom optimization levels may be unsupported.
  184. Compiler optimization for the IDF bootloader is set separately,
  185. see the BOOTLOADER_COMPILER_OPTIMIZATION setting.
  186. config COMPILER_OPTIMIZATION_DEFAULT
  187. bool "Debug (-Og)"
  188. config COMPILER_OPTIMIZATION_SIZE
  189. bool "Optimize for size (-Os)"
  190. config COMPILER_OPTIMIZATION_PERF
  191. bool "Optimize for performance (-O2)"
  192. config COMPILER_OPTIMIZATION_NONE
  193. bool "Debug without optimization (-O0)"
  194. endchoice
  195. choice COMPILER_OPTIMIZATION_ASSERTION_LEVEL
  196. prompt "Assertion level"
  197. default COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
  198. help
  199. Assertions can be:
  200. - Enabled. Failure will print verbose assertion details. This is the default.
  201. - Set to "silent" to save code size (failed assertions will abort() but user
  202. needs to use the aborting address to find the line number with the failed assertion.)
  203. - Disabled entirely (not recommended for most configurations.) -DNDEBUG is added
  204. to CPPFLAGS in this case.
  205. config COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
  206. prompt "Enabled"
  207. bool
  208. help
  209. Enable assertions. Assertion content and line number will be printed on failure.
  210. config COMPILER_OPTIMIZATION_ASSERTIONS_SILENT
  211. prompt "Silent (saves code size)"
  212. bool
  213. help
  214. Enable silent assertions. Failed assertions will abort(), user needs to
  215. use the aborting address to find the line number with the failed assertion.
  216. config COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
  217. prompt "Disabled (sets -DNDEBUG)"
  218. bool
  219. help
  220. If assertions are disabled, -DNDEBUG is added to CPPFLAGS.
  221. endchoice # assertions
  222. config COMPILER_OPTIMIZATION_ASSERTION_LEVEL
  223. int
  224. default 0 if COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE
  225. default 1 if COMPILER_OPTIMIZATION_ASSERTIONS_SILENT
  226. default 2 if COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
  227. config COMPILER_OPTIMIZATION_CHECKS_SILENT
  228. bool "Disable messages in ESP_RETURN_ON_* and ESP_EXIT_ON_* macros"
  229. default n
  230. help
  231. If enabled, the error messages will be discarded in following check macros:
  232. - ESP_RETURN_ON_ERROR
  233. - ESP_EXIT_ON_ERROR
  234. - ESP_RETURN_ON_FALSE
  235. - ESP_EXIT_ON_FALSE
  236. menuconfig COMPILER_HIDE_PATHS_MACROS
  237. bool "Replace ESP-IDF and project paths in binaries"
  238. default y
  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. The performance impact includes increasing the amount of stack memory required for each task.
  289. config COMPILER_STACK_CHECK_MODE_NONE
  290. bool "None"
  291. config COMPILER_STACK_CHECK_MODE_NORM
  292. bool "Normal"
  293. config COMPILER_STACK_CHECK_MODE_STRONG
  294. bool "Strong"
  295. config COMPILER_STACK_CHECK_MODE_ALL
  296. bool "Overall"
  297. endchoice
  298. config COMPILER_STACK_CHECK
  299. bool
  300. default !COMPILER_STACK_CHECK_MODE_NONE
  301. help
  302. Stack smashing protection.
  303. config COMPILER_WARN_WRITE_STRINGS
  304. bool "Enable -Wwrite-strings warning flag"
  305. default "n"
  306. help
  307. Adds -Wwrite-strings flag for the C/C++ compilers.
  308. For C, this gives string constants the type ``const char[]`` so that
  309. copying the address of one into a non-const ``char *`` pointer
  310. produces a warning. This warning helps to find at compile time code
  311. that tries to write into a string constant.
  312. For C++, this warns about the deprecated conversion from string
  313. literals to ``char *``.
  314. config COMPILER_SAVE_RESTORE_LIBCALLS
  315. bool "Enable -msave-restore flag to reduce code size"
  316. depends on IDF_TARGET_ARCH_RISCV
  317. help
  318. Adds -msave-restore to C/C++ compilation flags.
  319. When this flag is enabled, compiler will call library functions to
  320. save/restore registers in function prologues/epilogues. This results
  321. in lower overall code size, at the expense of slightly reduced performance.
  322. This option can be enabled for RISC-V targets only.
  323. config COMPILER_DISABLE_GCC8_WARNINGS
  324. bool "Disable new warnings introduced in GCC 6 - 8"
  325. default "n"
  326. help
  327. Enable this option if using GCC 6 or newer, and wanting to disable warnings which don't appear with
  328. GCC 5.
  329. config COMPILER_DUMP_RTL_FILES
  330. bool "Dump RTL files during compilation"
  331. help
  332. If enabled, RTL files will be produced during compilation. These files
  333. can be used by other tools, for example to calculate call graphs.
  334. endmenu # Compiler Options
  335. menu "Component config"
  336. source "$COMPONENT_KCONFIGS_SOURCE_FILE"
  337. endmenu