Commit Graph

867 Commits

Author SHA1 Message Date
Song Ruo Jing
98d9f04b00 feat(gdma): add GDMA support for ESP32C5 2024-02-28 12:38:02 +08:00
Konstantin Kondrashov
b8e2342bf8 Merge branch 'bugfix/bootloader_flash_update_size' into 'master'
fix(bootloader_support): Adds bootloader_flash_update_size() for the rest chips

Closes IDFGH-12123

See merge request espressif/esp-idf!29049
2024-02-22 15:49:22 +08:00
Marius Vikhammer
c3ecd6d1f7 Merge branch 'bugfix/reset_reasons' into 'master'
Update reset reasons for C6, H2, P4 and C5

Closes IDF-5719 and IDF-8660

See merge request espressif/esp-idf!28999
2024-02-22 11:02:29 +08:00
Marius Vikhammer
4ce4af61ad fix(system): update reset reasons for P4 and C5 2024-02-21 11:59:28 +08:00
Jiang Jiang Jian
e1a5633e18 Merge branch 'bugfix/bootloader_custom_rtc_data_crc_master' into 'master'
fix(bootloader): add legacy retained memory CRC calculation

Closes IDFGH-11747

See merge request espressif/esp-idf!28934
2024-02-21 10:39:14 +08:00
Mahavir Jain
c33b9e1426
fix(bootloader_support): check the secure version only for app image
Secure version in the image header is only available for the application
image. However, for certain security workflows, bootloader verifies
itself (own image) and hence the secure version check during that must be
avoided.

Regression introduced in recent commit-id: 3305cb4d

Tested that both secure boot and flash-enc workflows work correctly
with the anti-rollback scenario.
2024-02-19 14:54:17 +05:30
Konstantin Kondrashov
9ffafd53b2 fix(bootloader_support): Adds bootloader_flash_update_size() for the rest chips
Closes https://github.com/espressif/esp-idf/issues/13179
2024-02-14 17:41:20 +02:00
Konstantin Kondrashov
9b0eefee73 feat(bootloader_support): Support SB-on app can do OTA on SB-off chip
Closes: https://github.com/espressif/esp-idf/issues/13139
2024-02-12 17:27:50 +02:00
Omar Chebib
75eb489105 fix(bootloader): add legacy retained memory CRC calculation
* Closes https://github.com/espressif/esp-idf/issues/12849

In former versions of ESP-IDF, the user custom memory data in the retained memory
was taken into account during the CRC calculation. This was changed in a later
commit, the custom memory was ignored, therefore this can seen as a breaking change.
This commit gives the possibility to choose between the former (legacy) or
new way of calculating the CRC.
2024-02-09 16:49:56 +08:00
Mahavir Jain
34723ad12c Merge branch 'bugfix/ota_anti_rollback_checks_2' into 'master'
feat(bootloader_support): Read secure_version under sha256 protection

Closes IDF-9013

See merge request espressif/esp-idf!28740
2024-02-08 23:10:08 +08:00
Mahavir Jain
3305cb4d23 fix(ota): additional checks for secure version in anti-rollback case
Some additional checks related to secure version of the application in
anti-rollback case have been added to avoid any attempts to boot lower
security version but valid application (e.g., passive partition image).

- Read secure_version under sha256 protection

- First check has been added in the bootloader to ensure correct secure
  version after application verification and loading stage. This check
  happens before setting up the flash cache mapping and handling over
  the final control to application. This check ensures that application
  was not swapped (e.g., to lower security version but valid image) just
  before the load stage in bootloader.

- Second check has been added in the application startup code to ensure
  that currently booting app has higher security version than the one
  programmed in the eFuse for anti-rollback scenario. This will ensure
  that only the legit application boots-up on the device for
  anti-rollback case.
2024-02-07 22:23:10 +08:00
Song Ruo Jing
95133c179f feat(clk): preliminary clock tree support for ESP32C5 2024-02-07 14:38:15 +08:00
Konstantin Kondrashov
4daaa94593 Merge branch 'feature/cleanup_rom_efuse_header' into 'master'
change(all): Clearing unused efuse rom headers

