Commit Graph

426 Commits

Author SHA1 Message Date
KonstantinKondrashov
8374e3b0ee bootloader: Fixes bootloader_common_get_sha256_of_partition. Adds hash check.
Closes https://github.com/espressif/esp-idf/issues/8274
2022-01-25 20:01:00 +08:00
Jiang Jiang Jian
778faeb7dd Merge branch 'fix/remove_warning_when_disabling_rom_dl_mode_v4.3' into 'release/v4.3'
secure_boot: Fix warning when UART ROM DL mode is disabled (v4.3)

See merge request espressif/esp-idf!16238
2021-12-21 03:54:33 +00:00
Jiang Jiang Jian
4ab1fb9b2a Merge branch 'bugfix/bootloader_debug_buffers_v4.3' into 'release/v4.3'
bootloader_support: Fix and re-enable bootloader_debug_buffer function (v4.3)

See merge request espressif/esp-idf!16074
2021-12-21 03:45:32 +00:00
Aditya Patwardhan
9fb61791fe secure_boot: Fix warning when UART ROM DL mode is disabled
*Additionally use updated calls to enable rom secure download mode
2021-12-02 15:17:56 +05:30
Gustavo Henrique Nihei
f34a85dc31 bootloader_support: Fix and re-enable bootloader_debug_buffer function
The body of the bootloader_debug_buffer function was conditioned to
macros that were never defined, resulting in deactivated code.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-11-30 21:01:55 +08:00
Mahavir Jain
0855521014 bootloader: add anti-FI checks around secure version in anti-rollback scheme 2021-11-29 18:49:36 +05:30
Sachin Parekh
017f7a241a secure_boot: Do not allow key revocation in bootloader 2021-11-17 12:35:06 +05:30
Michael (XIAO Xufeng)
d4fd54f8ce spi_flash: fix the corruption of ROM after calling bootloader_execute_flash_command
The user register, especially dummy related ones, needs to be restored, otherwise the ROM function will not work.

Introduced in dd40123129.
2021-10-15 02:18:03 +08:00
Michael (XIAO Xufeng)
e00f6cbde9 bootloader: add xmc spi_flash startup flow to improve reliability 2021-10-15 01:49:46 +08:00
Cao Sen Miao
ce9e615679 Merge branch 'feature/esp32c3_usbjtagserial_v4.3' into 'release/v4.3'
usb_serial_jtag: support usb_serial_jtag on esp32c3(backport v4.3)

See merge request espressif/esp-idf!15319
2021-10-14 10:38:02 +00:00
Cao Sen Miao
f49d6bf061 usb_serial_jtag: fix the bug that cannot write with usb_jtag 2021-10-11 17:34:24 +08:00
Jeroen Domburg
d6cdb3e0ae usb_serial_jtag: support usb_serial_jtag on esp32c3
USB serial/jtag controller: Add vfs (logging/printf), panic handler, gdb support.

See merge request espressif/esp-idf!12925
2021-10-11 17:34:24 +08:00
Cao Sen Miao
ea06ee1ad6 spi_flash: move the unlock patch to bootloader and add support for GD 2021-10-11 10:52:52 +08:00
Mahavir Jain
c33ac6d1a9 Merge branch 'feature/clock_glitch_enable_v4.3' into 'release/v4.3'
bootloader: Enable clock glitch detection (v4.3)

See merge request espressif/esp-idf!15225
2021-09-20 09:35:42 +00:00
chenjianqiang
42039cde0a add flash and PSRAM CS IO acquire function 2021-09-17 16:28:47 +08:00
Sachin Parekh
26563474d6 bootloader: Enable clock glitch detection
Reset the device when clock glitch detected. Clock glitch detection is
only active in bootloader
2021-09-17 13:32:34 +05:30
Yuriy Shestakov
872c42ecf7 Fixed GLITCH_RTC_RST for esp32-c3 revision 3
* Issue: https://github.com/espressif/esp-idf/issues/7082

Signed-off-by: Yuriy Shestakov <yshestakov@gmail.com>

