Kconfig.projbuild 26 KB

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