Closed Tinyu-Zhao closed 1 year ago
@Tinyu-Zhao - Please try using the latest Arduino Core 2.0.10 and let me know if the issue continues.
@SuGlider Hi, just upgraded the kernel to 2.0.10 and tried again, but the problem still exists!
ELF file SHA256: f82a5b93590fc88a
Rebooting...
assert failed: spinlock_acquire spinlock.h:122 (result == core_id || result == SPINLOCK_FREE)
Backtrace: 0x40086389:0x3ffbc4c0 0x400d9e35:0x3ffbc4d0 0x40083900:0x3ffbc520 0x40084890:0x3ffbc540 0x4008386d:0x3ffbc600 0x400884b5:0x3ffbc620 0x4008d559:0x3ffbc640 0x4008b213:0x3ffbc770 0x400d939c:0x3ffbc7b0 0x400d93eb:0x3ffbc7e0 0x400d97da:0x3ffbc800 0x400896b1:0x3ffbc820
0x400d9e35: panic_handler at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/port/panic_handler.c line 124
0x40083900: xt_unhandled_exception at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/port/panic_handler.c line 219
0x4008386d: panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c line 408
0x400884b5: esp_system_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/esp_system.c line 137
0x4008d559: __assert_func at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/assert.c line 85
0x4008b213: xPortEnterCriticalTimeout at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/spinlock.h line 122
0x400d939c: esp_task_wdt_reset at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/include/freertos/portmacro.h line 578
0x400d93eb: idle_hook_cb at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/task_wdt.c line 80
0x400d97da: esp_vApplicationIdleHook at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/freertos_hooks.c line 51
0x400896b1: prvIdleTask at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/tasks.c line 3987
@Tinyu-Zhao
Please try this code:
void IRAM_ATTR GT911IRQ() {
// removed interrupts()/noInterrupts() from the GPIO ISR
gt911_irq_trigger = 1;
}
Is there a reason for using interrupts()/noInterrupts()
?
After testing, removing "interrupts()/noInterrupts()" doesn't affect the functionality and stops the constant rebooting.
This is the code left by a former colleague many years ago, before esp 2.0.5 this problem did not occur, do you know what causes this problem?
Is it because of this?
ESP32 Arduino runs on top of FreeRTOS. It doesn't make much sense to disable interrupts when running a RTOS. The software shall use FreeRTOS resources to achieve results.
Is it because of this?
Yes, I think that before 2.0.5 sei()
and cli()
had no code.
Thank you for your answer and help. Have fun.☺️
Board
ESP32-D0WDQ6-V3
Device Description
M5Paper COMM EDition
Hardware Configuration
Schematic
Version
v2.0.5
IDE Name
PlatfromIO and Arduino
Operating System
macOS 11.7.8 or Windows
Flash frequency
40Mhz
PSRAM enabled
no
Upload speed
115200
Description
Constant reboot after program execution.
I suspect a conflict between Wire and IRQ, if I comment out the interrupts(); or Wire part of GT911::begin in the program, the program won't get stuck in a reboot.
`volatile uint8_t gt911_irq_trigger = 0;
void IRAM_ATTR GT911IRQ() { noInterrupts(); gt911_irq_trigger = 1; interrupts(); }
esp_err_t GT911::begin(uint8_t pin_sda, uint8_t pin_scl, uint8_t pin_int) { log_d("GT911: I2C Initialization"); pinMode(pin_int, INPUT); // Startup sequence PIN part
}`
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide