Commit Graph

1239 Commits

Author SHA1 Message Date
harshal.patil
5e15adfae9 fix(esp_psram): Add XIP PSRAM alignment gaps in heap only if PSRAM protection is enabled 2025-05-21 15:36:41 +05:30
harshal.patil
29f7654c2b feat(cpu_region_protect): Enable basic memory protection for SPIRAM 2025-05-21 15:36:41 +05:30
Armando
21bd94f116 fix(linker): fixed extern linker symbol type from int to char 2025-05-21 15:36:40 +05:30
Jiang Jiang Jian
d950dde7c1 Merge branch 'bugfix/crypto_reset_on_exit_v5.3' into 'release/v5.3'
fix(esp_system): reset crypto peripherals before device restart (v5.3)

See merge request espressif/esp-idf!38476
2025-04-27 14:26:47 +08:00
Jiang Jiang Jian
13091e4a14 Merge branch 'fix/remove-unnecessary-select_v5.3' into 'release/v5.3'
fix(esp_system): Remove unnecessary select from esp_system/Kconfig (v5.3)

See merge request espressif/esp-idf!37521
2025-04-27 14:22:29 +08:00
Alexey Lapshin
bbb257f893 feat(esp_system): drop .got* sections and add hint
Closes https://github.com/espressif/esp-idf/issues/14296
2025-04-24 16:36:31 +08:00
Sudeep Mohanty
3dfb9cec3f fix(panic_handler): Prevent race condition in panic handler
This commit updates all RTC WDT contexts to be local instead of global
to avoid race conditions when both cores enter the panic handler
simultaneously.
2025-04-23 12:53:50 +02:00
Roland Dobai
8b725deb56 Merge branch 'bugfix/esp32p4_linker_script_v5.3' into 'release/v5.3'
fix(esp_system): add missing `arrays` attribute in the ESP32-P4 linker script (backport v5.3)

See merge request espressif/esp-idf!36095
2025-04-21 15:54:05 +08:00
morris
950c9df5e5 Merge branch 'fix/fix_mmu_map_concurrent_issue_v5.3' into 'release/v5.3'
mmu: fix mmu map concurrent issue (v5.3)

See merge request espressif/esp-idf!38410
2025-04-17 21:13:28 +08:00
Mahavir Jain
5b2e8f2b38 fix(esp_system): reset crypto peripherals before device restart
This change addresses a rare but critical issue observed on certain
ESP32-C3 and ESP32-S3 devices, where secure boot verification
intermittently fails due to improper cleanup of crypto peripherals
during a restart.

Background – Restart Behavior in IDF
------------------------------------
In ESP-IDF, when the device restarts (via `esp_restart()` or due to a
panic/exception), a partial peripheral reset is performed followed by a
CPU reset. However, until now, crypto-related peripherals were not
included in this selective reset sequence.

Problem Scenario
----------------
If a restart occurs while the application is in the middle of a bignum
operation (i.e., using the MPI/Bignum peripheral), the ROM code may
encounter an inconsistent peripheral state during the subsequent boot.
This leads to transient RSA-PSS secure boot verification failures.

Following such a failure, the ROM typically triggers a full-chip reset
via the watchdog timer (WDT). This full reset clears the crypto
peripheral state, allowing secure boot verification to succeed on the
next boot.

Risk with Aggressive Revocation
-------------------------------
If secure boot aggressive revocation is enabled (disabled by default in
IDF), this transient verification failure could mistakenly lead to
revocation of the secure boot digest.

If your product configuration has aggressive revocation enabled,
applying this fix is strongly recommended.

Frequency of Occurrence
-----------------------
The issue is rare and only occurs in corner cases involving
simultaneous use of the MPI peripheral and an immediate CPU reset.

Fix
---
This fix ensures that all crypto peripherals are explicitly reset prior
to any software-triggered restart (including panic scenarios),
guaranteeing a clean peripheral state for the next boot and preventing
incorrect secure boot behavior.
2025-04-16 20:31:44 +08:00
wuzhenghui
5ce6c51c28 fix(esp_hw_support): fix unused OSC source deinit breaks XTAL32K configuration 2025-04-16 17:19:08 +08:00
wuzhenghui
8d55741d32 fix(esp_hw_support): fix current leakage if ext32k slow clock source not exists 2025-04-16 17:19:04 +08:00
armando
231694ac25 test(system): increased 200B memory leak thresh due to mmu mmap mutex
200B to extend the thresh, real increase to the memory usage will be smaller
2025-04-15 14:24:23 +08:00
Marius Vikhammer
7fea3ef20f Merge branch 'bug/xtensa_cpu1_sys_lockup_v5.3' into 'release/v5.3'
fix(panic_handler): Updated panic handler to use RTC WDT (v5.3)

