Commit Graph

712 Commits

Author SHA1 Message Date
liuning
12d2d95b94 fix(clk): clear all lpclk source at clk init 2024-03-28 20:41:58 +08:00
Mahavir Jain
f2743707b8 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:14:51 +02:00
Xiao Xufeng
376be14e1c fix(rtc): fixed bbpll not calibrated from bootloader issue 2024-01-14 02:38:49 +08:00
Erhan Kurubas
5f1d3790cc fix(esp_hw_support): re-enable CONFIG_ESP_DEBUG_OCDAWARE functionality 2023-11-22 03:05:34 +00:00
Shen Weilong
6875e2b7d0 feat(bt): Frees BLE memory when no longer in use
It will free libble.a & libbt all txt, data and bss segment memory.
          This memory is combined into one large memory and put into the heap
          pool.
2023-10-24 06:04:39 +00:00
xuxiao
d2b82b47c7 feat(wifi): optimize iperf performance (Backport V5.0) 2023-10-11 17:14:52 +08:00
Mahavir Jain
67a1fe6373 fix(startup): flip the security configuration check order
For cases where the bootloader is not enabled with the security features
ends up receiving an incorrect application with flash encryption enabled
should not really program any security efuses.

In the startup sequence, we first used to program the ROM DL mode
configuration but now we check for the flash encryption related checks
first. If the flash encryption related checks finds that flash
encryption is not enabled on the device then it aborts the boot process.
This is the case with `CONFIG_SECURE_FLASH_CHECK_ENC_EN_IN_APP` enabled.

This would at-least ensure that accidental program of security enabled
application does not really program any ROM DL mode efuses and there is
chance to recover the device.
2023-10-09 03:30:11 +00:00
wuzhenghui
49bd0ca8fd fix(esp_system): suppress compiler warning if ESP_SYSTEM_PANIC_SILENT_REBOOT is enabled 2023-09-28 02:53:07 +00:00
Jiang Jiang Jian
46f5638847 Merge branch 'bugfix/incorrect_time_after_ota_v5.0' into 'release/v5.0'
esp_hw_support: Fix invalid system time if s_esp_rtc_time_us & s_rtc_last_ticks were moved around (v5.0)

See merge request espressif/esp-idf!24410
2023-08-23 16:34:43 +08:00
Jiang Jiang Jian
38bd8d3044 Merge branch 'bugfix/esp32s3_usb_otg_console_v5.0' into 'release/v5.0'
system: support USB_OTG CDC console on ESP32-S3 (v5.0)

See merge request espressif/esp-idf!24338
2023-08-21 10:37:29 +08:00
morris
8e5718fd0c Merge branch 'bugfix/bod_intr_v5.0' into 'release/v5.0'
brownout: Disable the hardware BOD when BOD interrupt is enabled(backport v5.0)

See merge request espressif/esp-idf!24693
2023-07-28 10:32:19 +08:00
Lou Tianhao
3727d56c82 Change: rewrite EXT1 triggle mode all_low to any_low when not esp32 2023-07-25 17:53:33 +08:00
gaoxiaojie
805f3bc557 fix(cache): add lock to protect cache sync operation 2023-07-24 10:51:23 +08:00
Ivan Grokhotkov
28e6b3565f
esp_system: usb_console support for ESP32-S3
Closes https://github.com/espressif/esp-idf/issues/8879
Closes https://github.com/espressif/esp-idf/issues/8738
2023-07-18 18:15:37 +02:00
Ivan Grokhotkov
568e5537b0
esp_rom: implement usb deinit functions added in S3 ROM for S2
This cleans up usb_console.c and prepares it for S3 support.
2023-07-18 18:15:37 +02:00
Ivan Grokhotkov
82e8d78b3b
esp_rom: add USB_OTG "port" number for S2 and S3 2023-07-18 18:15:37 +02:00
KonstantinKondrashov
031af815da esp_hw_support: Fix invalid system time if s_esp_rtc_time_us & s_rtc_last_ticks were moved around
The commit fixes the case:
If variables in RTC RAM have been moved around by the linker,
they will be filled with garbage data. Any reset other than OTA would work fine
because the variables would still be initialized from the initial bootup.

