69 Commits

Author SHA1 Message Date
Meet Patel c4e2fe2c8b refactor(system): guard WDT with SoC capability macros
Wrap MWDT-related code under SOC_WDT_SUPPORTED so targets without a main
watchdog can compile.

Add SOC_RTC_WDT_SUPPORTED for RTC watchdog usage (bootloader, slow-clock
paths) and regenerate Kconfig.soc_caps.in. Bootloader RWDT setup stays
under SOC_RTC_WDT_SUPPORTED; MWDT flashboot teardown stays under
SOC_WDT_SUPPORTED.

ESP_INT_WDT, ESP_TASK_WDT_EN, and BOOTLOADER_WDT_ENABLE depend on
SOC_WDT_SUPPORTED where applicable. Build xt_wdt.c only when
SOC_XT_WDT_SUPPORTED. Provide no-op panic WDT helpers when
SOC_WDT_SUPPORTED is disabled.
2026-03-24 14:57:43 +05:30
Erhan Kurubas 1dac8685db feat(tracing): add new component for tracing 2025-10-30 12:15:35 +01:00
Erhan Kurubas 2ef718fc29 change(app_trace): breaking changes related to destination selection
- Destination selection is unified for SystemView and app_trace
- Destination param is removed from app_trace APIs
- Destinaiton and related configuration now can be override from users
  with a callback from system_init_fn
2025-10-18 02:28:31 +08:00
morris e8de5b5a95 refactor(gptimer): clean up SOC capabilities for GPTIMER and Timer Group
- Remove GPTIMER and TIMG related definitions from soc_caps_full.h files
- Move timer peripheral definitions to appropriate HAL layer files
- Update references across components to use proper HAL abstractions
- Consolidate timer group and GPTIMER capabilities organization
- Ensure consistent timer configuration across all ESP32 variants

This refactoring improves the separation of concerns between SOC
capabilities and HAL implementations for timer-related functionality.
2025-10-14 11:44:38 +08:00
gaoxiaojie fab0bb1056 fix(esp_system): clear cache error interrupt in panic handler 2025-09-24 21:30:56 +07:00
Marius Vikhammer 56e0c11bb6 feat(usb_cdc_console): moved usb-cdc ROM console to new component: esp_usb_cdc_rom_console 2025-08-22 09:37:47 +08:00
Sudeep Mohanty 36eaa2c4a1 fix(panic_handler): Fixed a issue where the system reboots before halt
This commit fixes an issue where the panic handler may reboot even if it
is configured to halt the CPU.

Closes https://github.com/espressif/esp-idf/issues/17260
2025-08-13 12:19:23 +02:00
Erhan Kurubas fb3e616750 Merge branch 'apptrace_breaking_changes' into 'master'
Apptrace breaking changes

Closes IDF-9993 and IDF-4316

