uart_hal_write_txfifo panic in 4.2 but not 4.1

ecc esp
Posts: 8
Joined: Mon Jan 28, 2019 10:18 pm

uart_hal_write_txfifo panic in 4.2 but not 4.1

Postby ecc esp » Tue Aug 04, 2020 8:02 pm

My code has been working fine when built with the espressif/idf:release-v4.1 docker image. But with the v4.2 image, I get panics like the following:

Code: Select all

Guru Meditation Error: Core  0 panic'ed (Interrupt wdt timeout on CPU0). 

Core  0 register dump:
PC      : 0x400825e8  PS      : 0x00050034  A0      : 0x4000bff0  A1      : 0x3ffb0780  
0x400825e8: _xt_lowint1 at /opt/esp/idf/components/freertos/xtensa/xtensa_vectors.S:1105

A2      : 0x00000000  A3      : 0x00000040  A4      : 0x00000400  A5      : 0x3ffb0760  
A6      : 0x00000001  A7      : 0x00000001  A8      : 0x3ffb6a30  A9      : 0x4008582c  
0x4008582c: _frxt_int_enter at /opt/esp/idf/components/freertos/xtensa/portasm.S:119

A10     : 0x0000000c  A11     : 0x3ffb365c  A12     : 0x3ff44000  A13     : 0xffffff00  
A14     : 0x00000001  A15     : 0x3ffb69bc  SAR     : 0x00000020  EXCCAUSE: 0x00000005  
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  
Core  0 was running in ISR context:
EPC1    : 0x400e69e7  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x400825e8
0x400e69e7: uart_hal_write_txfifo at /opt/esp/idf/components/soc/src/hal/uart_hal_iram.c:35

0x400825e8: _xt_lowint1 at /opt/esp/idf/components/freertos/xtensa/xtensa_vectors.S:1105


Backtrace:0x400825e5:0x3ffb0780 0x4000bfed:0x3ffb2f30 0x400857c5:0x3ffb2f40 0x400d2263:0x3ffb2f60 0x400d22c1:0x3ffb2fa0 0x400e6279:0x3ffb2fd0 0x40083045:0x3ffb2ff0 0x4008556d:0x3ffb3010
0x400825e5: _xt_lowint1 at /opt/esp/idf/components/freertos/xtensa/xtensa_vectors.S:1105

0x400857c5: vPortExitCritical at /opt/esp/idf/components/freertos/xtensa/port.c:419

0x400d2263: esp_intr_alloc_intrstatus at /opt/esp/idf/components/esp32/intr_alloc.c:673

0x400d22c1: esp_intr_alloc at /opt/esp/idf/components/esp32/intr_alloc.c:693

0x400e6279: gpio_isr_register_on_core_static at /opt/esp/idf/components/driver/gpio.c:500

0x40083045: ipc_task at /opt/esp/idf/components/esp_ipc/ipc.c:62

0x4008556d: vPortTaskWrapper at /opt/esp/idf/components/freertos/xtensa/port.c:143

Core  1 register dump:
PC      : 0x400e5dd2  PS      : 0x00060634  A0      : 0x800d28ba  A1      : 0x3ffb5900  
0x400e5dd2: esp_pm_impl_waiti at /opt/esp/idf/components/esp32/pm_esp32.c:486

A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000001  A5      : 0x80000001  
A6      : 0x00000003  A7      : 0x00060023  A8      : 0x800857c8  A9      : 0x3ffb58f0  
A10     : 0x00000003  A11     : 0x00060623  A12     : 0x00060620  A13     : 0x00060623  
A14     : 0x00000001  A15     : 0x00000000  SAR     : 0x00000000  EXCCAUSE: 0x00000005  
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  

Backtrace:0x400e5dcf:0x3ffb5900 0x400d28b7:0x3ffb5920 0x40085ee6:0x3ffb5940 0x4008556d:0x3ffb5960
0x400e5dcf: esp_pm_impl_waiti at /opt/esp/idf/components/esp32/pm_esp32.c:484

0x400d28b7: esp_vApplicationIdleHook at /opt/esp/idf/components/esp_common/src/freertos_hooks.c:63

0x40085ee6: prvIdleTask at /opt/esp/idf/components/freertos/tasks.c:3385 (discriminator 1)

0x4008556d: vPortTaskWrapper at /opt/esp/idf/components/freertos/xtensa/port.c:143
Does this look familiar to anyone who has moved from 4.1 to 4.2 recently?

talijancic
Posts: 3
Joined: Mon Jan 18, 2021 1:37 pm

Re: uart_hal_write_txfifo panic in 4.2 but not 4.1

Postby talijancic » Mon Jan 18, 2021 1:43 pm

I have the a similar problem. My code has been working fine when built with the espressif/idf:release-v4.1. But with the v4.2 idf version, I get panics like the following:
  1. ASSERT_PARAM(-218959118 0), in arch_main.c at line 343
  2. Guru Meditation Error: Core  0 panic'ed (Interrupt wdt timeout on CPU0).
  3.  
  4. Core  0 register dump:
  5. PC      : 0x40083395  PS      : 0x00060634  A0      : 0x80133324  A1      : 0x3ffbe260
  6. 0x40083395: r_assert_param at ??:?
  7.  
  8. A2      : 0x00000001  A3      : 0x00000000  A4      : 0x60008048  A5      : 0x00000000
  9. A6      : 0x00000004  A7      : 0x3ffbdbe4  A8      : 0x80083390  A9      : 0x3ffbe240
  10. A10     : 0x00000000  A11     : 0x00000037  A12     : 0x00000014  A13     : 0xffffffff
  11. A14     : 0x00000000  A15     : 0xfffffffc  SAR     : 0x00000004  EXCCAUSE: 0x00000005
  12. EXCVADDR: 0x00000000  LBEG    : 0x400832c8  LEND    : 0x400832cf  LCOUNT  : 0x00000000
  13. 0x400832c8: r_assert_param at ??:?
  14.  
  15. 0x400832cf: r_assert_param at ??:?
  16.  
  17. Core  0 was running in ISR context:
  18. EPC1    : 0x401dec4f  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x40083395
  19. 0x401dec4f: uart_hal_write_txfifo at /Users/italijancic/esp32/esp-idf/components/soc/src/hal/uart_hal_iram.c:35
  20.  
  21. 0x40083395: r_assert_param at ??:?
  22.  
  23.  
  24. Backtrace:0x40083392:0x3ffbe260 0x40133321:0x3ffbe280 0x40019fb5:0x3ffbe2a0 0x40046683:0x3ffbe2d0 0x40047515:0x3ffbe2f0 0x400864dd:0x3ffbe310 0x40086131:0x3ffbe330 0x4008881e:0x3ffbe350 0x4008990f:0x3ffbe370 0x40082a79:0x3ffbe390 0x40133754:0x3ffd2c50 0x40133d01:0x3ffd2c70 0x40090db9:0x3ffd2ca0
  25. 0x40083392: r_assert_param at ??:?
  26.  
  27. 0x40133321: r_platform_reset at ??:?
  28.  
  29. 0x400864dd: r_lld_evt_end at ??:?
  30.  
  31. 0x40086131: r_lld_evt_end_isr at ??:?
  32.  
  33. 0x4008881e: r_rwble_isr at ??:?
  34.  
  35. 0x4008990f: r_rwbtdm_isr_wrapper at intc.c:?
  36.  
  37. 0x40082a79: _xt_lowint1 at /Users/italijancic/esp32/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1105
  38.  
  39. 0x40133754: r_rw_schedule at ??:?
  40.  
  41. 0x40133d01: btdm_controller_task at ??:?
  42.  
  43. 0x40090db9: vPortTaskWrapper at /Users/italijancic/esp32/esp-idf/components/freertos/xtensa/port.c:143
  44.  
  45. Core  1 register dump:
  46. PC      : 0x401db646  PS      : 0x00060134  A0      : 0x800d5d8d  A1      : 0x3ffbc460
  47. 0x401db646: esp_pm_impl_waiti at /Users/italijancic/esp32/esp-idf/components/esp32/pm_esp32.c:486
  48.  
  49. A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000001  A5      : 0x80000001
  50. A6      : 0x00000003  A7      : 0x00060023  A8      : 0x800d5bee  A9      : 0x3ffbc430
  51. A10     : 0x00000000  A11     : 0x00000001  A12     : 0x00000014  A13     : 0x000000a5
  52. A14     : 0x000000a5  A15     : 0x00060023  SAR     : 0x00000000  EXCCAUSE: 0x00000005
  53. EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000
  54.  
  55. Backtrace:0x401db643:0x3ffbc460 0x400d5d8a:0x3ffbc480 0x40091799:0x3ffbc4a0 0x40090db9:0x3ffbc4c0
  56. 0x401db643: esp_pm_impl_waiti at /Users/italijancic/esp32/esp-idf/components/esp32/pm_esp32.c:484
  57.  
  58. 0x400d5d8a: esp_vApplicationIdleHook at /Users/italijancic/esp32/esp-idf/components/esp_common/src/freertos_hooks.c:63
  59.  
  60. 0x40091799: prvIdleTask at /Users/italijancic/esp32/esp-idf/components/freertos/tasks.c:3386 (discriminator 1)
  61.  
  62. 0x40090db9: vPortTaskWrapper at /Users/italijancic/esp32/esp-idf/components/freertos/xtensa/port.c:143
  63.  
