Commit Graph

479 Commits

Author SHA1 Message Date
Mahavir Jain
6d2153d703 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-15 15:23:19 +02:00
liuning
a43e575bb0 fix(clk): clear all lpclk source at clk init 2024-02-06 16:07:40 +08:00
Xiao Xufeng
9c6ccec971 fix(rtc): fixed bbpll not calibrated from bootloader issue 2024-01-16 18:09:48 +08:00
Cao Sen Miao
1fb6de14e6 brownout: Disable the hardware BOD when BOD interrupt is enabled 2023-11-28 17:01:19 +08:00
Armando
69563f06c9 fix(memory): no enough memory for rodata 2023-10-25 08:02:02 +00:00
Marius Vikhammer
9f48c5eaf5 Merge branch 'bugfix/wdt_deinit_timeout_v4.4' into 'release/v4.4'
fix(wdt): fixed potential WDT timeout when deinitializing task watchdog (v4.4)

See merge request espressif/esp-idf!25984
2023-10-19 13:39:52 +08:00
xuxiao
b25e486cd6 feat(wifi): optimize iperf performance (Backport V4.4) 2023-10-13 11:36:03 +08:00
wuzhenghui
0b02441fe7 fix(esp_system): suppress compiler warning if ESP_SYSTEM_PANIC_SILENT_REBOOT is enabled 2023-09-19 10:51:24 +08:00
Marius Vikhammer
e557ed94fb fix(wdt): fixed potential WDT timeout when deinitializing task watchdog
If task WDT deinit was called from core 1 it would cause an interrupt WDT timeout
2023-09-14 13:16:46 +08:00
Jiang Jiang Jian
2183fbc046 Merge branch 'feature/unicore_bootloader_can_run_multicore_app_v4.4' into 'release/v4.4'
esp_system: Fix case when multicore app can not be run if bootloader is unicore (v4.4)

See merge request espressif/esp-idf!23029
2023-09-01 10:18:49 +08:00
Lou Tianhao
7aa3079e2a Change: rewrite EXT1 triggle mode all_low to any_low when not esp32 2023-07-25 17:52:09 +08:00
gaoxiaojie
f093dcc9cb fix(cache): add lock to protect cache sync operation 2023-07-24 10:45:00 +08:00
KonstantinKondrashov
1b608a1c07 esp_system: Do not rely on bootloader cache settings, do cache settings unconditionally at startup app
It makes multicore app runnable by unicore bootloader

Closes https://github.com/espressif/esp-idf/issues/10714
2023-05-11 06:07:19 +00:00
jiangguangming
fc30491ab0 ld: fix rtc.data rtc.bss section issues
1. rtc.data section: should include sbss srodata in rtc_wake_stub*.*
2. rtc.bss section: move rtc .bss .bss.* from rtc.data to rtc.bss
2023-04-24 11:37:46 +08:00
jiangguangming
85064f164f use LL function to get wakeup cause 2023-04-24 11:37:46 +08:00
Song Ruo Jing
81b59071fd gpio: Fix IO hold function related problems
1. Fix deep sleep wakeup IOs can not be unhold issue
2. Correct hold related APIs' description
3. Fix gpio_force_hold_all API

docs: Add GPIO wakeup source to sleep_modes doc for ESP32C3
2023-03-29 17:21:50 +08:00
Michael (XIAO Xufeng)
8232f23f65 Merge branch 'feature/apply_new_version_logic_v4.4' into 'release/v4.4'
all: Apply new version logic (major * 100 + minor) (v4.4)

See merge request espressif/esp-idf!22481
2023-03-10 14:52:18 +08:00
Armando
5fa6b2879c ld: fixed bootloader and app potential overlap issue 2023-03-07 02:39:56 +00:00
KonstantinKondrashov
a86c80e3ec all: Apply new version logic (major * 100 + minor) 2023-03-03 22:26:39 +00:00
jingli
8c491be452 sleep: fix gpio wakeup not working properly in some cases
Before this fix, when we call esp_pm_configure after gpio_wakeup_enable,
the configuration of GPIO in sleep state in gpio_wakeup_enable will be
overwritten by esp_pm_configure.
2023-02-09 17:58:40 +08:00
Zim Kalinowski
2dec69fa82 Merge branch 'feature/lower-iram-utilization-of-heap-component_v4.4' into 'release/v4.4'
heap: lower the utilization of IRAM by the heap component binary (backport v4.4)

See merge request espressif/esp-idf!21237
2023-02-07 16:54:58 +08:00
Guillaume Souchere
dd249a9ecd esp_system: fix placement of __stack_chk_fail from flash to RAM
When stack check is enabled, certain functions (sometimes placed in RAM)
are being decorated with stack guards and a call to __stask_chk_fail() in
case ofr stack corruption. For this reason, __stack_chk_fail() must be
placed in RAM too.