Closes https://github.com/espressif/esp-idf/issues/7082
Closes https://github.com/espressif/esp-idf/pull/7441
2021-09-17 13:32:34 +05:30
Konstantin Kondrashov
0d16e61d96 efuse: Fix len of SOFT_DIS_JTAG for esp32c3(v4.3) 2021-09-14 13:22:08 +08:00
Zim Kalinowski
1f0d8585ca Merge branch 'feature/update_efuses_for_esp32s2_v4.3' into 'release/v4.3'
efuse(esp32s2): Added flash_ver, psram_ver, pkg_ver efuses (v4.3)

See merge request espressif/esp-idf!14770
2021-09-10 04:21:54 +00:00
Mahavir Jain
9ac4c49553 Merge branch 'fixes/secure_boot_v4.3' into 'release/v4.3'
secure_boot/esp32(s2,c3): Disable read protecting of efuses (v4.3)

See merge request espressif/esp-idf!14960
2021-09-09 07:16:54 +00:00
Sachin Parekh
c2f015ace1 secure_boot/esp32(s2,c3): Disable read protecting of efuses
When secure boot is enabled, disable the ability to read protect
efuses that contain the digest.
2021-09-08 16:42:54 +08:00
KonstantinKondrashov
b7237ff0e6 efuse(esp32s2): Added flash_ver, psram_ver, pkg_ver efuses 2021-08-12 18:25:07 +05:00
Marius Vikhammer
ee54dbfaab bootloader: fix verify_load_addresses wrongly reporting "bad load address range"
verify_load_addresses would check if load_end was in a certain member range,
but should verify (load_end - 1) which is the actual last byte.
2021-07-31 14:10:57 +08:00
Angus Gratton
07465563c5 secure boot: Fix incorrect handling of mbedtls_ctr_drbg_seed() failure in signature verification
Increase the test app optimization level to one that would find this issue.
2021-07-16 11:03:21 +05:30
KonstantinKondrashov
6a50197246 bootloader: Fix a wrong offset in image_load after refactoring 2021-06-22 08:30:43 +08:00
KonstantinKondrashov
54ae758b77 bootloader_support: Used esp_image_get_metadata() instead of esp_image_verify()
- bootloader_common_get_sha256_of_partition will not do any unnecessery verifies.
- Used esp_image_get_metadata() instead of esp_image_verify().
2021-06-22 08:30:43 +08:00
KonstantinKondrashov
99af5e9a71 bootloader: Fixed a case when signed OTA updates fail when debugger is attached due to the wrong image_len.
And it fixed another case for bootloader_common_get_sha256_of_partition() when CHECK_SIGNATURE is on
- If RSA signature check is on in Kconfig then sha256 was 0xFFFFF...
because image_load gave image_len which pointed to the end of sign blocks.
And image_digest was filled from a wrong position.

Closes https://github.com/espressif/esp-idf/issues/6873
2021-06-22 08:30:41 +08:00
Angus Gratton
e9fd883f50 Merge branch 'bugfix/esp32_u4wdh_quad_io_v4.3' into 'release/v4.3'
bootloader: Fix selection of Quad I/O modes on ESP32-U4WDH chip (v4.3)

See merge request espressif/esp-idf!13876
2021-06-18 07:16:50 +00:00
Angus Gratton
94f447f599 Merge branch 'bugfix/partition_table_integrity_check_v4.3' into 'release/v4.3'
paritition_table: Verify the partition table md5sum when loading in the app (v4.3)

See merge request espressif/esp-idf!13582
2021-06-16 08:49:55 +00:00
Angus Gratton
a45fa929c2 Merge branch 'bugfix/ulp_riscv_unintended_wake_v4.3' into 'release/v4.3'
ulp: unintended wakeup in ulp_riscv (v4.3)

See merge request espressif/esp-idf!13630
2021-06-16 04:25:29 +00:00
Angus Gratton
22a02656b7 bootloader: Fix selection of Quad I/O modes on ESP32-U4WDH chip
Closes https://github.com/espressif/esp-idf/issues/6191
2021-06-07 14:53:43 +10:00
Renz Bagaporo
0e904b3f7e ulp: clear rtc int at initialization
Closes https://github.com/espressif/esp-idf/issues/6654
2021-06-01 21:41:12 +08:00
Angus Gratton
1967e53f4a bootloader: Fix "skip validate in deep sleep" on ESP32 & ESP32-S2
Regression in 83bf2e1ac1, this memory region was shifted from fast to slow RTC
memory (no change on ESP32-C3 as no RTC fast memory on this chip.)
2021-06-01 19:05:09 +10:00
Angus Gratton
58a3e08895 paritition_table: Verify the partition table md5sum when loading the app
Additionally, always enable the partition MD5 check if flash encryption is on in
Release mode. This ensures the partition table ciphertext has not been modified
(CVE-2021-27926).