Any suggestions?

Does this look familiar to anyone who has moved from 4.1 to 4.2 recently?

eriknorth
Posts: 6
Joined: Mon Nov 16, 2020 7:34 pm

Re: uart_hal_write_txfifo panic in 4.2 but not 4.1

Postby eriknorth » Tue Feb 02, 2021 3:45 pm

Hi,
We are experiencing the very same crash. It also started to happen when we upgraded from v4.1 (573f5de99ad615364d9acf0f22fc9ee34bacbb09) to v4.2-241-g1d692f22.
In our case it seems to happen more often if we are performing some operations on NVS. But it could be also a wrong guess.
It has been very hard to debug this failure and we have not found any solid solution.

Has anybody identified the the issue and/or way to minimize the risk?

This issue has been also reported in Github:
https://github.com/espressif/esp-idf/issues/6444

Here is the crash log:

Code: Select all

ASSERT_PARAM(-218959118 0), in arch_main.c at line 343
Guru Meditation Error: Core  0 panic'ed (Interrupt wdt timeout on CPU0). 

Core  0 register dump:
PC      : 0x400869b3  PS      : 0x00060534  A0      : 0x80137f00  A1      : 0x3ffbe280  
A2      : 0x00000001  A3      : 0x00000000  A4      : 0x60008048  A5      : 0x00000000  
A6      : 0x00000004  A7      : 0x3ffbdbe4  A8      : 0x800869b0  A9      : 0x3ffbe260  
A10     : 0x00000000  A11     : 0x00000037  A12     : 0x00000014  A13     : 0xffffffff  
A14     : 0x00000000  A15     : 0xfffffffc  SAR     : 0x00000004  EXCCAUSE: 0x00000005  
EXCVADDR: 0x00000000  LBEG    : 0x400868e8  LEND    : 0x400868ef  LCOUNT  : 0x00000000  
Core  0 was running in ISR context:
EPC1    : 0x4009774b  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x400869b3