See merge request espressif/esp-idf!27109
2024-01-26 20:30:44 +08:00
Aditya Patwardhan
4dc2ace0b7
fix(esp_hw_support): Update key manager support
1) Added new Key Manager APIs
    2) Added crypto locking layer for Key Manager
    3) Remove support for deploying known key
    4) Format key manager support
    5) Fix build header error
    6) Updated the key_mgr_types.h file
    7) Added key manager tests
2024-01-23 10:24:39 +05:30
KonstantinKondrashov
b471d9d22c change(all): Clearing unused efuse rom headers 2024-01-22 18:02:55 +02:00
Cao Sen Miao
6768805d20 fix(uart,usj...): Fix wrong serial number that has been parsed to rom functions,
Closes https://github.com/espressif/esp-idf/issues/12958
2024-01-18 10:51:51 +08:00
laokaiyao
d0a8f3e5c4 feat(esp32c5): support esptool on esp32c5 beta3 2024-01-09 13:11:11 +08:00
laokaiyao
3d459e423a feat(esp32c5): support esp32c5 beta3 48M xtal 2024-01-09 13:11:11 +08:00
laokaiyao
11e19f40b9 feat(esp32c5): support to build hello world on esp32c5 beta3 2024-01-09 13:11:11 +08:00
Cao Sen Miao
cbcbecaa06 fix(spi_flash): Remove the useless print 2024-01-08 15:46:09 +08:00
Cao Sen Miao
2e83fa1c69 refactor(spi_flash): Use new spi_flash register sturct and deperecate the old one 2024-01-08 09:59:22 +08:00
laokaiyao
a48f4760d2 feat(esp32c5): add system related supports 2024-01-02 11:17:11 +08:00
Song Ruo Jing
1dfa4011f0 Merge branch 'feature/esp32p4_clock_support' into 'master'
feat(clk): add basic clock support for esp32p4

Closes IDF-7526 and IDF-7569

See merge request espressif/esp-idf!27950
2023-12-29 12:34:12 +08:00
Darian
1da17fce18 Merge branch 'refactor/rename_hal_usb_phy_to_fsls' into 'master'
USB HAL: Change name of usb_phy HAL files to usb_fsls_phy

See merge request espressif/esp-idf!28158
2023-12-29 11:42:11 +08:00
Song Ruo Jing
7f2b85b82b feat(clk): add basic clock support for esp32p4
- Support CPU frequency 360MHz
- Support SOC ROOT clock source switch
- Support LP SLOW clock source switch
- Support clock calibration
2023-12-29 00:37:26 +08:00
Darian Leung
d74b4f6730 refactor(hal/usb): Rename usb_fsls_phy API to match header/source names
Note: Also fixed some formatting issues in usb_wrap_struct.h
2023-12-28 11:48:54 +08:00
Darian Leung
b26472af29 refactor(hal/usb): Rename usb_phy files to usb_fsls_phy
This commit renames USB PHY related HAL files from "usb_phy_xxx" to
"usb_fsls_phy_xxx" since they are only designed to support Full-Speed/Low-Speed
Serial USB PHYs. This renmaing is done to accommodate future USB PHYs that use
other PHY interfaces (e.g., UTMI, ULPI etc).
2023-12-28 11:48:34 +08:00
laokaiyao
fcc9293f66 change(esp32c5): update soc files for esp32c5 beta3 2023-12-28 10:23:15 +08:00
Marius Vikhammer
1606d60c07 Merge branch 'ci/enable_bootloader_sup_tests' into 'master'
change(bootloader-support): enable tests for P4 and QEMU

Closes QEMU-149 and IDF-8114

See merge request espressif/esp-idf!28018
2023-12-20 10:59:47 +08:00
Marius Vikhammer
5b36225162 change(bootloader): enable tests for P4 and QEMU 2023-12-20 09:27:18 +08:00
harshal.patil
42943845e4
feat(bootloader_support): Encrypt only the app image instead of the whole partition
Currently, when flash encryption is enabled, the whole partition gets encrypted.
This can be optimised by encrypting only the app image instead of encrypting the whole partition.

