Kconfig 20 KB

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