Kconfig.projbuild 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. menu "Bootloader config"
  2. choice BOOTLOADER_LOG_LEVEL
  3. bool "Bootloader log verbosity"
  4. default BOOTLOADER_LOG_LEVEL_INFO
  5. help
  6. Specify how much output to see in bootloader logs.
  7. config BOOTLOADER_LOG_LEVEL_NONE
  8. bool "No output"
  9. config BOOTLOADER_LOG_LEVEL_ERROR
  10. bool "Error"
  11. config BOOTLOADER_LOG_LEVEL_WARN
  12. bool "Warning"
  13. config BOOTLOADER_LOG_LEVEL_INFO
  14. bool "Info"
  15. config BOOTLOADER_LOG_LEVEL_DEBUG
  16. bool "Debug"
  17. config BOOTLOADER_LOG_LEVEL_VERBOSE
  18. bool "Verbose"
  19. endchoice
  20. config BOOTLOADER_LOG_LEVEL
  21. int
  22. default 0 if BOOTLOADER_LOG_LEVEL_NONE
  23. default 1 if BOOTLOADER_LOG_LEVEL_ERROR
  24. default 2 if BOOTLOADER_LOG_LEVEL_WARN
  25. default 3 if BOOTLOADER_LOG_LEVEL_INFO
  26. default 4 if BOOTLOADER_LOG_LEVEL_DEBUG
  27. default 5 if BOOTLOADER_LOG_LEVEL_VERBOSE
  28. config BOOTLOADER_SPI_WP_PIN
  29. int "SPI Flash WP Pin when customising pins via eFuse (read help)"
  30. range 0 33
  31. default 7
  32. depends on ESPTOOLPY_FLASHMODE_QIO || ESPTOOLPY_FLASHMODE_QOUT
  33. help
  34. This value is ignored unless flash mode is set to QIO or QOUT *and* the SPI flash pins have been
  35. overriden by setting the eFuses SPI_PAD_CONFIG_xxx.
  36. When this is the case, the eFuse config only defines 3 of the 4 Quad I/O data pins. The WP pin (aka ESP32
  37. pin "SD_DATA_3" or SPI flash pin "IO2") is not specified in eFuse. That pin number is compiled into the
  38. bootloader instead.
  39. The default value (GPIO 7) is correct for WP pin on ESP32-D2WD integrated flash.
  40. choice BOOTLOADER_VDDSDIO_BOOST
  41. bool "VDDSDIO LDO voltage"
  42. default BOOTLOADER_VDDSDIO_BOOST_1_9V
  43. help
  44. If this option is enabled, and VDDSDIO LDO is set to 1.8V (using eFuse
  45. or MTDI bootstrapping pin), bootloader will change LDO settings to
  46. output 1.9V instead. This helps prevent flash chip from browning out
  47. during flash programming operations.
  48. This option has no effect if VDDSDIO is set to 3.3V, or if the internal
  49. VDDSDIO regulator is disabled via eFuse.
  50. config BOOTLOADER_VDDSDIO_BOOST_1_8V
  51. bool "1.8V"
  52. depends on !ESPTOOLPY_FLASHFREQ_80M
  53. config BOOTLOADER_VDDSDIO_BOOST_1_9V
  54. bool "1.9V"
  55. endchoice
  56. config BOOTLOADER_FACTORY_RESET
  57. bool "GPIO triggers factory reset"
  58. default N
  59. help
  60. Allows to reset the device to factory settings:
  61. - clear one or more data partitions;
  62. - boot from "factory" partition.
  63. The factory reset will occur if there is a GPIO input pulled low while device starts up.
  64. See settings below.
  65. config BOOTLOADER_NUM_PIN_FACTORY_RESET
  66. int "Number of the GPIO input for factory reset"
  67. depends on BOOTLOADER_FACTORY_RESET
  68. range 0 39
  69. default 4
  70. help
  71. The selected GPIO will be configured as an input with internal pull-up enabled.
  72. To trigger a factory reset, this GPIO must be pulled low on reset.
  73. Note that GPIO34-39 do not have an internal pullup and an external one must be provided.
  74. config BOOTLOADER_OTA_DATA_ERASE
  75. bool "Clear OTA data on factory reset (select factory partition)"
  76. depends on BOOTLOADER_FACTORY_RESET
  77. help
  78. The device will boot from "factory" partition (or OTA slot 0 if no factory partition is present) after a
  79. factory reset.
  80. config BOOTLOADER_DATA_FACTORY_RESET
  81. string "Comma-separated names of partitions to clear on factory reset"
  82. depends on BOOTLOADER_FACTORY_RESET
  83. default "nvs"
  84. help
  85. Allows customers to select which data partitions will be erased while factory reset.
  86. Specify the names of partitions as a comma-delimited with optional spaces for readability. (Like this:
  87. "nvs, phy_init, ...")
  88. Make sure that the name specified in the partition table and here are the same.
  89. Partitions of type "app" cannot be specified here.
  90. config BOOTLOADER_APP_TEST
  91. bool "GPIO triggers boot from test app partition"
  92. default N
  93. help
  94. Allows to run the test app from "TEST" partition.
  95. A boot from "test" partition will occur if there is a GPIO input pulled low while device starts up.
  96. See settings below.
  97. config BOOTLOADER_NUM_PIN_APP_TEST
  98. int "Number of the GPIO input to boot TEST partition"
  99. depends on BOOTLOADER_APP_TEST
  100. range 0 39
  101. default 18
  102. help
  103. The selected GPIO will be configured as an input with internal pull-up enabled.
  104. To trigger a test app, this GPIO must be pulled low on reset.
  105. After the GPIO input is deactivated and the device reboots, the old application will boot.
  106. (factory or OTA[x]).
  107. Note that GPIO34-39 do not have an internal pullup and an external one must be provided.
  108. config BOOTLOADER_HOLD_TIME_GPIO
  109. int "Hold time of GPIO for reset/test mode (seconds)"
  110. depends on BOOTLOADER_FACTORY_RESET || BOOTLOADER_APP_TEST
  111. default 5
  112. help
  113. The GPIO must be held low continuously for this period of time after reset
  114. before a factory reset or test partition boot (as applicable) is performed.
  115. config BOOTLOADER_WDT_ENABLE
  116. bool "Use RTC watchdog in start code"
  117. default y
  118. help
  119. Tracks the execution time of startup code.
  120. If the execution time is exceeded, the RTC_WDT will restart system.
  121. It is also useful to prevent a lock up in start code caused by an unstable power source.
  122. NOTE: Tracks the execution time starts from the bootloader code - re-set timeout, while selecting the
  123. source for slow_clk - and ends calling app_main.
  124. Re-set timeout is needed due to WDT uses a SLOW_CLK clock source. After changing a frequency slow_clk a
  125. time of WDT needs to re-set for new frequency.
  126. slow_clk depends on ESP32_RTC_CLK_SRC (INTERNAL_RC or EXTERNAL_CRYSTAL).
  127. config BOOTLOADER_WDT_DISABLE_IN_USER_CODE
  128. bool "Allows RTC watchdog disable in user code"
  129. depends on BOOTLOADER_WDT_ENABLE
  130. default n
  131. help
  132. If it is set, the client must itself reset or disable rtc_wdt in their code (app_main()).
  133. Otherwise rtc_wdt will be disabled before calling app_main function.
  134. Use function rtc_wdt_feed() for resetting counter of rtc_wdt.
  135. Use function rtc_wdt_disable() for disabling rtc_wdt.
  136. config BOOTLOADER_WDT_TIME_MS
  137. int "Timeout for RTC watchdog (ms)"
  138. depends on BOOTLOADER_WDT_ENABLE
  139. default 9000
  140. range 0 120000
  141. help
  142. Verify that this parameter is correct and more then the execution time.
  143. Pay attention to options such as reset to factory, trigger test partition and encryption on boot
  144. - these options can increase the execution time.
  145. Note: RTC_WDT will reset while encryption operations will be performed.
  146. config BOOTLOADER_APP_ROLLBACK_ENABLE
  147. bool "Enable app rollback support"
  148. default n
  149. help
  150. After updating the app, the bootloader runs a new app with the "ESP_OTA_IMG_PENDING_VERIFY" state set.
  151. This state prevents the re-run of this app. After the first boot of the new app in the user code, the
  152. function should be called to confirm the operability of the app or vice versa about its non-operability.
  153. If the app is working, then it is marked as valid. Otherwise, it is marked as not valid and rolls back to
  154. the previous working app. A reboot is performed, and the app is booted before the software update.
  155. Note: If during the first boot a new app the power goes out or the WDT works, then roll back will happen.
  156. Rollback is possible only between the apps with the same security versions.
  157. config BOOTLOADER_APP_ANTI_ROLLBACK
  158. bool "Enable app anti-rollback support"
  159. depends on BOOTLOADER_APP_ROLLBACK_ENABLE
  160. default n
  161. help
  162. This option prevents rollback to previous firmware/application image with lower security version.
  163. config BOOTLOADER_APP_SECURE_VERSION
  164. int "eFuse secure version of app"
  165. depends on BOOTLOADER_APP_ANTI_ROLLBACK
  166. default 0
  167. help
  168. The secure version is the sequence number stored in the header of each firmware.
  169. The security version is set in the bootloader, version is recorded in the eFuse field
  170. as the number of set ones. The allocated number of bits in the efuse field
  171. for storing the security version is limited (see BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD option).
  172. Bootloader: When bootloader selects an app to boot, an app is selected that has
  173. a security version greater or equal that recorded in eFuse field.
  174. The app is booted with a higher (or equal) secure version.
  175. The security version is worth increasing if in previous versions there is
  176. a significant vulnerability and their use is not acceptable.
  177. Your partition table should has a scheme with ota_0 + ota_1 (without factory).
  178. config BOOTLOADER_APP_SEC_VER_SIZE_EFUSE_FIELD
  179. int "Size of the efuse secure version field"
  180. depends on BOOTLOADER_APP_ANTI_ROLLBACK
  181. range 1 32
  182. default 32
  183. help
  184. The size of the efuse secure version field. Its length is limited to 32 bits.
  185. This determines how many times the security version can be increased.
  186. config BOOTLOADER_EFUSE_SECURE_VERSION_EMULATE
  187. bool "Emulate operations with efuse secure version(only test)"
  188. default n
  189. depends on BOOTLOADER_APP_ANTI_ROLLBACK
  190. help
  191. This option allow emulate read/write operations with efuse secure version.
  192. It allow to test anti-rollback implemention without permanent write eFuse bits.
  193. In partition table should be exist this partition `emul_efuse, data, 5, , 0x2000`.
  194. config BOOTLOADER_FLASH_XMC_SUPPORT
  195. bool "Enable the support for flash chips of XMC (READ HELP FIRST)"
  196. default y
  197. help
  198. Perform the startup flow recommended by XMC. Please consult XMC for the details of this flow.
  199. XMC chips will be forbidden to be used, when this option is disabled.
  200. DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU ARE DOING.
  201. endmenu # Bootloader
  202. menu "Security features"
  203. # These three are the actual options to check in code,
  204. # selected by the displayed options
  205. config SECURE_SIGNED_ON_BOOT
  206. bool
  207. default y
  208. depends on SECURE_BOOT_ENABLED || SECURE_SIGNED_ON_BOOT_NO_SECURE_BOOT
  209. config SECURE_SIGNED_ON_UPDATE
  210. bool
  211. default y
  212. depends on SECURE_BOOT_ENABLED || SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
  213. config SECURE_SIGNED_APPS
  214. bool
  215. default y
  216. select MBEDTLS_ECP_DP_SECP256R1_ENABLED
  217. select MBEDTLS_ECP_C
  218. select MBEDTLS_ECDH_C
  219. select MBEDTLS_ECDSA_C
  220. depends on SECURE_SIGNED_ON_BOOT || SECURE_SIGNED_ON_UPDATE
  221. config SECURE_SIGNED_APPS_NO_SECURE_BOOT
  222. bool "Require signed app images"
  223. default n
  224. depends on !SECURE_BOOT_ENABLED
  225. help
  226. Require apps to be signed to verify their integrity.
  227. This option uses the same app signature scheme as hardware secure boot, but unlike hardware secure boot it
  228. does not prevent the bootloader from being physically updated. This means that the device can be secured
  229. against remote network access, but not physical access. Compared to using hardware Secure Boot this option
  230. is much simpler to implement.
  231. config SECURE_SIGNED_ON_BOOT_NO_SECURE_BOOT
  232. bool "Bootloader verifies app signatures"
  233. default n
  234. depends on SECURE_SIGNED_APPS_NO_SECURE_BOOT
  235. help
  236. If this option is set, the bootloader will be compiled with code to verify that an app is signed before
  237. booting it.
  238. If hardware secure boot is enabled, this option is always enabled and cannot be disabled.
  239. If hardware secure boot is not enabled, this option doesn't add significant security by itself so most
  240. users will want to leave it disabled.
  241. config SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
  242. bool "Verify app signature on update"
  243. default y
  244. depends on SECURE_SIGNED_APPS_NO_SECURE_BOOT
  245. help
  246. If this option is set, any OTA updated apps will have the signature verified before being considered valid.
  247. When enabled, the signature is automatically checked whenever the esp_ota_ops.h APIs are used for OTA
  248. updates, or esp_image_format.h APIs are used to verify apps.
  249. If hardware secure boot is enabled, this option is always enabled and cannot be disabled.
  250. If hardware secure boot is not enabled, this option still adds significant security against network-based
  251. attackers by preventing spoofing of OTA updates.
  252. config SECURE_BOOT_ENABLED
  253. bool "Enable hardware secure boot in bootloader (READ DOCS FIRST)"
  254. default n
  255. help
  256. Build a bootloader which enables secure boot on first boot.
  257. Once enabled, secure boot will not boot a modified bootloader. The bootloader will only load a partition
  258. table or boot an app if the data has a verified digital signature. There are implications for reflashing
  259. updated apps once secure boot is enabled.
  260. When enabling secure boot, JTAG and ROM BASIC Interpreter are permanently disabled by default.
  261. Refer to https://docs.espressif.com/projects/esp-idf/en/latest/security/secure-boot.html before enabling.
  262. choice SECURE_BOOTLOADER_MODE
  263. bool "Secure bootloader mode"
  264. depends on SECURE_BOOT_ENABLED
  265. default SECURE_BOOTLOADER_ONE_TIME_FLASH
  266. config SECURE_BOOTLOADER_ONE_TIME_FLASH
  267. bool "One-time flash"
  268. help
  269. On first boot, the bootloader will generate a key which is not readable externally or by software. A
  270. digest is generated from the bootloader image itself. This digest will be verified on each subsequent
  271. boot.
  272. Enabling this option means that the bootloader cannot be changed after the first time it is booted.
  273. config SECURE_BOOTLOADER_REFLASHABLE
  274. bool "Reflashable"
  275. help
  276. Generate a reusable secure bootloader key, derived (via SHA-256) from the secure boot signing key.
  277. This allows the secure bootloader to be re-flashed by anyone with access to the secure boot signing
  278. key.
  279. This option is less secure than one-time flash, because a leak of the digest key from one device
  280. allows reflashing of any device that uses it.
  281. endchoice
  282. config SECURE_BOOT_BUILD_SIGNED_BINARIES
  283. bool "Sign binaries during build"
  284. depends on SECURE_SIGNED_APPS
  285. default y
  286. help
  287. Once secure boot or signed app requirement is enabled, app images are required to be signed.
  288. If enabled (default), these binary files are signed as part of the build process. The file named in
  289. "Secure boot private signing key" will be used to sign the image.
  290. If disabled, unsigned app/partition data will be built. They must be signed manually using espsecure.py
  291. (for example, on a remote signing server.)
  292. config SECURE_BOOT_SIGNING_KEY
  293. string "Secure boot private signing key"
  294. depends on SECURE_BOOT_BUILD_SIGNED_BINARIES
  295. default "secure_boot_signing_key.pem"
  296. help
  297. Path to the key file used to sign app images.
  298. Key file is an ECDSA private key (NIST256p curve) in PEM format.
  299. Path is evaluated relative to the project directory.
  300. You can generate a new signing key by running the following command:
  301. espsecure.py generate_signing_key secure_boot_signing_key.pem
  302. See https://docs.espressif.com/projects/esp-idf/en/latest/security/secure-boot.html for details.
  303. config SECURE_BOOT_VERIFICATION_KEY
  304. string "Secure boot public signature verification key"
  305. depends on SECURE_SIGNED_APPS && !SECURE_BOOT_BUILD_SIGNED_BINARIES
  306. default "signature_verification_key.bin"
  307. help
  308. Path to a public key file used to verify signed images. This key is compiled into the bootloader and/or
  309. app, to verify app images.
  310. Key file is in raw binary format, and can be extracted from a
  311. PEM formatted private key using the espsecure.py
  312. extract_public_key command.
  313. Refer to https://docs.espressif.com/projects/esp-idf/en/latest/security/secure-boot.html before enabling.
  314. choice SECURE_BOOTLOADER_KEY_ENCODING
  315. bool "Hardware Key Encoding"
  316. depends on SECURE_BOOTLOADER_REFLASHABLE
  317. default SECURE_BOOTLOADER_KEY_ENCODING_256BIT
  318. help
  319. In reflashable secure bootloader mode, a hardware key is derived from the signing key (with SHA-256) and
  320. can be written to eFuse with espefuse.py.
  321. Normally this is a 256-bit key, but if 3/4 Coding Scheme is used on the device then the eFuse key is
  322. truncated to 192 bits.
  323. This configuration item doesn't change any firmware code, it only changes the size of key binary which is
  324. generated at build time.
  325. config SECURE_BOOTLOADER_KEY_ENCODING_256BIT
  326. bool "No encoding (256 bit key)"
  327. config SECURE_BOOTLOADER_KEY_ENCODING_192BIT
  328. bool "3/4 encoding (192 bit key)"
  329. endchoice
  330. config SECURE_BOOT_INSECURE
  331. bool "Allow potentially insecure options"
  332. depends on SECURE_BOOT_ENABLED
  333. default N
  334. help
  335. You can disable some of the default protections offered by secure boot, in order to enable testing or a
  336. custom combination of security features.
  337. Only enable these options if you are very sure.
  338. Refer to https://docs.espressif.com/projects/esp-idf/en/latest/security/secure-boot.html before enabling.
  339. config SECURE_FLASH_ENC_ENABLED
  340. bool "Enable flash encryption on boot (READ DOCS FIRST)"
  341. default N
  342. select SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE
  343. help
  344. If this option is set, flash contents will be encrypted by the bootloader on first boot.
  345. Note: After first boot, the system will be permanently encrypted. Re-flashing an encrypted
  346. system is complicated and not always possible.
  347. Read https://docs.espressif.com/projects/esp-idf/en/latest/security/flash-encryption.html
  348. before enabling.
  349. choice SECURE_FLASH_ENCRYPTION_MODE
  350. bool "Enable usage mode"
  351. depends on SECURE_FLASH_ENC_ENABLED
  352. default SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
  353. help
  354. By default Development mode is enabled which allows UART bootloader to perform flash encryption operations
  355. Select Release mode only for production or manufacturing. Once enabled you can not reflash using UART
  356. bootloader
  357. Refer to https://docs.espressif.com/projects/esp-idf/en/latest/security/secure-boot.html and
  358. https://docs.espressif.com/projects/esp-idf/en/latest/security/flash-encryption.html for details.
  359. config SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
  360. bool "Development(NOT SECURE)"
  361. select SECURE_FLASH_UART_BOOTLOADER_ALLOW_ENC
  362. config SECURE_FLASH_ENCRYPTION_MODE_RELEASE
  363. bool "Release"
  364. select PARTITION_TABLE_MD5 if !ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS
  365. endchoice
  366. menu "Potentially insecure options"
  367. visible if SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT || SECURE_BOOT_INSECURE
  368. # NOTE: Options in this menu NEED to have SECURE_BOOT_INSECURE
  369. # and/or SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT in "depends on", as the menu
  370. # itself doesn't enable/disable its children (if it's not set,
  371. # it's possible for the insecure menu to be disabled but the insecure option
  372. # to remain on which is very bad.)
  373. config SECURE_BOOT_ALLOW_ROM_BASIC
  374. bool "Leave ROM BASIC Interpreter available on reset"
  375. depends on SECURE_BOOT_INSECURE || SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
  376. default N
  377. help
  378. By default, the BASIC ROM Console starts on reset if no valid bootloader is
  379. read from the flash.
  380. When either flash encryption or secure boot are enabled, the default is to
  381. disable this BASIC fallback mode permanently via eFuse.
  382. If this option is set, this eFuse is not burned and the BASIC ROM Console may
  383. remain accessible. Only set this option in testing environments.
  384. config SECURE_BOOT_ALLOW_JTAG
  385. bool "Allow JTAG Debugging"
  386. depends on SECURE_BOOT_INSECURE || SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
  387. default N
  388. help
  389. If not set (default), the bootloader will permanently disable JTAG (across entire chip) on first boot
  390. when either secure boot or flash encryption is enabled.
  391. Setting this option leaves JTAG on for debugging, which negates all protections of flash encryption
  392. and some of the protections of secure boot.
  393. Only set this option in testing environments.
  394. config SECURE_BOOT_ALLOW_SHORT_APP_PARTITION
  395. bool "Allow app partition length not 64KB aligned"
  396. depends on SECURE_BOOT_INSECURE
  397. help
  398. If not set (default), app partition size must be a multiple of 64KB. App images are padded to 64KB
  399. length, and the bootloader checks any trailing bytes after the signature (before the next 64KB
  400. boundary) have not been written. This is because flash cache maps entire 64KB pages into the address
  401. space. This prevents an attacker from appending unverified data after the app image in the flash,
  402. causing it to be mapped into the address space.
  403. Setting this option allows the app partition length to be unaligned, and disables padding of the app
  404. image to this length. It is generally not recommended to set this option, unless you have a legacy
  405. partitioning scheme which doesn't support 64KB aligned partition lengths.
  406. config SECURE_FLASH_UART_BOOTLOADER_ALLOW_ENC
  407. bool "Leave UART bootloader encryption enabled"
  408. depends on SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
  409. default N
  410. help
  411. If not set (default), the bootloader will permanently disable UART bootloader encryption access on
  412. first boot. If set, the UART bootloader will still be able to access hardware encryption.
  413. It is recommended to only set this option in testing environments.
  414. config SECURE_FLASH_UART_BOOTLOADER_ALLOW_DEC
  415. bool "Leave UART bootloader decryption enabled"
  416. depends on SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
  417. default N
  418. help
  419. If not set (default), the bootloader will permanently disable UART bootloader decryption access on
  420. first boot. If set, the UART bootloader will still be able to access hardware decryption.
  421. Only set this option in testing environments. Setting this option allows complete bypass of flash
  422. encryption.
  423. config SECURE_FLASH_UART_BOOTLOADER_ALLOW_CACHE
  424. bool "Leave UART bootloader flash cache enabled"
  425. depends on SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
  426. default N
  427. help
  428. If not set (default), the bootloader will permanently disable UART bootloader flash cache access on
  429. first boot. If set, the UART bootloader will still be able to access the flash cache.
  430. Only set this option in testing environments.
  431. config SECURE_FLASH_REQUIRE_ALREADY_ENABLED
  432. bool "Require flash encryption to be already enabled"
  433. depends on SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT
  434. default N
  435. help
  436. If not set (default), and flash encryption is not yet enabled in eFuses, the 2nd stage bootloader
  437. will enable flash encryption: generate the flash encryption key and program eFuses.
  438. If this option is set, and flash encryption is not yet enabled, the bootloader will error out and
  439. reboot.
  440. If flash encryption is enabled in eFuses, this option does not change the bootloader behavior.
  441. Only use this option in testing environments, to avoid accidentally enabling flash encryption on
  442. the wrong device. The device needs to have flash encryption already enabled using espefuse.py.
  443. endmenu # Potentially Insecure
  444. config SECURE_DISABLE_ROM_DL_MODE
  445. bool "Permanently disable ROM Download Mode"
  446. depends on ESP32_REV_MIN_3
  447. default n
  448. help
  449. If set, during startup the app will burn an eFuse bit to permanently disable the UART ROM
  450. Download Mode. This prevents any future use of esptool.py, espefuse.py and similar tools.
  451. Once disabled, if the SoC is booted with strapping pins set for ROM Download Mode
  452. then an error is printed instead.
  453. It is recommended to enable this option in any production application where Flash
  454. Encryption and/or Secure Boot is enabled and access to Download Mode is not required.
  455. It is also possible to permanently disable Download Mode by calling
  456. esp_efuse_disable_rom_download_mode() at runtime.
  457. endmenu # Security features