Add stack check config in heap tests on all targets to find eventual flash to RAM
calls due to stack checks when running callgraph_check.py
2022-12-14 12:57:08 +01:00
wuzhenghui
e2b299660e bugfix: unstall other cpu on core reset
- Closes https://github.com/espressif/esp-idf/issues/10320
2022-12-08 15:38:01 +08:00
wuzhenghui
cf0c0d98ee bugfix: fix redefined _iram_end 2022-11-18 19:51:23 +08:00
morris
be9d294718 Merge branch 'contrib/github_pr_10027_v4.4' into 'release/v4.4'
[Panic] also print to secondary USB Serial/JTAG Console (GitHub PR) (v4.4)

See merge request espressif/esp-idf!21022
2022-11-18 11:52:06 +08:00
jingli
fbf7261531 wifi/bt: fix part of modem module not reset when power up 2022-11-10 16:00:02 +08:00
Chip Weinberger
142fa78ce4
[Panic] also print to secondary USB Serial/JTAG Console 2022-11-09 23:54:44 +01:00
Jiang Jiang Jian
d7ba7c3b19 Merge branch 'bugfix/fix_esprv_intc_int_set_type_err_parameter_backportv4.4' into 'release/v4.4'
bugfix: esprv_intc_int_set_type should not use bitmap parameter(backport v4.4)

See merge request espressif/esp-idf!20609
2022-11-09 18:03:25 +08:00
jiangguangming
d6c783d02d esp_system: use ESP_CONSOLE_UART_NUM instead of CONSOLE_UART_NUM 2022-11-07 15:02:52 +08:00
wuzhenghui
0fd3824f91 bugfix: esprv_intc_int_set_type should not use bitmap parameter 2022-10-14 15:33:53 +08:00
jingli
9a61a07fd8 esp_hw_support/clk_cali: remove redundant check for cali value 2022-09-21 15:13:22 +08:00
Zim Kalinowski
6c3267e8a9 Merge branch 'feature/s2_s3_support_ext_mem_stack_v4.4' into 'release/v4.4'
soc: support placing task stacks in external memory for S2 and S3 (v4.4)

See merge request espressif/esp-idf!20001
2022-09-13 21:24:02 +08:00
Marius Vikhammer
78d7844b01 system: fix SET_STACK macro crashing in windowoverflow8 exception
If a windowoverflow8 happened after changing the SP, the exception handler would look for
the extra save area by looking at the previous frame's SP. This SP would be a garbage value
and could cause the windowoverflow exception to write to invalid memory ares.
2022-09-06 15:54:57 +08:00
Darian Leung
a45fcce631 newlib: Add workaround for printf functions using 32-bit time_t on first call
sizeof(time_t) was previously switched from 4 to 8, ROM functions that use
time_t or dependent types (such as "struct stat") are no longer called due as
they still treat sizeof(time_t) as 4 (see commit
24c20d18).

However, there is a ROM callpath that was left out. If putchar is the first
stdio print related call, the call path will result in cantwrite() ->
__swsetup_r() -> __smakebuf_r() -> __swhatbuf_r() using the ROM "struct stat"
(where sizeof(time_t)==4).

Instead of removing all printf related ROM newlib functions (which will result
in increased binary size), this commit adds a workaround to setup the stdio
files before any print related calls occur.

This results in cantwrite() always returning false, thus the callpath described
above never being reached.

Closes https://github.com/espressif/esp-idf/issues/9269
2022-08-22 11:56:51 +08:00
Omar Chebib
3154abc66e (Xtensa) Build: add .xt.prop and .xt.lit to the compiled ELF file
Adding prop and lit sections to the ELF will let the debugger and the disassembler
have more info about data bytes present in the middle of the Xtensa
instructions, usually used for padding.
2022-08-17 14:58:36 +08:00
Marius Vikhammer
a421e30cf2 system: moved placement of disable rom log efuse in startup flow
Functions used for burning this efuse would log, but at this point
esp_log is not initialized. Moved to a later point in the startup process.

Closes https://github.com/espressif/esp-idf/issues/9457
2022-08-10 12:17:51 +08:00
Marius Vikhammer
f8729d905e Merge branch 'feature/ulp_riscv_adc_v4.4' into 'release/v4.4'
ulp-riscv: add support for using ADC as well as an example show-casing it. (v4.4)