See merge request espressif/esp-idf!40380
2025-07-17 17:45:31 +02:00
Erhan Kurubas 3d7d7813c9 refactor(apptrace): replace xxx_TRAX with xxx_JTAG 2025-07-17 12:36:39 +08:00
morris 0999aeedbd refactor(timg): clean up soc layer meta data 2025-07-17 10:33:08 +08:00
Konstantin Kondrashov ff0408c087 feat(esp_system): Adds Kconfigs to place code in IRAM 2025-06-23 13:23:33 +03:00
Sudeep Mohanty edf4234da9 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-17 13:56:25 +02:00
Sudeep Mohanty b562afa08e 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-02-18 15:40:54 +01:00
Erhan Kurubas 36ee603be9 fix(espcoredump): prevent null pointer dereference in panic reason handling 2024-12-04 18:43:30 +08:00
Alexey Lapshin 7498f4655a fix(esp_system): fix GCC 14 analyzer warnings 2024-09-08 13:53:52 +07:00
harshal.patil bd4e48d0d9 feat(cpu): Configure panic exception generation using asm illegal instruction 2024-06-25 11:55:24 +05:30
Alexey Lapshin ed6e497c6f feat(build): add COMPILER_STATIC_ANALYZER option 2024-06-18 14:25:37 +08:00
Erhan Kurubas 434b096c72 refactor(espcoredump): simplify uart/flash write flow 2024-03-07 16:10:50 +08:00
Marius Vikhammer 06850e0e1e refactor(system): removed esp_system from astyle ignore list and reformated it 2024-01-30 15:17:15 +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
Erhan Kurubas 2d55270006 fix(esp_hw_support): re-enable CONFIG_ESP_DEBUG_OCDAWARE functionality 2023-10-18 08:48:45 +02:00
Erhan Kurubas bde8ff8b67 feat(panic): send pseudo exccause to openocd 2023-10-17 12:34:24 +02:00
Erhan Kurubas 4714521b21 feat(coredump): add panic details to the elf file 2023-08-24 10:20:56 +02:00
KonstantinKondrashov b605404b06 esp_app_format: IRAM space optimization 2023-05-17 23:40:59 +08:00
morris 083d9e7c0f 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-06 15:58:58 +08:00
Marius Vikhammer c2f9392be5 Merge branch 'feature/h2_wdt' into 'master'
wdt: add support for H2

Closes IDF-6643 and IDF-6678

See merge request espressif/esp-idf!22422
2023-02-24 13:48:20 +08:00
Marius Vikhammer 5d26a0de9a wdt: add support for H2 2023-02-23 11:22:51 +08:00
Jing Li 75a82988f1 Merge branch 'refactor/wdt_use_unified_type' into 'master'
wdt: refactor wdt codes to use unified type

Closes IDF-5653

See merge request espressif/esp-idf!22378
2023-02-21 09:46:06 +08:00
Marius Vikhammer ec57895db9 coredump: allow coredump at panic even if gdbstub is used.
Closes https://github.com/espressif/esp-idf/issues/10017
2023-02-17 15:15:36 +08:00
jingli 9c37441b17 wdt: refactor wdt codes to use unified type 2023-02-15 12:08:55 +08:00
Jakob Hasse cb9786d35e refactor(esp_system): reboot delay: added docs, protected by watchdog 2022-12-20 15:51:00 +08:00
Chip Weinberger 6e2ce0d289 refactor(esp_system) add user configurable reboot delay in seconds
Closes https://github.com/espressif/esp-idf/pull/9962
2022-12-20 13:17:09 +08:00
Cao Sen Miao 8cc9260f86 ESP32H2: Add system support for ESP32H2 2022-12-07 11:38:51 +08:00
Omar Chebib d580f6b076 RISC-V: Create a wrapper around FreeRTOS Tasks to detect the ones returning 2022-11-18 15:07:32 +08:00
Chip Weinberger b2d1c34a38 [Panic] also print to secondary USB Serial/JTAG Console 2022-10-25 14:04:32 -07:00
Omar Chebib 53c7dd4efc WDT: implement interrupt wdt and task wdt for ESP32-C2
ESP32-C2 has a single group timer, thus it will use it for the interrupt watchdog,
which is more critical than the task watchdog. The latter is implement in
software thanks to the `esp_timer`component.
2022-09-15 14:37:59 +08:00
wuzhenghui ab09c07fdd esp32c6: add esp_system support 2022-09-06 09:13:20 +00:00
Laukik Hase 0071ea498f esp_app_format: Fixed build errors and resolved dependencies 2022-08-17 10:59:31 +05:30
Omar Chebib e25cda2c40 Task WDT: Interuptee task stack is now used for backtracing, regardless of the CPU core
For RISC-V and Xtensa targets, in case a panic needs to happen when
Task WDT is triggered (ESP_TASK_WDT_PANIC), the interruptee's stack
is now used for printing the backtrace.
Abort after Task Watchdog is triggered can happen on APP CPU (second core).
2022-08-02 12:41:14 +08:00
Guillaume Souchere 0bac33ed41 esp_system: Remove deprecate section from esp_cpu.h
- Remove esp_cpu_in_ocd_mode() from esp_cpu.h. Users should call esp_cpu_dbgr_is_attached() instead.
- Remove esp_cpu_get_ccount() from esp_cpu.h. Users should call esp_cpu_get_cycle_count() instead.
- Remove esp_cpu_set_ccount() from esp_cpu.h. Users should call esp_cpu_set_cycle_count() instead.
- Other IDF components updated to call esp_cpu_dbgr_is_attached(), esp_cpu_get_cycle_count() and esp_cpu_set_cycle_count() as well.
2022-07-22 00:06:06 +08:00
Guillaume Souchere 6005cc9163 hal: Deprecate interrupt_controller_hal.h, cpu_hal.h and cpu_ll.h interfaces
This commit marks all functions in interrupt_controller_hal.h, cpu_ll.h and cpu_hal.h as deprecated.
Users should use functions from esp_cpu.h instead.
2022-07-22 00:06:06 +08:00
Marius Vikhammer 9274a062fb esp-system: removed esp_phy and nvs dependencies, change app update and pm to weak dependencies 2022-03-22 11:19:32 +08:00
Sudeep Mohanty e22b4007d3 esp_hw_support: Removed deprecated CPU util functions
The following files were deleted:
- components/esp_hw_support/include/soc/cpu.h
- components/soc/esp32s3/include/soc/cpu.h