See merge request espressif/esp-idf!37115
2025-04-15 11:05:57 +08:00
Jiang Jiang Jian
4d62ea01b6 Merge branch 'fix/sleep_cpu_mspi_freq_mismatch_issue_p4_v5.3' into 'release/v5.3'
mspi: fixed cpu and mspi freq mismatch issue when in dfs/sleep on p4 (v5.3)

See merge request espressif/esp-idf!37584
2025-03-08 18:45:20 +08:00
Armando
51280e0e8a fix(mspi): fixed cpu and mspi freq mismatch issue when in dfs/sleep on p4 2025-03-08 14:17:02 +08:00
wuzhenghui
f99c3c6343 fix(esp_system): fix possible cache_error by another core accessing flash in esp_restart 2025-03-07 11:05:41 +08:00
Sudeep Mohanty
81109e8bdd fix(panic_handler): Updated panic handler to use RTC WDT
This commit updates the following:
- Updates the panic handler to use only the RTC WDT to reset the system.
- Refactors some of the panic handler code.
- Updates Bluetooth files where in they now feed the WDTs instead of
  reconfiguring them.
- Removes some unnecessary configuration of WDTs from various files.
- Added a unit test to verify that the system does not lock up when the
  panic handler is stuck.
- Updates the memprot unit tests to work with the refactored panic
  handler.

Closes https://github.com/espressif/esp-idf/issues/15166
Closes https://github.com/espressif/esp-idf/issues/15018
Closes https://github.com/espressif/esp-idf/issues/10110
2025-03-06 09:13:17 +01:00
Jan Beran
2a401c768c fix(esp_system): Remove unnecessary select from esp_system/Kconfig 2025-03-05 15:09:25 +01:00
Omar Chebib
105588b113 fix(esp_system): add missing arrays attribute in the ESP32-P4 linker script 2025-03-03 14:21:17 +08:00
Alexey Lapshin
2ff0343243 fix(system): linker script: free unused .rtc.text memory for esp32c3/esp32s2/esp32s3 2025-02-28 10:45:53 +08:00
Jiang Jiang Jian
1698a58881 Merge branch 'fix/add_sleep_duration_check_for_timer_wakeup_v5.3' into 'release/v5.3'
fix(esp_hw_support): add timer wakeup sleep duration check (v5.3)

See merge request espressif/esp-idf!37011
2025-02-19 14:02:53 +08:00
Marius Vikhammer
fa4706e4cb Merge branch 'fix/usb-cdc-non-blocking-read_v5.3' into 'release/v5.3'
fix(esp_vfs_console): USB CDC read when non blocking (backport v5.3)

See merge request espressif/esp-idf!36749
2025-02-18 12:17:26 +08:00
wuzhenghui
0e2335f6f9 fix(esp_hw_support): add timer wakeup sleep duration check
Closes https://github.com/espressif/esp-idf/issues/15255
2025-02-17 19:09:44 +08:00
Li Shuai
44001a9d70 change(esp_hw_support): update some modules sleep retention init dependency bitmap 2025-02-13 15:35:19 +08:00
Guillaume Souchere
7d4d24d198 fix(esp_vfs_console): USB CDC read when non blocking
In non blocking mode, the read function is expected
to return weather data is available for reading or not.

In case data are available but the size does not match
the expected size, the function read should return whatever
data is available.

Previously, the function was returning -1 with errno set
to EWOULDBLOCK even if the size of data in the buffer was
less than the requested size. It would only return the
available data if the size in the buffer was greater or equal
to the requested size.

The implementation of cdcacm_read is modified to return the avilable
data from the buffer even is the size is lesser than the requested
size.
2025-02-06 08:58:44 +01:00
wuzhenghui
12db9e4225 fix(esp_hw_support): fix branch predictor access flash after cache disabled 2025-01-22 19:27:37 +08:00
morris
8ec35b4d75 Merge branch 'refactor/improve_the_compatible_method_on_h2_v5.3' into 'release/v5.3'
refactor(lpperi): improve compatibility solution (v5.3)

See merge request espressif/esp-idf!36421
2025-01-17 12:40:00 +08:00
Martin Vychodil
96d3dfbb9a Merge branch 'fix/incorrect_console_open_and_close_behaviour_v5.3' into 'release/v5.3'
fix(storage/vfs_console): stop new console opens from overwriting existing fds (v5.3)

See merge request espressif/esp-idf!35268
2025-01-16 22:08:13 +08:00
laokaiyao
2abf73d94c refactor(lpperi): improve compatibility solution 2025-01-16 10:18:02 +08:00
morris
18714a2e4c Merge branch 'refactor/update_lpperi_regs_for_h2_eco5_v5.3' into 'release/v5.3'
refactor(lpperi): compatible refactor for H2 ECO5 (v5.3)

See merge request espressif/esp-idf!36336
2025-01-15 16:11:38 +08:00
Jan Beran
0547a0bad9 fix: remove duplicit lines from sdkconfig.rename files 2025-01-13 09:07:32 +01:00
laokaiyao
90457a9a4e refactor(lpperi): compatible refactor for H2 ECO5 2025-01-13 14:39:33 +08:00
morris
418768ebc7 fix(dma): abort the axi dma gracefully on CPU SW reset 2025-01-10 10:15:36 +08:00
Michael (XIAO Xufeng)
4c422b18ff Merge branch 'bugfix/warn_rc32k_use_in_kconfig_v5.3' into 'release/v5.3'
fix(clk): add an inevitable kconfig option to be selected to use rc32k (v5.3)

See merge request espressif/esp-idf!35965
2025-01-07 15:50:42 +08:00
Marek Fiala
2b0407eb2a feat(tools): Enforce utf-8 encoding with open() function 2025-01-02 16:48:43 +01:00
Song Ruo Jing
a2178b0fa2 fix(clk): add an inevitable kconfig option to be selected to use rc32k 2024-12-25 20:01:37 +08:00
morris
8273d98760 Merge branch 'fix/flash_noos_issues_v5.3' into 'release/v5.3'
flash: fixed some no_os API issues (v5.3)

See merge request espressif/esp-idf!35792
2024-12-23 10:21:04 +08:00
Armando
eb85f8da46 fix(cache): fixed cache hal ctx not initialised in app issue 2024-12-20 14:06:19 +08:00
Erhan Kurubas
9cab2c7796 fix(system): avoid unexcpected hp_sys_wdt reset 2024-12-19 11:58:58 +03:00
Tomáš Rohlínek
299b93bc9e fix(storage/vfs_console): stop new console opens from overwriting existing fds 2024-12-12 10:01:16 +01:00
Erhan Kurubas
8bfabe711a fix(espcoredump): prevent null pointer dereference in panic reason handling 2024-12-09 15:15:51 +01:00
Mahavir Jain
ecc5f36e49 Merge branch 'fix/fetch_image_hdr_v5.3' into 'release/v5.3'
fix(esp_system): Correct address used to fetch application image header (v5.3)

See merge request espressif/esp-idf!34628
2024-12-06 15:36:53 +08:00
Laukik Hase
4acc6d3482 fix(esp_system): Correct address used to fetch application image header 2024-11-29 17:42:01 +08:00
wuzhenghui
7563ae5e70 fix(esp_system): deselect all modem modules clk source selection before clk init 2024-11-27 17:02:53 +08:00
wuzhenghui
9c195f52a3 fix(esp_system): writeback L1 Dcache before disable L2 if PSRAM used 2024-11-11 14:03:08 +08:00
Jiang Jiang Jian
b840737ebf Merge branch 'fix/fix_ota_slowclock_switching_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix rtc slow clock missing after the OTA app changes the slow clock source (v5.3)

See merge request espressif/esp-idf!34474
2024-11-08 16:34:22 +08:00
C.S.M
0a437b0ea0 fix(bod): Remove config for bod on p4 v0.x 2024-11-01 15:31:13 +08:00
C.S.M
12d6cdb29a feat(esp32p4): Introduce p4 eco2 configuration 2024-11-01 15:30:39 +08:00
wuzhenghui
f2fb17cb87 fix(esp_hw_support): disable unused clock sources after rtc clock switching complete 2024-10-28 19:54:06 +08:00