Closes https://github.com/espressif/esp-idf/issues/12576
2023-12-18 17:10:17 +05:30
harshal.patil
cb169cb02f
fix(bootloader_support): Fix image_length calculation when secure boot v1 is enabled
Fixed the value of the image_length field of the image metadata populated by esp_image_verfiy()
to include the size of the signature sector when Secure Boot V1 is enabled.
2023-12-18 17:08:11 +05:30
harshal.patil
fe293dfd83
feat(bootloader_support): Make esp_secure_boot_verify_sbv2_signature_block() function public
Closes https://github.com/espressif/esp-idf/issues/12717
2023-12-11 18:50:55 +05:30
Mahavir Jain
25c2cc5f03 Merge branch 'feature/esp32p4_enable_flash_encryption' into 'master'
Enable Flash Encryption for ESP32P4

Closes IDF-7545

See merge request espressif/esp-idf!26959
2023-12-05 21:42:18 +08:00
Aditya Patwardhan
a84234c23f
feat(security): Enable Flash encryption for ESP32P4 2023-12-05 13:10:55 +05:30
Darian
cc34c4fc08 Merge branch 'contrib/github_pr_12481' into 'master'
Many places in the ESP_SYSTEM are using CONFIG_FREERTOS_UNICORE instead of CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE (GitHub PR)

Closes IDFGH-11333

See merge request espressif/esp-idf!27435
2023-12-01 19:33:19 +08:00
Kevin (Lao Kaiyao)
cd9d321062 Merge branch 'feature/introduce_target_esp32c5' into 'master'
feat(esp32c5): introduce target esp32c5 (stage 1)

See merge request espressif/esp-idf!27299
2023-11-29 20:31:34 +08:00
laokaiyao
7fa0d61c35 refactor(build_test_rules): invert the logic to avoid involving preview target
Only set enable condition for the app will introduce the preview target in README.md
Replace with disable logic instead
2023-11-28 16:14:17 +08:00
laokaiyao
bb0879b3f8 feat(esp32c5): introduce target esp32c5 2023-11-28 16:14:17 +08:00
fl0wl0w
d149c1b26f Use configuration option instead of in components not related to FreeRTOS
Mergeshttps://github.com/espressif/esp-idf/pull/12481
2023-11-28 07:49:20 +00:00
Marius Vikhammer
b96f93b879 ci(system): fixed and enabled misc system build tests 2023-11-28 14:00:16 +08:00
wuzhenghui
0ab0d2182e fix(esp_hw_support): fix lightsleep current leakage on usb-phy controlled pad 2023-11-11 13:00:55 +08:00
Song Ruo Jing
46d33e46ef fix(console): enable to select UART1 port for console output
This feature was only enabled for esp32, esp32s2, esp32s3 previously.
Now, enabling this feature for all targets.
2023-11-09 22:32:49 +08:00
Xiao Xufeng
cc28674686 refactor(bootloader_flash): make cache enable more obvious 2023-11-01 02:01:45 +08:00
Xiao Xufeng
28f19cf0e6 fix(ram_app): Fixed issue ram_app can't use the SPI Flash
1st bootloader won't help to initialize the MSPI & cache properly as it
usually do when loading from flash. And the ram app doesn't have valid
headers.

Since there is no enough space in 2nd bootloader, we replace the
`bootloader_init_spi_flash` in the ram_app (!pure_ram_app), with an
customized alternative of it for the ram_app.

This alternative helps to initialize the MSPI & cache properly, without
the help of 1st bootloader or image headers.
2023-11-01 02:01:45 +08:00
Ivan Grokhotkov
cbb6fa0507 Merge branch 'bugfix/esp32s3_usb_otg_console_without_efuse' into 'master'
fix(console): switch USB PHY to OTG when OTG is used for console

Closes IDFGH-11281

