Core 0 panic'ed (Interrupt wdt timeout on CPU0) when i have tx ring buffer
Posted: Sun Feb 18, 2024 9:47 am
Hi every one.i have problem with uart_driver_install in espidf.when i use uart driver install like uart_driver_install(Serial0,1024,0, 10, &uart0_queue, 0) my rx interrupt works correct but if i want to use write something on serial with uart_write_bytes() i get "Core 0 panic'ed (Interrupt wdt timeout on CPU0)" error. i know that if i use driver install like uart_driver_install(Serial0,1024,1024, 10, &uart0_queue, 0) ,uses tx ring buffer and write faster on serial , but when i use like this i cant write anything on serial.
how can i solve this?
my espidf version is 4.4.6
my code:
my error
how can i solve this?
my espidf version is 4.4.6
my code:
- uint8_t *ArrayTransmit_SR1;
- uint8_t *ArrayReceive_SR1;
- #define BUFF_SIZE_TRANSMIT (70000)
- #define BUFF_SIZE_TRANSMIT_MAX (69000)
- #define BUF_SIZE_RECEIVE (4096)
- #define Serial0 UART_NUM_0
- static void core0Handling(void *pvParameter)
- {
- ArrayTransmit_SR1 = (uint8_t *) malloc(BUFF_SIZE_TRANSMIT);
- ArrayReceive_SR1 = (uint8_t *) malloc(BUF_SIZE_RECEIVE);
- int lenReceive_SR2,lenTransmit_SR2,lenReceive_SR1,lenTransmit_SR1;
- while(1)
- {
- lenReceive_SR1 = recv(sock_SR1,(&ArrayReceive_SR1[0]), BUF_SIZE_RECEIVE , 0); //receive data
- if(lenReceive_SR1>0)
- {
- // printf("%d\n",lenReceive_SR1);
- uart_write_bytes(Serial0, (&ArrayReceive_SR1[0]) ,lenReceive_SR1);
- }
- if(ReceiveCheck_SR1>5)
- {
- adrcopy_SR1=adr_SR1;
- ReceiveCheck_SR1=0;
- if(!shift_SR1)
- {
- lenTransmit_SR1=send(sock_SR1, ((&ArrayTransmit_SR1[lastadr_SR1])), adrcopy_SR1-lastadr_SR1, 0);
- }
- else //shift in buffer
- { lenTransmit_SR1=send(sock_SR1, (&ArrayTransmit_SR1[lastadr_SR1]), BUFF_SIZE_TRANSMIT_MAX - lastadr_SR1, 0);
- if(adrcopy_SR1)
- {
- lenTransmit_SR1=send(sock_SR1,(&ArrayTransmit_SR1[0]), adrcopy_SR1, 0);
- }
- shift_SR1=false;
- }
- lastadr_SR1=adrcopy_SR1;
- }
- }
- void app_main(void)
- {
- esp_err_t ret = nvs_flash_init();
- if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
- {
- ESP_ERROR_CHECK(nvs_flash_erase());
- ret = nvs_flash_init();
- }
- uart_param_config(Serial0, &uart_config);
- uart_set_pin(Serial0, ECHO_TEST_TXD0, ECHO_TEST_RXD0, ECHO_TEST_RTS0, ECHO_TEST_CTS0);
- uart_driver_install(Serial0,1024,1024, 10, &uart0_queue, 0);
- uart_isr_free(Serial0);
- uart_isr_register(Serial0,uart_intr_handle_SR2, NULL, ESP_INTR_FLAG_IRAM, &handle_console);
- uart_enable_rx_intr(Serial0);
- uart_param_config(Serial0, &uart_config);
- uart_set_pin(Serial0, ECHO_TEST_TXD0, ECHO_TEST_RXD0, ECHO_TEST_RTS0, ECHO_TEST_CTS0);
- uart_driver_install(Serial0,1024,1024, 10, &uart0_queue, 0);
- uart_isr_free(Serial0);
- uart_isr_register(Serial0,uart_intr_handle_SR2, NULL, ESP_INTR_FLAG_IRAM, &handle_console);
- uart_enable_rx_intr(Serial0);
- TaskHandle_t HandleCore0;
- xTaskCreatePinnedToCore(&core0Handling, "core0_task", 1024*5, 1024*5, tskIDLE_PRIORITY, &HandleCore0,1);
- }
- Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0).
- Core 0 register dump:
- PC : 0x40085bbd PS : 0x00050034 A0 : 0x40085330 A1 : 0x3ffb1090
- 0x40085bbd: uart_intr_handle at C:/Users/user/Desktop/uart_async_rxtxtasks/main/uart_async_rxtxtasks_main.c:97
- 0x40085330: _xt_lowint1 at C:/Users/user/esp/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1114
- A2 : 0xe000c000 A3 : 0x3ffbf860 A4 : 0x80084fa0 A5 : 0x4008d1b6
- 0x4008d1b6: _frxt_int_enter at C:/Users/user/esp/esp-idf/components/freertos/port/xtensa/portasm.S:119
- A6 : 0x00000000 A7 : 0x3ffb1090 A8 : 0x80085c0e A9 : 0x3ffb1040
- A10 : 0x00000000 A11 : 0x00000002 A12 : 0x80084fa0 A13 : 0x3ffbf7e0
- A14 : 0x00000000 A15 : 0x3ffb1040 SAR : 0x00000014 EXCCAUSE: 0x00000005
- EXCVADDR: 0x00000000 LBEG : 0x400896c4 LEND : 0x400896e0 LCOUNT : 0xffffffff
- 0x400896c4: memcpy at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/newlib/newlib/libc/machine/xtensa/memcpy.S:175
- 0x400896e0: memcpy at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/newlib/newlib/libc/machine/xtensa/memcpy.S:197
- Core 0 was running in ISR context:
- EPC1 : 0x400d1f13 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x40085bbd
- 0x400d1f13: panic_print_char_uart at C:/Users/user/esp/esp-idf/components/esp_system/panic.c:80
- 0x40085bbd: uart_intr_handle at C:/Users/user/Desktop/uart_async_rxtxtasks/main/uart_async_rxtxtasks_main.c:97
- Backtrace: 0x40085bba:0x3ffb1090 0x4008532d:0x3ffb10d0 0x4000bfed:0x3ffbf870 0x400911b9:0x3ffbf880 0x400db951:0x3ffbf8a0 0x400dc8e5:0x3ffbf900
- 0x400dcb22:0x3ffbf980 0x400d8f22:0x3ffbf9c0
- 0x40085bba: uart_intr_handle at C:/Users/user/Desktop/uart_async_rxtxtasks/main/uart_async_rxtxtasks_main.c:97
- 0x4008532d: _xt_lowint1 at C:/Users/user/esp/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1114
- 0x400911b9: vPortClearInterruptMaskFromISR at C:/Users/user/esp/esp-idf/components/freertos/port/xtensa/include/freertos/portmacro.h:571
- (inlined by) vPortExitCritical at C:/Users/user/esp/esp-idf/components/freertos/port/xtensa/port.c:332
- 0x400db951: uart_enable_tx_intr at C:/Users/user/esp/esp-idf/components/driver/uart.c:632
- 0x400dc8e5: uart_tx_all at C:/Users/user/esp/esp-idf/components/driver/uart.c:1271
- 0x400dcb22: uart_write_bytes at C:/Users/user/esp/esp-idf/components/driver/uart.c:1319