The exception is pre-V3.1 ESP-IDF bootloaders and partition tables, which
don't have support for the MD5 entry.
2021-05-30 23:21:14 +00:00
Jiang Jiang Jian
ed76cc4dd4 Merge branch 'feature/support_adjust_voltage_storingInEfuse_open_glitch_rst_v4.3' into 'release/v4.3'
ESP32c3: auto adjust voltage dbias storing in efuse and open glitch reset for ECO3  (backport v4.3)

See merge request espressif/esp-idf!13388
2021-05-13 04:08:56 +00:00
Marius Vikhammer
38aa99d63d soc: merge C3 caps into a single soc_caps.h 2021-05-11 15:20:54 +08:00
chaijie
6d2bdfc5f5 1. open glitch reset for c3 ECO3;
2. set digital & rtc voltage to about 1.15v which storing in efuse.
2021-05-08 17:38:24 +08:00
Mahavir Jain
26139daaf5 Merge branch 'feature/adds_ota_example_test_check_sign_on_update_v4.3' into 'release/v4.3'
simple_ota_example: Adds config to test on_update_no_secure_boot option (v4.3)

See merge request espressif/esp-idf!13222
2021-04-23 08:57:46 +00:00
KonstantinKondrashov
02170d815e bootloader: Fix error in Make build system when signature options is on 2021-04-22 07:27:08 +00:00
Mahavir Jain
d41781099a bootloader_support: fix min. revision error print for < C3-ECO3 revisions 2021-04-21 10:16:46 +05:30
Mahavir Jain
6403a229eb bootloader: fix print related to min. chip revision
Closes https://github.com/espressif/esp-idf/issues/6890
Closes IDFGH-5106
2021-04-21 10:16:46 +05:30
Omar Chebib
84dc42c4b0 gpio: Disable USB JTAG when setting pins 18 and 19 as GPIOs on ESP32C3
When `DIS_USB_JTAG` eFuse is NOT burned (`False`), it is not possible
to set pins 18 and 19 as GPIOs. This commit solves this by manually
disabling USB JTAG when using pins 18 or 19.
The functions shall use `gpio_hal_iomux_func_sel` instead of
`PIN_FUNC_SELELECT`.
2021-04-12 17:45:06 +08:00
Angus Gratton
00cfcde385 bootloader: Fix "skip validate on exit deep sleep" when "Use RTC fast memory as heap" is enabled
RTC region used to store boot partition needs to remain reserved in the app.
2021-04-09 19:15:43 +10:00
chaijie
0c7f286a87 fix c3 hardware bug before ECO3 and optimizate bbpll config:
1. deepsleep poweron reset bug in high temperature before ECO3;
2. brownout reset bug before ECO2;
3. bbpll voltage low bug before ECO3;
4. need xpd iph for xtal before ECO3;
2021-03-31 20:17:54 +08:00
KonstantinKondrashov
26d362040e secure_boot/SIGNED_ON_UPDATE_NO_SECURE_BOOT: Only the first position of signature blocks is used to verify any update 2021-03-25 15:40:24 +08:00
Angus Gratton
502a819757 secure boot v2: Fix issue checking multiple signature blocks on OTA update 2021-03-17 17:08:59 +08:00
Angus Gratton
a479ee30c9 secure boot: Add boot check for SBV2 "check app signature on update"
As this mode uses the public keys attached to the existing app's signatures to
verify the next app, checking that a signature block is found on boot prevents
the possibility of deploying a non-updatable device from the factory.
2021-03-17 17:08:59 +08:00
KonstantinKondrashov
46e85ed021 secure_boot: Secure Boot V2 verify app signature on update (without Secure boot)
- ESP32 ECO3, ESP32-S2/C3/S3
2021-03-17 17:08:59 +08:00
KonstantinKondrashov
0862fe815b secure_boot: Adds empty esp_secure_boot_init_checks
There is no checks
2021-03-17 17:09:00 +08:00
Angus Gratton
0305d13467 bootloader: Add config options to skip validation of app for minimum boot time 2021-03-10 19:08:47 +11:00