Open KaeLL opened 1 year ago
Even on v5.2-dev-2934-g3b748a6cb7, the code
#include "driver/gptimer.h" #include "esp_attr.h" IRAM_ATTR bool gpt_cb( gptimer_handle_t timer, const gptimer_alarm_event_data_t *edata, void *user_ctx ) { while ( 1 ) ; } void app_main( void ) { gptimer_handle_t gpt = NULL; ESP_ERROR_CHECK( gptimer_new_timer( &( const gptimer_config_t ) { .clk_src = GPTIMER_CLK_SRC_DEFAULT, .intr_priority = 3, .resolution_hz = 40000000 }, &gpt ) ); ESP_ERROR_CHECK( gptimer_register_event_callbacks( gpt, &( const gptimer_event_callbacks_t ) { gpt_cb }, NULL ) ); ESP_ERROR_CHECK( gptimer_enable( gpt ) ); ESP_ERROR_CHECK( gptimer_set_alarm_action( gpt, &( const gptimer_alarm_config_t ) { .alarm_count = 80000000 } ) ); ESP_ERROR_CHECK( gptimer_start( gpt ) ); }
with this defconfig
# This file was generated using idf.py save-defconfig. It can be edited manually. # Espressif IoT Development Framework (ESP-IDF) 5.2.0 Project Minimal Configuration # CONFIG_APP_NO_BLOBS=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF=y CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG=y CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS=y CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHFREQ_80M=y CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y CONFIG_PARTITION_TABLE_OFFSET=0xC000 CONFIG_COMPILER_OPTIMIZATION_NONE=y CONFIG_COMPILER_WARN_WRITE_STRINGS=y CONFIG_SPI_MASTER_IN_IRAM=y CONFIG_SPI_SLAVE_ISR_IN_IRAM=n CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM=y CONFIG_GPTIMER_ISR_IRAM_SAFE=y CONFIG_GPTIMER_ENABLE_DEBUG_LOG=y CONFIG_ESP32_REV_MIN_3=y CONFIG_RTC_CLK_SRC_INT_8MD256=y CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=n CONFIG_ESP_PHY_RF_CAL_FULL=y CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y CONFIG_ESP_CONSOLE_UART_CUSTOM=y CONFIG_ESP_CONSOLE_UART_BAUDRATE=2000000 CONFIG_ESP_INT_WDT_TIMEOUT_MS=30 CONFIG_ESP_TASK_WDT_PANIC=y CONFIG_ESP_DEBUG_OCDAWARE=n CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=y CONFIG_ESP_COREDUMP_CHECKSUM_SHA256=y CONFIG_ESP_COREDUMP_STACK_SIZE=2048 CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=n CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y CONFIG_FREERTOS_CORETIMER_1=y CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS=y CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y CONFIG_NEWLIB_NANO_FORMAT=y CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=n
results in this crash
I (208) main_task: Calling app_main() D (208) gptimer: new group (0) @0x3ffb8e04 D (208) gptimer: new gptimer (0,0) at 0x3ffb8d50, resolution=40000000Hz D (208) intr_alloc: Connected src 14 to int 23 (cpu 0) Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0). Core 0 register dump: PC : 0x40086c93 PS : 0x00060034 A0 : 0x80086ebb A1 : 0x3ffb1070 0x40086c93: gpt_cb at /test_coredump/main/test_coredump.c:8 (discriminator 1) A2 : 0x3ffb8d50 A3 : 0x3ffb10d0 A4 : 0x00000000 A5 : 0x00000000 A6 : 0x00060023 A7 : 0x3ffb1070 A8 : 0x8008d58e A9 : 0x3ffb1070 A10 : 0x00000003 A11 : 0x00060023 A12 : 0x00060023 A13 : 0x00000000 A14 : 0x00000000 A15 : 0x3ffb1020 SAR : 0x00000020 EXCCAUSE: 0x00000005 EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0xffffffff 0x4000c46c: memset in ROM 0x4000c477: memset in ROM Core 0 was running in ISR context: EPC1 : 0x400d1d5a EPC2 : 0x00000000 EPC3 : 0x4000bff0 EPC4 : 0x40086c93 0x400d1d5a: panic_print_char_uart at /esp-idf/components/esp_system/panic.c:81 0x4000bff0: _xtos_set_intlevel in ROM 0x40086c93: gpt_cb at /test_coredump/main/test_coredump.c:8 (discriminator 1) Backtrace: 0x40086c90:0x3ffb1070 0x40086eb8:0x3ffb10a0 0x40083f95:0x3ffb1110 0x4000bfed:0x3ffb7880 0x4008d58b:0x3ffb7890 0x4008743a:0x3ffb78b0 0x400db5f5:0x3ffb7920 0x400e8405:0x3ffb7990 0x40086c90: gpt_cb at /test_coredump/main/test_coredump.c:6 0x40086eb8: gptimer_default_isr at /esp-idf/components/driver/gptimer/gptimer.c:543 0x40083f95: _xt_medint3 at /esp-idf/components/xtensa/xtensa_vectors.S:1405 0x4000bfed: _xtos_set_intlevel in ROM 0x4008d58b: vPortClearInterruptMaskFromISR at /esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:577 (inlined by) vPortExitCritical at /esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:532 0x4008743a: vPortExitCriticalSafe at /esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:613 (inlined by) gptimer_start at /esp-idf/components/driver/gptimer/gptimer.c:353 0x400db5f5: app_main at /test_coredump/main/test_coredump.c:26 0x400e8405: main_task at /esp-idf/components/freertos/app_startup.c:208 (discriminator 9) Core 1 register dump: PC : 0x40087664 PS : 0x00060334 A0 : 0x800d2fb0 A1 : 0x3ffb8b10 0x40087664: xt_utils_wait_for_intr at /esp-idf/components/xtensa/include/xt_utils.h:82 (inlined by) esp_cpu_wait_for_intr at /esp-idf/components/esp_hw_support/cpu.c:132 A2 : 0x00000001 A3 : 0x00000001 A4 : 0x00060023 A5 : 0x00000001 A6 : 0x00000000 A7 : 0x3ffb8b10 A8 : 0x800dea38 A9 : 0x3ffb8ac0 A10 : 0x00000000 A11 : 0x00000001 A12 : 0x00000001 A13 : 0x000000c6 A14 : 0x00000000 A15 : 0x3ffb8ac0 SAR : 0x00000000 EXCCAUSE: 0x00000005 EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000 Backtrace: 0x40087661:0x3ffb8b10 0x400d2fad:0x3ffb8b30 0x4008b9c4:0x3ffb8b60 0x40087661: xt_utils_wait_for_intr at /esp-idf/components/xtensa/include/xt_utils.h:81 (inlined by) esp_cpu_wait_for_intr at /esp-idf/components/esp_hw_support/cpu.c:132 0x400d2fad: esp_vApplicationIdleHook at /esp-idf/components/esp_system/freertos_hooks.c:59 0x4008b9c4: prvIdleTask at /esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4058 (discriminator 1) ELF file SHA256: f0a061c0123f418e I (5205) esp_core_dump_flash: Save core dump to flash... Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0). Core 0 register dump: PC : 0x40097503 PS : 0x00020234 A0 : 0x800d85e2 A1 : 0x3ffb0e00 0x40097503: xthal_window_spill at /Users/igrokhotkov/e/esp32/hal/hal/windowspill_asm.S:377 A2 : 0x00020223 A3 : 0xa5a5a5a5 A4 : 0x800d85e2 A5 : 0x00060225 A6 : 0xfffbfff0 A7 : 0x00000086 A8 : 0x00000000 A9 : 0x3ffb0db0 A10 : 0x0000000a A11 : 0x00000000 A12 : 0x00000000 A13 : 0x00005000 A14 : 0x3ffb0da3 A15 : 0x3ffb0db0 SAR : 0x00000004 EXCCAUSE: 0x00000005 EXCVADDR: 0x00000000 LBEG : 0x4000c46c LEND : 0x4000c477 LCOUNT : 0x00000000 0x4000c46c: memset in ROM 0x4000c477: memset in ROM Core 0 was running in ISR context: EPC1 : 0x400d1d5a EPC2 : 0x00000000 EPC3 : 0x4000bff0 EPC4 : 0x40097503 0x400d1d5a: panic_print_char_uart at /esp-idf/components/esp_system/panic.c:81 0x4000bff0: _xtos_set_intlevel in ROM 0x40097503: xthal_window_spill at /Users/igrokhotkov/e/esp32/hal/hal/windowspill_asm.S:377 Backtrace: 0x40097500:0x3ffb0e00 0x400d85df:0x3ffb0e10 0x400d902d:0x3ffb0e80 0x400d2176:0x3ffb0ec0 0x400d2a59:0x3ffb0f00 0x4008183d:0x3ffb0f80 0x40081710:0x3ffb0fb0 0x00040022:0x3ffb1070 |<-CORRUPTED 0x40097500: xthal_window_spill at /Users/igrokhotkov/e/esp32/hal/hal/windowspill_asm.S:376 0x400d85df: esp_core_dump_replace_sp at /esp-idf/components/espcoredump/include_core_dump/port/xtensa/esp_core_dump_port_impl.h:48 (inlined by) esp_core_dump_setup_stack at /esp-idf/components/espcoredump/src/core_dump_common.c:80 (inlined by) esp_core_dump_write at /esp-idf/components/espcoredump/src/core_dump_common.c:152 0x400d902d: esp_core_dump_to_flash at /esp-idf/components/espcoredump/src/core_dump_flash.c:333 0x400d2176: esp_panic_handler at /esp-idf/components/esp_system/panic.c:362 0x400d2a59: panic_handler at /esp-idf/components/esp_system/port/panic_handler.c:190 0x4008183d: panicHandler at /esp-idf/components/esp_system/port/panic_handler.c:217 0x40081710: xt_highint4 at /esp-idf/components/esp_system/port/soc/esp32/highint_hdl.S:285 Core 1 register dump: PC : 0x40087664 PS : 0x00060334 A0 : 0x800d2fb0 A1 : 0x3ffb8b10 0x40087664: xt_utils_wait_for_intr at /esp-idf/components/xtensa/include/xt_utils.h:82 (inlined by) esp_cpu_wait_for_intr at /esp-idf/components/esp_hw_support/cpu.c:132 A2 : 0x00000001 A3 : 0x00000001 A4 : 0x00060023 A5 : 0x00000001 A6 : 0x00000000 A7 : 0x3ffb8b10 A8 : 0x800dea38 A9 : 0x3ffb8ac0 A10 : 0x00000000 A11 : 0x00000001 A12 : 0x00000001 A13 : 0x000000c6 A14 : 0x00000000 A15 : 0x3ffb8ac0 SAR : 0x00000000 EXCCAUSE: 0x00000005 EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000 Backtrace: 0x40087661:0x3ffb8b10 0x400d2fad:0x3ffb8b30 0x4008b9c4:0x3ffb8b60 0x40087661: xt_utils_wait_for_intr at /esp-idf/components/xtensa/include/xt_utils.h:81 (inlined by) esp_cpu_wait_for_intr at /esp-idf/components/esp_hw_support/cpu.c:132 0x400d2fad: esp_vApplicationIdleHook at /esp-idf/components/esp_system/freertos_hooks.c:59 0x4008b9c4: prvIdleTask at /esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4058 (discriminator 1) ELF file SHA256: f0a061c0123f418e Re-entered core dump! Exception happened during core dump! CPU halted.
impossibilitating dumping core and consequently making debugging more difficult, which is a big issue.
CONFIG_ESP_INT_WDT_TIMEOUT_MS=30
Can you please try increasing this to 300ms?
Done, and result is the same.
Same thing using the generic_gpio example.
Answers checklist.
General issue report
Even on v5.2-dev-2934-g3b748a6cb7, the code
with this defconfig
results in this crash
impossibilitating dumping core and consequently making debugging more difficult, which is a big issue.