See merge request espressif/esp-idf!26653
2023-10-27 20:09:09 +08:00
Ivan Grokhotkov
a8e175364a
fix(console): switch USB PHY to OTG when OTG is used for console
On ESP32-S3 with the default efuse settings, USB PHY is connected to
the USB_SERIAL_JTAG peripheral. If USB OTG peripheral is used for the
console, we need to additionally switch the PHY to USB OTG, otherwise
we won't get any output.

Closes https://github.com/espressif/esp-idf/issues/12437
2023-10-24 13:29:15 +02:00
Xiao Xufeng
1f5fb3f921 spi_flash: fixed issue that enabling HPM-DC by default may cause app unable to restart 2023-10-24 10:38:08 +08:00
Erhan Kurubas
6cd8030160 Merge branch 'check_debug_aware_config' into 'master'
fix(esp_hw_support): re-enable CONFIG_ESP_DEBUG_OCDAWARE functionality

Closes IDF-5881

See merge request espressif/esp-idf!26533
2023-10-21 15:20:26 +08:00
Armando
05c147c3e8 fix(rng): only build bootloader_random apis once 2023-10-19 16:15:52 +08:00
Zim Kalinowski
fa1a3ce0b5 Merge branch 'refactor/components_linux_compatible' into 'master'
Exclude all currently incompatible components from Linux build

Closes IDF-8318 and IDF-5996

See merge request espressif/esp-idf!25598
2023-10-18 20:17:49 +08:00
Erhan Kurubas
2d55270006 fix(esp_hw_support): re-enable CONFIG_ESP_DEBUG_OCDAWARE functionality 2023-10-18 08:48:45 +02:00
Mahavir Jain
2407813a67 Merge branch 'feature/update_esp32c6-h2_apm_api' into 'master'
apm: updated APM HAL/LL APIs.

See merge request espressif/esp-idf!26368
2023-10-18 12:26:38 +08:00
Sachin Billore
c106f5caf6 apm: updated APM HAL/LL APIs. 2023-10-17 18:20:36 +05:30
Armando
17063b51e0 feat(soc): added flash operation range macros in ext_mem_defs.h 2023-10-16 17:19:04 +08:00
Jakob Hasse
548022fbe6 refactor(linux): excluded all non-Linux components from build
* All components which won't build (yet) on Linux are excluded.
  This enables switching to Linux in an application without
  explicitly setting COMPONENTS to main in the main
  CMakeLists.txt.
* ESP Timer provides headers for Linux now
* automatically disabling LWIP in Kconfig if it is not available

doc(linux): brought section
  "Component Linux/Mock Support Overview" up to date
2023-10-16 17:06:54 +08:00
Mahavir Jain
eea2536dc4 Merge branch 'feature/conservative_key_revocation_in_secure_boot_v2' into 'master'
feat: Add API to verify the bootloader and application image before revoking...

Closes IDF-7078

See merge request espressif/esp-idf!24572
2023-10-16 12:42:49 +08:00
Mahavir Jain
1501aef1b3 Merge branch 'feature/enable_secure_boot_esp32p4' into 'master'
feat(secure_boot): add secure boot support for esp32p4

Closes IDF-7544 and IDF-7745

See merge request espressif/esp-idf!26335
2023-10-16 11:07:14 +08:00
Cao Sen Miao
6cea72b76b fix(ota): Fixed OTA fail on octal flash with 32MB memory,
Closes https://github.com/espressif/esp-idf/issues/11903
2023-10-13 12:01:26 +08:00
Harshit Malpani
1df186d4e1
feat: Add API to verify the bootloader and app image
Added an API to verify the bootloader and app image before revoking the key in Secure Boot V2.
This will help in preventing the device to be bricked if the bootloader/application cannot be
verified by any other keys in efuse
2023-10-12 14:53:57 +05:30
harshal.patil
f46a93e565
feat(secure_boot): add secure boot support for esp32p4 2023-10-12 10:12:54 +05:30
Adam Múdry
ab1eb37fe8 feat(partition_table): Add read-only partition flag and functionality 2023-10-11 00:01:05 +02:00
gaoxu
4541ad134d feat(uart): add RCC atomic block to uart/lp-uart peripheral 2023-10-08 10:10:02 +08:00
Harshit Malpani
5d9ebd2473 Merge branch 'bugfix/fix_condition_to_verify_when_no_SB' into 'master'
fix(bootloader_support): Fix condition for checking signature in the application