Backtrace:0x400869b0:0x3ffbe280 0x40137efd:0x3ffbe2a0 0x40019fb5:0x3ffbe2c0 0x4008afda:0x3ffbe2f0 0x40089959:0x3ffbe330 0x40089675:0x3ffbe350 0x4008bd66:0x3ffbe370 0x4008cea7:0x3ffbe390 0x40083b55:0x3ffbe3b0 0x40138334:0x3ffb5770 0x401388fd:0x3ffb5790
Core  1 register dump:
PC      : 0x401b4b3e  PS      : 0x00060c34  A0      : 0x800d6564  A1      : 0x3ffbc490  
A2      : 0x00000000  A3      : 0x40001d48  A4      : 0x00000000  A5      : 0x3ffcdaa0  
A6      : 0x3ffc7938  A7      : 0x3ffc7944  A8      : 0x800d6452  A9      : 0x3ffbc460  
A10     : 0x00000000  A11     : 0x3ffbedc8  A12     : 0x3ffbedc8  A13     : 0x00000000  
A14     : 0x00060a20  A15     : 0x00000000  SAR     : 0x00000000  EXCCAUSE: 0x00000005  
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  

Backtrace:0x401b4b3b:0x3ffbc490 0x400d6561:0x3ffbc4b0 0x40092208:0x3ffbc4d0


--- idf_monitor on /dev/ttyUSB0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
0x40080400: _init at ??:?
0x40080000: _WindowOverflow4 at esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730
0x400d0020: _stext at ??:?
0x40086b64: r_ea_elt_insert at ??:?
0x40081e48: call_start_cpu1 at esp-idf/components/esp32/cpu_start.c:287
0x400869b3: r_assert_param at ??:?
0x400868e8: r_assert_param at ??:?
0x400868ef: r_assert_param at ??:?
0x4009774b: uart_hal_write_txfifo at esp-idf/components/soc/src/hal/uart_hal_iram.c:35
0x400869b3: r_assert_param at ??:?
0x400869b0: r_assert_param at ??:?
0x40137efd: r_platform_reset at ??:?
0x4008afda: r_lld_pdu_rx_handler at ??:?
0x40089959: r_lld_evt_end at ??:?
0x40089675: r_lld_evt_end_isr at ??:?
0x4008bd66: r_rwble_isr at ??:?
0x4008cea7: r_rwbtdm_isr_wrapper at intc.c:?
0x40083b55: _xt_lowint1 atesp-idf/components/freertos/xtensa/xtensa_vectors.S:1105
0x40138334: r_rw_schedule at ??:?
0x401388fd: btdm_controller_task at ??:?
0x401b4b3e: esp_pm_impl_waiti at esp-idf/components/esp32/pm_esp32.c:486
0x401b4b3b: esp_pm_impl_waiti at esp-idf/components/esp32/pm_esp32.c:484
0x400d6561: esp_vApplicationIdleHook at esp-idf/components/esp_common/src/freertos_hooks.c:63
0x40092208: prvIdleTask at esp-idf/components/freertos/tasks.c:3386
0x40080400: _init at ??:?
0x40080000: _WindowOverflow4 at esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730
0x400d0020: _stext at ??:?
0x40086b64: r_ea_elt_insert at ??:
0x40081e48: call_start_cpu1 at esp-idf/components/esp32/cpu_start.c:287

eriknorth
Posts: 6
Joined: Mon Nov 16, 2020 7:34 pm

Re: uart_hal_write_txfifo panic in 4.2 but not 4.1

Postby eriknorth » Mon Feb 15, 2021 10:58 am

Hi,

After extensive testing and bisecting, we might have pin pointed the fault.
It seems that crashing started at BT Controller commit:
https://github.com/espressif/esp32-bt-l ... 837f446ef7
This led us to check flags related to sleep modes. After disabling CONFIG_BTDM_MODEM_SLEEP, we were not able to replicate the crash anymore.

It is unfortunate that BT Lib is closed source which makes debugging issues like this very time consuming. And even now after finding the issue we are not sure why this flag exactly fixes the issue.

Please, whoever is experiencing this issue, check if this flag also mitigates/fixes the crash.

/Erik

talijancic
Posts: 3
Joined: Mon Jan 18, 2021 1:37 pm

Re: uart_hal_write_txfifo panic in 4.2 but not 4.1

Postby talijancic » Sat Feb 27, 2021 12:35 am

Thanks eriknorth:

Disabling this flag CONFIG_BTDM_MODEM_SLEEP, I solved my problem.

Best regards!

italijancic

Who is online

Users browsing this forum: No registered users and 117 guests