So now system time will be valid even after OTA.

Closes https://github.com/espressif/esp-idf/issues/9448
2023-07-13 18:30:26 +08:00
Cao Sen Miao
e2925cde68 brownout: Disable the hardware BOD when BOD interrupt is enabled 2023-07-11 14:46:30 +08:00
Armando
757f58c3ba fix(mm): correct mmap reserved irom and drom size
Prior to this commit, we don't consider the offset of the irom vaddr
start.

If the offset + size is bigger than the MMU page size, for example:
MMU page size: 0x10000
irom vaddr: 0x4200_0800, so offset = 0x800
irom size: 0xF900
offset + size = 0x10100

Under this condition, the 0x4200_0000 ~ 0x4202_0000, two MMU pages are
used.

With this commit, when reserving the irom and drom, we take the offset
into consideration as well.

Closes https://github.com/espressif/esp-idf/issues/2561
2023-07-07 10:45:26 +00:00
Jiang Jiang Jian
bd90408cc1 Merge branch 'feature/esp_ipc_isr_fix_v5.0' into 'release/v5.0'
esp_system: Fix a race-condition in esp_ipc_isr (in QEMU env) (v5.0)

See merge request espressif/esp-idf!23992
2023-06-15 00:56:24 +08:00
Jiang Jiang Jian
838850abab Merge branch 'feature/example_deep_sleep_wake_stub_backport_v5.0' into 'release/v5.0'
example: add deepsleep_wake stub example (backport v5.0)

See merge request espressif/esp-idf!23414
2023-06-12 11:07:59 +08:00
Marius Vikhammer
e77e6eb963 Merge branch 'bugfix/use_safe_noreturn_attr_v5.0' into 'release/v5.0'
compiler: replaced noreturn by __noreturn__ in header files (v5.0)

See merge request espressif/esp-idf!23812
2023-06-01 10:17:58 +08:00
Paul Guyot
051cb8dc5f esp_system: Fix a race-condition in esp_ipc_isr (in QEMU env)
The race condition is very unlikely on real hardware but can be observed with
qemu under heavy load.
Also add missing `memw` instructions which are generated by the C compiler but
absent in the assembly code.

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: KonstantinKondrashov <konstantin@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/11447
Closes https://github.com/espressif/esp-idf/issues/11433
2023-05-30 23:04:14 +08:00
Jakob Hasse
fa099f23f3 compiler: replaced noreturn by __noreturn__ in header files
* noreturn may be replaced by third-party macros,
  rendering it ineffective

* Closes https://github.com/espressif/esp-idf/issues/11339
2023-05-30 13:21:17 +08:00
morris
858199506d mcpwm: reset peripheral in restart, panic and halt
mcpwm is commonly used in power eletronic area, when restart happens,
make sure the mcpwm generator is not working.

closes https://github.com/espressif/esp-idf/issues/11324
2023-05-18 04:56:34 +00:00
Marius Vikhammer
3720ea91c3 ci: re-enable reset reason tests for all targets except H2. 2023-05-15 09:58:16 +08:00
Marius Vikhammer
0722386585 esp-system: fixed int WDT reset reason being reported as task WDT on C2 2023-05-15 09:53:18 +08:00
KonstantinKondrashov
861a5fb863 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 05:55:32 +00:00
jiangguangming
af7223727d 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-05-04 16:46:15 +08:00
jiangguangming
72676d230a use LL function to get wakeup cause 2023-05-04 16:46:15 +08:00
Marius Vikhammer
f1070229f8 system: fixed USE_FIXED_STATIC_RAM_SIZE option
The USE_FIXED_STATIC_RAM_SIZE was not actually causing the heap to start
at a fixed address.

Closes https://github.com/espressif/esp-idf/issues/10270
Closes https://github.com/espressif/esp-idf/issues/10271
2023-03-24 12:33:14 +08:00
Song Ruo Jing
27f9ee66d5 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 and C2
2023-03-17 14:44:29 +08:00
Zim Kalinowski
2a804de4b7 Merge branch 'staging/rename_twdt_config_examples_v5.0' into 'release/v5.0'
TWDT: Use the new TWDT Kconfig options in the examples and tests (Backport v5.0)