See merge request espressif/esp-idf!26026
2023-09-26 14:38:08 +08:00
Armando (Dou Yiwen)
b58a2ea6a6 Merge branch 'feature/support_cache_p4' into 'master'
cache: support cache driver on esp32p4

Closes IDF-7516

See merge request espressif/esp-idf!25490
2023-09-25 15:21:46 +08:00
Harshit Malpani
c19e1b8f72
fix(bootloader_support): Fix condition for SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
Fix the condition to verify the image when SECURE_SIGNED_APPS_ECDSA_V2_SCHEME and
SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT are selected.
2023-09-25 12:02:58 +05:30
Armando
ec27891af6 change(cache): swap cache hal arg 'type' and 'level' 2023-09-22 14:19:41 +08:00
Armando
ea38a2e9a4 feat(cache): support cache driver on esp32p4 2023-09-22 14:19:41 +08:00
Chen Yudong
2e11919f70 fix(ci): change build-test-rules files folder 2023-09-20 19:17:06 +08:00
Marius Vikhammer
e58becec0a feat(esp-system): support reset reasons on P4 2023-09-15 08:11:34 +08:00
Armando
7dace60861 feat(rom): updated to esp32p4 image 12.0.0 2023-09-07 07:01:00 +00:00
Armando (Dou Yiwen)
bdfa91ab66 Merge branch 'change/delete_not_used_mmu_macros' into 'master'
mm: delete not used mmu macros and added soc_ prefix

Closes IDF-7686

See merge request espressif/esp-idf!25663
2023-09-06 11:59:03 +08:00
Armando
de77ab3061 change(soc): added SOC_ prefix to mmu defs 2023-09-05 15:47:26 +08:00
Marius Vikhammer
e3861261eb fix(wdt): move non-auto generated wdt values to ll 2023-09-05 11:52:34 +08:00
Armando
6f412393b6 change(ci): add todo to p4 build test enable 2023-08-24 12:51:19 +08:00
Armando
7dbd3f6909 feat(ci): Enable p4 example, test_apps and unit tests CI build 2023-08-24 12:51:19 +08:00
Armando
06782d1623 change(esp32p4): update rtc interrupt registration todo list 2023-08-09 19:33:36 +08:00
KonstantinKondrashov
c09d823b6a change(efuse): Update eFuses for esp32p4 chip 2023-08-09 19:33:35 +08:00
Armando
706d684418 feat(esp32p4): introduced new target esp32p4, supported hello_world 2023-08-09 19:33:25 +08:00
Konstantin Kondrashov
a12c06367f Merge branch 'ci/test_verify_image' into 'master'
fix(bootloader_support): Fix memory leak for unit tests

Closes IDFCI-1754 and IDFCI-1755

See merge request espressif/esp-idf!24870
2023-08-09 13:44:22 +08:00
C.S.M
40532cb820 Merge branch 'bugfix/esp32s3_lack_boot_resume' into 'master'
bugfix(spi_flash): Add flash resuem in bootloader on esp32s3

See merge request espressif/esp-idf!25163
2023-08-04 11:24:56 +08:00
Cao Sen Miao
91ad084c15 bugfix(spi_flash): Add flash resuem in bootloader on esp32s3 2023-08-03 18:26:00 +08:00
Mahavir Jain
56fb618733
fix(secure_ota): secure app verification issue without padding bytes
For the following configuration case:

 - CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME
 - CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
 - CONFIG_SECURE_BOOT_ALLOW_SHORT_APP_PARTITION

verification of the application was failing because the externally
padded bytes were not considered in the hash (checksum) process.

This commit fixes the problem by enabling relevant code for secure OTA
without secure boot case.