The following functions are deprecated:
- get_sp()

The following functions declared in soc/cpu.h are now moved to esp_cpu.h:
- esp_cpu_configure_region_protection()

The following functions declared in soc/cpu.h are now moved to components/xtensa/include/esp_cpu_utils.h:
- esp_cpu_process_stack_pc()

All files with soc/cpu.h inclusion are updated to include esp_cpu.h instead.

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2021-12-28 16:58:37 +05:30
Cao Sen Miao 09487761cf ESP8684: add freertos, hal, esp_system support 2021-11-06 17:33:44 +08:00
Ivan Grokhotkov b5606f5e81 esp_system: make the abort operation compatible with clang
Clang warns that the original code wouldn't have any effect:

    warning: indirection of non-volatile null pointer will be deleted,
             not trap [-Wnull-dereference]
    note: consider using __builtin_trap() or qualifying pointer
          with 'volatile'

__builtin_trap translates to 'break 1, 15' instruction on Xtensa,
which might be okay in this case. However to absolutely certainly not
break anything for GCC builds, add 'volatile' instead.
2021-09-16 11:07:54 +02:00
Sachin Parekh 6582f7070e Update tests for assert and abort
- Place panic_abort in IRAM
- Added abort, assert test case in case of cache disabled
- Expect assert instead of abort in a freertos_mutex test
2021-08-05 11:09:22 +05:30
Angus Gratton 1969e4b8e5 Merge branch 'bugfix/panic_handler_disable_wdts_early' into 'master'
esp_system: Reconfigure the WDTs at the start of the panic handler

Closes IDFCI-361

See merge request espressif/esp-idf!14138
2021-06-29 23:48:40 +00:00
Angus Gratton 14c7d4965b esp_system: Reconfigure the WDTs at the start of the panic handler
This is mostly important on ESP32 ECO3 with the
ESP32_ECO3_CACHE_LOCK_FIX, because when we stall the other CPU core
before we disable the TG1 WDT then the first CPU can get stuck
in WDT ISR handle_livelock_int routine waiting for the other CPU.
2021-06-28 17:24:39 +10:00
Alexey Gerenkov 821869d98d apptrace: Refactors apptrace for better support various tracing HW 2021-06-24 13:16:13 +03:00
Dmitry 00a7ecb5a3 Code cleanup. Bugfix after rebase with master. Formating. 2021-05-13 15:03:40 +03:00