See merge request espressif/esp-idf!22631
2023-03-08 16:09:58 +08:00
morris
a77d7d2343 Merge branch 'bugfix/timg0_disable_v5.0' into 'release/v5.0'
esp_system: Fix TIMG0 still enabled after Timer is freed (v5.0)

See merge request espressif/esp-idf!22630
2023-03-07 11:56:50 +08:00
Omar Chebib
83907aaa20 TWDT: Use the new TWDT Kconfig options in the examples and tests 2023-03-07 10:23:43 +08:00
Gustavo Henrique Nihei
aab0a5a4a8 esp_system: Fix TIMG0 still enabled after Timer is freed
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-07 10:02:06 +08:00
Gustavo Henrique Nihei
24484887a9 esp_system: Ensure TIMG0 clock is always enabled during normal operation
If the TimerGroup 0 clock is disabled and then reenabled, the watchdog
registers (Flashboot protection included) will be re-enabled, and some
seconds later, will trigger an unintended reset.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-07 10:02:06 +08:00
jingli
cb64ff74fc system/test: use TEST_ESP_OK instead of ESP_ERROR_CHECK 2023-03-06 11:56:56 +08:00
jingli
38c25ebceb konfig: make rtc fast mem related kconfig depend on SOC_RTC_FAST_MEM_SUPPORTED 2023-03-06 11:53:35 +08:00
Armando
fbe7d6fca9 ld: fixed bootloader and app potential overlap issue 2023-03-02 10:45:40 +08:00
Jiang Jiang Jian
335ad04cba Merge branch 'feature/support_feature_depend_on_rtc_fast_mem_for_esp32c2_backport_v5.0' into 'release/v5.0'
esp32c2: support feature(rtc time) depend on rtc fast mem(backport v5.0)

See merge request espressif/esp-idf!22224
2023-02-27 15:06:31 +08:00
Armando
ac86ef31c1 g0: resolve MMU_PAGE_SIZE not defined in g0 build issue 2023-02-23 12:35:52 +08:00
jingli
eb27e688fb UT/esp32c2: reenable pm and sleep related UT 2023-02-16 10:54:11 +08:00
jingli
e109c5f998 esp32c2: support rtc time feature depend on rtc memory, since c2 does not have rtc memory 2023-02-16 10:52:59 +08:00
Jiang Jiang Jian
42bf734139 Merge branch 'bugfix/esp32s3_int_wdt_v5.0' into 'release/v5.0'
system: disable interrupts in esp_restart_noos_dig to fix infinite int_wdt on ESP32-S3 (v5.0)

See merge request espressif/esp-idf!21769
2023-01-12 16:19:27 +08:00
Jiang Jiang Jian
96db537020 Merge branch 'feature/apply_new_version_logic_v5.0' into 'release/v5.0'
all: Apply new version logic (major * 100 + minor) (v5.0)

See merge request espressif/esp-idf!20941
2023-01-12 16:18:23 +08:00
KonstantinKondrashov
823024c10c all: Apply new version logic (major * 100 + minor) 2023-01-06 02:00:52 +08:00
Ivan Grokhotkov
35135d7b29
system: disable interrupts in esp_restart_noos_dig 2022-12-22 11:34:38 +01:00
Jiang Jiang Jian
c541b9082e Merge branch 'contrib/github_pr_10027_v5.0' into 'release/v5.0'
[Panic] also print to secondary USB Serial/JTAG Console (GitHub PR) (v5.0)

See merge request espressif/esp-idf!21021
2022-12-21 17:15:04 +08:00
Zim Kalinowski
83e2cf1a68 Merge branch 'staging/riscv_wrapper_freertos_tasks_v5.0' into 'release/v5.0'
RISC-V: Create a wrapper around FreeRTOS Tasks to detect the ones returning (backport v5.0)

See merge request espressif/esp-idf!21202
2022-12-20 16:34:13 +08:00