Closes https://github.com/espressif/esp-idf/issues/11995
2023-08-02 19:31:20 +05:30
C.S.M
7927ec44f1 Merge branch 'bugfix/gd25lq255e_unlock' into 'master'
spi_flash: fix gd25lq255e unlock mistake

See merge request espressif/esp-idf!24859
2023-07-21 15:29:45 +08:00
KonstantinKondrashov
95626b9401 fix(bootloader_support): Fix memory leak for unit tests 2023-07-19 21:25:31 +08:00
Cao Sen Miao
44693a63b4 spi_flash: fix gd25lq255e unlock mistake 2023-07-18 10:12:46 +08:00
Chen Ji Chang
7ec38eb309 Merge branch 'bugfix/update_all_esp32xxx/rom/gpio.h_comments' into 'master'
gpio: Update the incorrect comments in rom/gpio.h

Closes IDFGH-10490

See merge request espressif/esp-idf!24487
2023-07-13 19:44:31 +08:00
Marius Vikhammer
91aaf8b1a0 ci(qemu): temporarily allow qemu tests to fail 2023-07-13 11:16:38 +08:00
Chen Jichang
b9c22b126a bugfix(driver/gpio):update the incorrect comment
There are some register description errors in parts of rom/gpio.h
This commit update the incorrect comments in rom/gpio.h And now
esp_rom_gpio.h is recommend instead of rom/gpio.h. So this commit adds
macro SIG_GPIO_OUT_IDX in esp_rom_gpio_connect_out_signal
function and removes the reference to gpio.h in some source files.

Closes https://github.com/espressif/esp-idf/issues/11737
2023-07-13 10:52:50 +08:00
Harshit Malpani
941eb4e61e
feat: Made read_otadata() API public
Updated the read_otadata() API name to bootloader_common_read_otadata() and made the API public.

Closes https://github.com/espressif/esp-idf/issues/11603
2023-07-06 11:40:49 +05:30
Jiang Jiang Jian
cbcddc8ed0 Merge branch 'bugfix/fix_bootloader_wrong_spi_freq_print' into 'master'
bugfix: fix esp32c6 bootloader print wrong spi speed mode

See merge request espressif/esp-idf!24261
2023-07-05 12:24:04 +08:00
Zim Kalinowski
c412ac625c Merge branch 'feature/qemu-bootloader-support' into 'master'
bootloader_support: Enable tests on QEMU (ESP32 and ESP32C3)

Closes IDF-7335

See merge request espressif/esp-idf!21416
2023-06-28 21:03:15 +08:00
Lou Tian Hao
7c2ac1feb6 Merge branch 'bringup/esp32h2_light_sleep_for_rebase' into 'master'
esp32h2: support light_sleep

Closes IDF-6266 and IDF-7359

See merge request espressif/esp-idf!23567
2023-06-28 10:37:18 +08:00
Zim Kalinowski
434a9e4e2f ci(bootloader): Enable QEMU tests (ESP32 and ESP32C3) 2023-06-27 17:14:18 +08:00
morris
1c0be26531 fix(soc): soc header files can pass CI check 2023-06-26 23:00:45 +08:00
Lou Tianhao
117008143b bugfix: remove the workaround implemented in MR 22773 about the lp_timer 2023-06-26 21:05:16 +08:00
Lou Tianhao
7fd74057a3 example: bringup light sleep example for esp32h2 2023-06-26 21:05:16 +08:00
wuzhenghui
d35ba005b8 bugfix: fix bootloader print wrong spi speed mode 2023-06-20 20:02:14 +08:00
Konstantin Kondrashov
c350c3c504 Merge branch 'feature/cleanup_wrong_log_use' into 'master'
all: Removes unnecessary newline character in logs

Closes IDFGH-10197

See merge request espressif/esp-idf!24131
2023-06-15 21:49:49 +08:00
Armando
101e6a18eb esp32p4: introduce the target
Add esp32p4 target to tools and Kconfig
Create directories and files that are essential for `idf.py --preview set-target esp32p4`
2023-06-13 15:16:11 +08:00