See merge request espressif/esp-idf!19058
2022-08-09 15:00:50 +08:00
Marius Vikhammer
f8f93d936e ulp-riscv: add support for using ADC as well as an example show-casing it. 2022-08-09 09:21:15 +08:00
Li Shuai
12db32642c substract rtc_iram_seg memory region size from ESP_BOOTLOADER_RESERVE_RTC 2022-08-08 11:27:10 +08:00
Mitch Bradley
5728fe325e Reverts Backtrace: format to what it used to be
Was:  Backtrace: N:M N:M N:M ...
Now:  Backtrace:N:MN:M N:M ...

The problem with the new format is that it is hard to parse and
breaks the parser that is used by PlatformIO.  The old format
is much more reasonable.  I do not see how the pattern in IDFDUT.py
can work with the new format, due to the missing space after the :
2022-07-19 11:55:32 +02:00
Jiang Jiang Jian
b9a1020fcf Merge branch 'bugfix/reset_ble_hw_on_inititalization_v4.4' into 'release/v4.4'
[Bluetooth] Reset Bluetooth hardware during controller inititalization on ESP32-C3/ESP32-S3(release/v4.4)

See merge request espressif/esp-idf!18964
2022-07-11 16:28:53 +08:00
wangmengyang
4d5aa82cea component/bt: reset Bluetooth hardware during controller inititalization on ESP32-C3/ESP32-S3
1. Rename MACROs SYSTEM_WIFI_RST_EN register bit fields to be more recognizable
2. reset Bluetooth baseband and MAC bits to fix the issue of task watchdog triggered during controller initialization due to invalid hardware state
2022-07-11 11:06:11 +08:00
Alexey Lapshin
09289fe451 esp_system: Fix esp32c2/esp32c3/esp32h2 TLS size
The change fixes thread-local-storage size by removing .srodata section
from it. It initially was included in TLS section by mistake.
The issue was found when stack size increased after building applications
with GCC-11.1 compiler. Stack size became bigger because some new data
appeared in .srodata. See more details here:
adce62f53d
2022-07-01 15:19:21 +04:00
Jiang Jiang Jian
69951819a0 Merge branch 'bugfix/s3_increase_static_alloc_size_v4.4' into 'release/v4.4'
bootloader, esp_system: increase static allocation space for esp32s3 (v4.4)

See merge request espressif/esp-idf!18685
2022-07-01 10:54:25 +08:00
Jiang Jiang Jian
cd2f38a7bb Merge branch 'feature/efuse_rst_is_treated_as_poweron_rst_v4.4' into 'release/v4.4'
reset_reasons: EFUSE_RST is treated as POWERON_RST + checks errors of eFuse BLOCK0 (v4.4)

See merge request espressif/esp-idf!17871
2022-07-01 10:43:40 +08:00
Ivan Grokhotkov
74e9376022
esp_system: fix garbled UART output on startup on esp32s2
Closes https://github.com/espressif/esp-idf/issues/9168
2022-06-29 12:33:05 +02:00
Ivan Grokhotkov
6e6b9ec5a6
bootloader, esp_system: increase static allocation space for esp32s3
The previously used splits between memory allocated for ROM code,
2nd stage bootloader and the app were somewhat safe and conservative.
This resulted in some space being unavailable for static allocation
in the app.

This commit increases the space available for static allocation to the
maximum possible amount.

1. Some of the ROM code static allocation is only used in UART/USB/SPI
   download modes. This region ("shared buffers") has been placed at
   the lower end of ROM memory area, to be reusable in flash boot
   mode. The 2nd stage bootloader linker script is modified to "pack"
   all sections exactly up to the end but with roughly 8K margin between
   startup stacks.
2. Instead of calculating the sections placement and hardcoding the
   addresses in the LD script again, rewrite it to calculate the
   start address of each memory region automatically based on the
   logic above.
3. Adjust the app memory layout (SRAM_IRAM_END) accordingly,
   increasing the space available for static allocation.

Overall these changes increase the space available for static
allocation by about 78kB.

The downside of these changes is that the 2nd stage bootloader .data
segment is now directly adjacent to the startup stack on the PRO CPU.
Previously, there was effectively about 78kB of extra stack space for
the PRO CPU, before the stack would run into the data segment.
2022-06-27 09:22:01 +05:30
KonstantinKondrashov
c563d799fe efuse: Checks errors of 4x coding scheme for BLOCK0 if so then abort 2022-06-22 17:16:26 +08:00
KonstantinKondrashov
dcc706280d reset_reasons: EFUSE_RST is treated as POWERON_RST
ESP32 does not have the EFUSE_RST, the rest chips has this reset reason.
2022-06-22 16:39:02 +08:00
Michael (XIAO Xufeng)
93d27565ac test_rtc: add test_app to test power consumption 2022-06-06 00:51:38 +08:00