1 menu "Bootloader config"
2 choice LOG_BOOTLOADER_LEVEL
3 bool "Bootloader log verbosity"
4 default LOG_BOOTLOADER_LEVEL_INFO
6 Specify how much output to see in bootloader logs.
8 config LOG_BOOTLOADER_LEVEL_NONE
10 config LOG_BOOTLOADER_LEVEL_ERROR
12 config LOG_BOOTLOADER_LEVEL_WARN
14 config LOG_BOOTLOADER_LEVEL_INFO
16 config LOG_BOOTLOADER_LEVEL_DEBUG
18 config LOG_BOOTLOADER_LEVEL_VERBOSE
22 config LOG_BOOTLOADER_LEVEL
24 default 0 if LOG_BOOTLOADER_LEVEL_NONE
25 default 1 if LOG_BOOTLOADER_LEVEL_ERROR
26 default 2 if LOG_BOOTLOADER_LEVEL_WARN
27 default 3 if LOG_BOOTLOADER_LEVEL_INFO
28 default 4 if LOG_BOOTLOADER_LEVEL_DEBUG
29 default 5 if LOG_BOOTLOADER_LEVEL_VERBOSE
31 config BOOTLOADER_SPI_WP_PIN
32 int "SPI Flash WP Pin when customising pins via efuse (read help)"
35 depends on FLASHMODE_QIO || FLASHMODE_QOUT
37 This value is ignored unless flash mode is set to QIO or QOUT *and* the SPI flash pins have been
38 overriden by setting the efuses SPI_PAD_CONFIG_xxx.
40 When this is the case, the Efuse config only defines 3 of the 4 Quad I/O data pins. The WP pin (aka ESP32
41 pin "SD_DATA_3" or SPI flash pin "IO2") is not specified in Efuse. That pin number is compiled into the bootloader
44 The default value (GPIO 7) is correct for WP pin on ESP32-D2WD integrated flash.
46 choice BOOTLOADER_VDDSDIO_BOOST
47 bool "VDDSDIO LDO voltage"
48 default BOOTLOADER_VDDSDIO_BOOST_1_9V
50 If this option is enabled, and VDDSDIO LDO is set to 1.8V (using EFUSE
51 or MTDI bootstrapping pin), bootloader will change LDO settings to
52 output 1.9V instead. This helps prevent flash chip from browning out
53 during flash programming operations.
55 This option has no effect if VDDSDIO is set to 3.3V, or if the internal
56 VDDSDIO regulator is disabled via efuse.
58 config BOOTLOADER_VDDSDIO_BOOST_1_8V
60 depends on !ESPTOOLPY_FLASHFREQ_80M
61 config BOOTLOADER_VDDSDIO_BOOST_1_9V
65 config BOOTLOADER_FACTORY_RESET
66 bool "GPIO triggers factory reset"
69 Allows to reset the device to factory settings:
70 - clear one or more data partitions;
71 - boot from "factory" partition.
72 The factory reset will occur if there is a GPIO input pulled low while device starts up.
75 config BOOTLOADER_NUM_PIN_FACTORY_RESET
76 int "Number of the GPIO input for factory reset"
77 depends on BOOTLOADER_FACTORY_RESET
81 The selected GPIO will be configured as an input with internal pull-up enabled.
82 To trigger a factory reset, this GPIO must be pulled low on reset.
83 Note that GPIO34-39 do not have an internal pullup and an external one must be provided.
85 config BOOTLOADER_OTA_DATA_ERASE
86 bool "Clear OTA data on factory reset (select factory partition)"
87 depends on BOOTLOADER_FACTORY_RESET
89 The device will boot from "factory" partition (or OTA slot 0 if no factory partition is present) after a factory reset.
91 config BOOTLOADER_DATA_FACTORY_RESET
92 string "Comma-separated names of partitions to clear on factory reset"
93 depends on BOOTLOADER_FACTORY_RESET
96 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: "nvs, phy_init, ...")
99 Make sure that the name specified in the partition table and here are the same.
100 Partitions of type "app" cannot be specified here.
102 config BOOTLOADER_APP_TEST
103 bool "GPIO triggers boot from test app partition"
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.
110 config BOOTLOADER_NUM_PIN_APP_TEST
111 int "Number of the GPIO input to boot TEST partition"
112 depends on BOOTLOADER_APP_TEST
116 The selected GPIO will be configured as an input with internal pull-up enabled.
117 To trigger a test app, this GPIO must be pulled low on reset.
118 After the GPIO input is deactivated and the device reboots, the old application will boot.
120 Note that GPIO34-39 do not have an internal pullup and an external one must be provided.
122 config BOOTLOADER_HOLD_TIME_GPIO
123 int "Hold time of GPIO for reset/test mode (seconds)"
124 depends on BOOTLOADER_FACTORY_RESET || BOOTLOADER_APP_TEST
127 The GPIO must be held low continuously for this period of time after reset
128 before a factory reset or test partition boot (as applicable) is performed.
133 menu "Security features"
135 config SECURE_BOOT_ENABLED
136 bool "Enable secure boot in bootloader (READ DOCS FIRST)"
139 Build a bootloader which enables secure boot on first boot.
141 Once enabled, secure boot will not boot a modified bootloader. The bootloader will only load a partition table or boot an app if the data has a verified digital signature. There are implications for reflashing updated apps once secure boot is enabled.
143 When enabling secure boot, JTAG and ROM BASIC Interpreter are permanently disabled by default.
145 Refer to https://docs.espressif.com/projects/esp-idf/en/latest/security/secure-boot.html before enabling.
147 choice SECURE_BOOTLOADER_MODE
148 bool "Secure bootloader mode"
149 depends on SECURE_BOOT_ENABLED
150 default SECURE_BOOTLOADER_ONE_TIME_FLASH
152 config SECURE_BOOTLOADER_ONE_TIME_FLASH
153 bool "One-time flash"
155 On first boot, the bootloader will generate a key which is not readable externally or by software. A digest is generated from the bootloader image itself. This digest will be verified on each subsequent boot.
157 Enabling this option means that the bootloader cannot be changed after the first time it is booted.
159 config SECURE_BOOTLOADER_REFLASHABLE
162 Generate a reusable secure bootloader key, derived (via SHA-256) from the secure boot signing key.
164 This allows the secure bootloader to be re-flashed by anyone with access to the secure boot signing key.
166 This option is less secure than one-time flash, because a leak of the digest key from one device allows reflashing of any device that uses it.
170 config SECURE_BOOT_BUILD_SIGNED_BINARIES
171 bool "Sign binaries during build"
172 depends on SECURE_BOOT_ENABLED
175 Once secure boot is enabled, bootloader will only boot if partition table and app image are signed.
177 If enabled, these binary files are signed as part of the build process. The file named in "Secure boot private signing key" will be used to sign the image.
179 If disabled, unsigned app/partition data will be built. They must be signed manually using espsecure.py (for example, on a remote signing server.)
181 config SECURE_BOOT_SIGNING_KEY
182 string "Secure boot private signing key"
183 depends on SECURE_BOOT_BUILD_SIGNED_BINARIES
184 default secure_boot_signing_key.pem
186 Path to the key file used to sign partition tables and app images for secure boot. Once secure boot is enabled, bootloader will only boot if partition table and app image are signed.
188 Key file is an ECDSA private key (NIST256p curve) in PEM format.
190 Path is evaluated relative to the project directory.
192 You can generate a new signing key by running the following command:
193 espsecure.py generate_signing_key secure_boot_signing_key.pem
195 See docs/security/secure-boot.rst for details.
197 config SECURE_BOOT_VERIFICATION_KEY
198 string "Secure boot public signature verification key"
199 depends on SECURE_BOOT_ENABLED && !SECURE_BOOT_BUILD_SIGNED_BINARIES
200 default signature_verification_key.bin
202 Path to a public key file used to verify signed images. This key is compiled into the bootloader,
203 and may also be used to verify signatures on OTA images after download.
205 Key file is in raw binary format, and can be extracted from a
206 PEM formatted private key using the espsecure.py
207 extract_public_key command.
209 Refer to https://docs.espressif.com/projects/esp-idf/en/latest/security/secure-boot.html before enabling.
211 config SECURE_BOOT_INSECURE
212 bool "Allow potentially insecure options"
213 depends on SECURE_BOOT_ENABLED
216 You can disable some of the default protections offered by secure boot, in order to enable testing or a custom combination of security features.
218 Only enable these options if you are very sure.
220 Refer to https://docs.espressif.com/projects/esp-idf/en/latest/security/secure-boot.html before enabling.
222 config FLASH_ENCRYPTION_ENABLED
223 bool "Enable flash encryption on boot (READ DOCS FIRST)"
226 If this option is set, flash contents will be encrypted by the bootloader on first boot.
228 Note: After first boot, the system will be permanently encrypted. Re-flashing an encrypted
229 system is complicated and not always possible.
231 Read https://docs.espressif.com/projects/esp-idf/en/latest/security/flash-encryption.html before enabling.
233 config FLASH_ENCRYPTION_INSECURE
234 bool "Allow potentially insecure options"
235 depends on FLASH_ENCRYPTION_ENABLED
238 You can disable some of the default protections offered by flash encryption, in order to enable testing or a custom combination of security features.
240 Only enable these options if you are very sure.
242 Refer to docs/security/secure-boot.rst and docs/security/flash-encryption.rst for details.
244 menu "Potentially insecure options"
245 visible if FLASH_ENCRYPTION_INSECURE || SECURE_BOOT_INSECURE
247 # NOTE: Options in this menu NEED to have SECURE_BOOT_INSECURE
248 # and/or FLASH_ENCRYPTION_INSECURE in "depends on", as the menu
249 # itself doesn't enable/disable its children (if it's not set,
250 # it's possible for the insecure menu to be disabled but the insecure option
251 # to remain on which is very bad.)
253 config SECURE_BOOT_ALLOW_ROM_BASIC
254 bool "Leave ROM BASIC Interpreter available on reset"
255 depends on SECURE_BOOT_INSECURE || FLASH_ENCRYPTION_INSECURE
258 By default, the BASIC ROM Console starts on reset if no valid bootloader is
261 When either flash encryption or secure boot are enabled, the default is to
262 disable this BASIC fallback mode permanently via efuse.
264 If this option is set, this efuse is not burned and the BASIC ROM Console may
265 remain accessible. Only set this option in testing environments.
267 config SECURE_BOOT_ALLOW_JTAG
268 bool "Allow JTAG Debugging"
269 depends on SECURE_BOOT_INSECURE || FLASH_ENCRYPTION_INSECURE
272 If not set (default), the bootloader will permanently disable JTAG (across entire chip) on first boot when either secure boot or flash encryption is enabled.
274 Setting this option leaves JTAG on for debugging, which negates all protections of flash encryption and some of the protections of secure boot.
276 Only set this option in testing environments.
278 config SECURE_BOOT_ALLOW_SHORT_APP_PARTITION
279 bool "Allow app partition length not 64KB aligned"
280 depends on SECURE_BOOT_INSECURE
282 If not set (default), app partition size must be a multiple of 64KB. App images are padded to 64KB length, and the bootloader checks any trailing bytes after the signature (before the next 64KB boundary) have not been written. This is because flash cache maps entire 64KB pages into the address space. This prevents an attacker from appending unverified data after the app image in the flash, causing it to be mapped into the address space.
284 Setting this option allows the app partition length to be unaligned, and disables padding of the app image to this length. It is generally not recommended to set this option, unless you have a legacy partitioning scheme which doesn't support 64KB aligned partition lengths.
286 config FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_ENCRYPT
287 bool "Leave UART bootloader encryption enabled"
288 depends on FLASH_ENCRYPTION_INSECURE
291 If not set (default), the bootloader will permanently disable UART bootloader encryption access on first boot. If set, the UART bootloader will still be able to access hardware encryption.
293 It is recommended to only set this option in testing environments.
295 config FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_DECRYPT
296 bool "Leave UART bootloader decryption enabled"
297 depends on FLASH_ENCRYPTION_INSECURE
300 If not set (default), the bootloader will permanently disable UART bootloader decryption access on first boot. If set, the UART bootloader will still be able to access hardware decryption.
302 Only set this option in testing environments. Setting this option allows complete bypass of flash encryption.
304 config FLASH_ENCRYPTION_UART_BOOTLOADER_ALLOW_CACHE
305 bool "Leave UART bootloader flash cache enabled"
306 depends on FLASH_ENCRYPTION_INSECURE
309 If not set (default), the bootloader will permanently disable UART bootloader flash cache access on first boot. If set, the UART bootloader will still be able to access the flash cache.
311 Only set this option in testing environments.
313 config SECURE_BOOT_TEST_MODE
314 bool "Secure boot test mode: don't permanently set any efuses"
315 depends on SECURE_BOOT_INSECURE
318 If this option is set, all permanent secure boot changes (via Efuse) are disabled.
320 Log output will state changes which would be applied, but they will not be.
322 This option is for testing purposes only - it completely disables secure boot protection.
325 endmenu # Potentially Insecure
326 endmenu # Security features