espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.7k stars 7.3k forks source link

The ESP32 crashed with an assertion error (ASSERT_PARAM(0 0)) in lld_pdu.c at line 889 after the completion of the pairing process. (IDFGH-10378) #11635

Open spanDN opened 1 year ago

spanDN commented 1 year ago

Answers checklist.

IDF version.

v5.0.2

Operating System used.

Linux

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

Development Kit.

Custom board

Power Supply used.

External 3.3V

What is the expected behavior?

The ESP32 BLE stack should be able to handle situations where the signal strength is low without experiencing crashes.

What is the actual behavior?

The ESP32 crashed immediately after the pairing process was completed. We are utilizing both WIFI and BLE simultaneously. Our commercial device receives advertisements from different devices at a rate of two times per second. However, after the pairing with a device that had a weak signal, the ESP32 crashed.

Steps to reproduce.

While the issue is not easy to reproduce, you would need to have a BLE device that advertises, and the ESP32 would need to complete the pairing process with a signal strength of -98 dBm.

Since it is a commercial product, there is a lot at stake so a timely solution is paramount for us.

Debug Logs.

esptool.py --port /dev/ttyUSB1 chip_id

esptool.py v4.5.1
Serial port /dev/ttyUSB1
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WD (revision v1.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: fc:f5:c4:6a:d8:XX
Uploading stub...
Running stub...
Stub running...
Warning: ESP32 has no Chip ID. Reading MAC instead.
MAC: fc:f5:c4:6a:d8:XX
Hard resetting via RTS pin...

I (2173) cpu_start: cpu freq: 240000000 Hz
I (2173) cpu_start: Application information:
I (2173) cpu_start: Project name:     XXXXXXXXXXXXXXX
I (2173) cpu_start: App version:      ca0faa8-dirty
I (2173) cpu_start: Compile time:     Jun  8 2023 10:33:35
I (2173) cpu_start: ELF file SHA256:  4add6dedf17035e5...
I (2174) cpu_start: ESP-IDF:          v5.0.2
I (2174) cpu_start: Min chip rev:     v0.0
I (2174) cpu_start: Max chip rev:     v3.99 
I (2174) cpu_start: Chip rev:         v1.0
I (2175) heap_init: Initializing. RAM available for dynamic allocation:
I (2175) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (2175) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (2175) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (2175) heap_init: At 3FFCD078 len 00012F88 (75 KiB): DRAM
I (2175) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (2176) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (2176) heap_init: At 4009F1E0 len 00000E20 (3 KiB): IRAM
I (2177) esp_psram: Adding pool of 4083K of PSRAM memory to heap allocator
I (2179) spi_flash: detected chip: gd
lld_pdu_get_tx_flush_nb HCI packet count mismatch (0, 1)
W (93711986) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e
...
93718126  [DBG ] [BTC_TASK] [004872] [CONN_HAN] Created event: PAIRING_COMPLETED, conn: FFFF, len:0, data:, 1
93718236  [DBG ] [BTC_TASK] [004872] [BLE_IMPL] update connection params status = 0, min_int = 0, max_int = 0,conn_int = 40,latency = 0, timeout = 300
ASSERT_PARAM(0 0), in lld_pdu.c at line 889
Guru Meditation Error: Core  0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x4008615c: 920020c0 00000361 0020c000
Core  0 register dump:
PC      : 0x40086162  PS      : 0x00060334  A0      : 0x800865a1  A1      : 0x3ffc351c  
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x3f41e71e  
A6      : 0x00000379  A7      : 0xfffffffc  A8      : 0x3ffc4a50  A9      : 0xace1e6f7  
A10     : 0x00000000  A11     : 0x3ffc34bf  A12     : 0x3ffc346b  A13     : 0x00000039  
A14     : 0x00000000  A15     : 0x3ffc3470  SAR     : 0x00000004  EXCCAUSE: 0x00000000  
EXCVADDR: 0x00000000  LBEG    : 0x400864a9  LEND    : 0x400864b1  LCOUNT  : 0x00000000  

Backtrace: 0x4008615f:0x3ffc351c |<-CORRUPTED

More Information.

We are using ESP32 - WROVER B module.

esp-zhp commented 1 year ago

@spanDN Has the issue been resolved?

spanDN commented 1 year ago

@zhp0406 Hi, Have there been any changes in the code? Which version should be installed to check? We found a workaround so as not to even attempt a connection if the signal level is low.

esp-zhp commented 1 year ago

@spanDN I am still trying to reproduce the issue. The log you provided is not very comprehensive, and I cannot find information such as the version of IDF and the version of the bt library. If you are still able to reproduce the issue, please provide me with the complete log, and it would be best if you could also give me the ELF file. I will do my best to help you resolve the problem as soon as possible.and thanks you for reporting this problem.