espressif / esp-idf

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

wifi_prov_mgr faults on esp32c2 (IDFGH-12430) #13451

Closed mukymuk closed 6 months ago

mukymuk commented 7 months ago

Answers checklist.

IDF version.

v5.2.1

Espressif SoC revision.

C2

Operating System used.

Windows

How did you build your project?

Command line with CMake

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

PowerShell

Development Kit.

ESP8684-DevKitM-1 v1.1

Power Supply used.

USB

What is the expected behavior?

not fault

What is the actual behavior?

Shortly after successful provisioning, the app faults. See log.

Steps to reproduce.

copy wifi_prov_mgr from the v5.2.1 tag menuconfig to change the crystal freq to 26MHz and UART0 to custom 115200 set-device to esp32c2 build flash monitor

Debug Logs.

I (32) boot: ESP-IDF v5.2.1 2nd stage bootloader
I (32) boot: compile time Mar 22 2024 02:15:53
I (32) boot: chip revision: v1.0
I (35) boot.esp32c2: MMU Page Size  : 32K
I (40) boot.esp32c2: SPI Speed      : 60MHz
I (45) boot.esp32c2: SPI Mode       : DIO
I (49) boot.esp32c2: SPI Flash Size : 2MB
I (54) boot: Enabling RNG early entropy source...
I (60) boot: Partition Table:
I (63) boot: ## Label            Usage          Type ST Offset   Length
I (70) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (78) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (85) boot:  2 factory          factory app      00 00 00010000 00140000
I (93) boot: End of partition table
I (97) esp_image: segment 0: paddr=00010020 vaddr=3c0a8020 size=2ae80h (175744) map
I (145) esp_image: segment 1: paddr=0003aea8 vaddr=3fcb3500 size=02cach ( 11436) load
I (148) esp_image: segment 2: paddr=0003db5c vaddr=40380000 size=024bch (  9404) load
I (153) esp_image: segment 3: paddr=00040020 vaddr=42000020 size=a7a08h (686600) map
I (313) esp_image: segment 4: paddr=000e7a30 vaddr=403824bc size=11038h ( 69688) load
I (337) boot: Loaded app from partition at offset 0x10000
I (337) boot: Disabling RNG early entropy source...
I (348) cpu_start: Unicore app
I (358) cpu_start: Pro cpu start user code
I (358) cpu_start: cpu freq: 120000000 Hz
I (358) cpu_start: Application information:
I (361) cpu_start: Project name:     wifi_prov_mgr
I (366) cpu_start: App version:      1
I (371) cpu_start: Compile time:     Mar 22 2024 02:15:40
I (377) cpu_start: ELF file SHA256:  a9dbcb40e...
I (382) cpu_start: ESP-IDF:          v5.2.1
I (387) cpu_start: Min chip rev:     v1.0
I (392) cpu_start: Max chip rev:     v1.99
I (397) cpu_start: Chip rev:         v1.0
I (402) heap_init: Initializing. RAM available for dynamic allocation:
I (409) heap_init: At 3FCBB340 len 00021830 (134 KiB): RAM
I (415) heap_init: At 3FCDCB70 len 0000294C (10 KiB): RAM
I (422) spi_flash: detected chip: gd
I (425) spi_flash: flash io: dio
W (429) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (443) sleep: Configure to isolate all GPIO pins in sleep state
I (449) sleep: Enable automatic switching of GPIO sleep configuration
I (456) coexist: coex firmware version: 77cd7f8
I (461) coexist: coexist rom version de8c800
I (467) main_task: Started on CPU0
I (467) main_task: Calling app_main()
I (487) pp: pp rom version: de8c800
I (487) net80211: net80211 rom version: de8c800
I (497) wifi:wifi driver task: 3fcc3974, prio:23, stack:6144, core=0
I (497) wifi:wifi firmware version: a9f5b59
I (497) wifi:wifi certification version: v7.0
I (497) wifi:config NVS flash: enabled
I (497) wifi:config nano formating: enabled
I (507) wifi:Init data frame dynamic rx buffer num: 32
I (507) wifi:Init static rx mgmt buffer num: 5
I (507) wifi:Init management short buffer num: 32
I (517) wifi:Init dynamic tx buffer num: 32
I (517) wifi:Init static tx FG buffer num: 2
I (527) wifi:Init static rx buffer size: 1600
I (527) wifi:Init static rx buffer num: 10
I (537) wifi:Init dynamic rx buffer num: 32
I (537) wifi_init: rx ba win: 6
I (537) wifi_init: tcpip mbox: 32
I (547) wifi_init: udp mbox: 6
I (547) wifi_init: tcp mbox: 6
I (547) wifi_init: tcp tx win: 5760
I (557) wifi_init: tcp rx win: 5760
I (557) wifi_init: tcp mss: 1440
I (567) wifi_init: WiFi IRAM OP enabled
I (567) wifi_init: WiFi RX IRAM OP enabled
I (577) wifi_prov_scheme_ble: BT memory released
I (577) app: Starting provisioning
I (587) app: Development mode: using hard coded salt
I (587) app: Development mode: using hard coded verifier
I (597) phy_init: phy_version 310,5a96e9f,Jan 24 2024,17:35:13
I (627) wifi:mode : sta (08:3a:8d:41:3b:84)
I (627) wifi:enable tsf
controller lib commit: [91b8133]
controller rom commit: [3314f9d]
I (637) phy: libbtbb version: 8748923, Jan 24 2024, 17:35:27
I (637) protocomm_nimble: BLE Host Task Started
I (647) NimBLE: GAP procedure initiated: stop advertising.

I (647) NimBLE: GAP procedure initiated: advertise;
I (657) NimBLE: disc_mode=2
I (657) NimBLE:  adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=256 adv_itvl_max=256
I (667) NimBLE:

I (667) wifi_prov_mgr: Provisioning started with service name : PROV_413B84
I (677) app: Provisioning started
I (687) app: Scan this QR code from the provisioning application for Provisioning.
I (687) QRCODE: Encoding below text with ECC LVL 0 & QR Code Version 10
I (697) QRCODE: {"ver":"v1","name":"PROV_413B84","username":"wifiprov","pop":"abcd1234","transport":"ble"}

I (957) app: If QR code is not visible, copy paste the below URL in a browser.
https://espressif.github.io/esp-jumpstart/qrcode.html?data={"ver":"v1","name":"PROV_413B84","username":"wifiprov","pop":"abcd1234","transport":"ble"}
I (8937) app: BLE transport: Connected!
I (9827) protocomm_nimble: mtu update event; conn_handle=1 cid=4 mtu=256
I (11977) security2: Using salt and verifier to generate public key...
I (16517) app: Secured session established!
I (39697) app: Received Wi-Fi credentials
        SSID     : abc
        Password : 123
I (44067) wifi:new:<2,0>, old:<1,0>, ap:<255,255>, sta:<2,0>, prof:1
I (44347) wifi:state: init -> auth (b0)
I (44357) wifi:state: auth -> assoc (0)
I (44377) wifi:state: assoc -> run (10)
I (44387) wifi:connected with abc, aid = 7, channel 2, BW20, bssid = cc:2d:21:2d:28:68
I (44387) wifi:security: WPA2-PSK, phy: bgn, rssi: -43
I (44397) wifi:pm start, type: 1

I (44397) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us
I (44397) wifi:set rx beacon pti, rx_bcn_pti: 14, bcn_timeout: 25000, mt_pti: 14, mt_time: 10000
I (44427) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (46407) app: Connected with IP Address:192.168.1.14
I (46407) esp_netif_handlers: sta ip: 192.168.1.14, mask: 255.255.255.0, gw: 192.168.1.1
I (46407) wifi_prov_mgr: STA Got IP
W (46407) wifi:<ba-add>idx:0 (ifx:0, cc:2d:21:2d:28:68), tid:0, ssn:4, winSize:64
I (46417) app: Provisioning successful
I (46427) app: Hello World!
I (47427) app: Hello World!
I (48137) NimBLE: GAP procedure initiated: stop advertising.

I (48137) NimBLE: GAP procedure initiated: stop advertising.

I (48137) NimBLE: GAP procedure initiated: terminate connection; conn_handle=1 hci_reason=19

E (48197) protocomm_nimble: Error setting advertisement data; rc = 30
I (48207) wifi_prov_mgr: Provisioning stopped
I (48207) app: BLE transport: Disconnected!
I (48207) app: BLE transport: Disconnected!
I (48217) BLE_INIT: Release BLE [0x3fcb52a8] - [0x3fcbb338], len 24720
I (48217) wifi_prov_scheme_ble: BTDM memory released
I (48427) app: Hello World!
I (49427) app: Hello World!
I (50427) app: Hello World!
Guru Meditation Error: Core  0 panic'ed (Instruction access fault). Exception was unhandled.

Stack dump detected
Core  0 register dump:
MEPC    : 0x3fcc0fc8  RA      : 0x40392046  SP      : 0x3fcb6b80  GP      : 0x3fcb3d00
0x40392046: _global_interrupt_handler at C:/Users/mukym/project/tools/esp/idf/components/riscv/interrupt.c:107

TP      : 0x3fc996e0  T0      : 0x0000001f  T1      : 0x600c20d8  T2      : 0x00000002
S0/FP   : 0x3fcc1a80  S1      : 0x80000004  A0      : 0x42087208  A1      : 0x00000004
0x42087208: ethernet_input at C:/Users/mukym/project/tools/esp/idf/components/lwip/lwip/src/netif/ethernet.c:82

A2      : 0x600ce000  A3      : 0x00000004  A4      : 0x00000001  A5      : 0x3fcc0fc8
A6      : 0x00000004  A7      : 0x00000096  S2      : 0x00001881  S3      : 0x00000001
S4      : 0x00000000  S5      : 0x3fcdfd9c  S6      : 0x3fce0000  S7      : 0x3ff47000
S8      : 0x3fce0000  S9      : 0x3fce0000  S10     : 0x3fcdfdb8  S11     : 0x00000000
T3      : 0xff000fff  T4      : 0x80000000  T5      : 0x00000000  T6      : 0x00000000
MSTATUS : 0x00001881  MTVEC   : 0x40380001  MCAUSE  : 0x00000001  MTVAL   : 0x3fcc0fc8
0x40380001: _vector_table at ??:?

MHARTID : 0x00000000

Failed to run gdb_panic_server.py script: Command '['riscv32-esp-elf-gdb', '--batch', '-n', 'C:\\Users\\mukym\\Downloads\\wifi_prov_mgr\\build\\wifi_prov_mgr.elf', '-ex', 'target remote | "C:\\Users\\mukym\\project\\tools\\esp\\tools\\python_env\\idf5.2_py3.11_env\\Scripts\\python.exe" -m esp_idf_panic_decoder --target esp32c2 "C:\\Users\\mukym\\AppData\\Local\\Temp\\tmp62x_g2eg"', '-ex', 'bt']' returned non-zero exit status 1.
b"error starting child process '| C:\\Users\\mukym\\project\\tools\\esp\\tools\\python_env\\idf5.2_py3.11_env\\Scripts\\python.exe -m esp_idf_panic_decoder --target esp32c2 C:\\Users\\mukym\\AppData\\Local\\Temp\\tmp62x_g2eg': CreateProcess: No such file or directory\r\nNo stack.\r\n"

Stack memory:
3fcb6b80: 0x00000000 0x00000000 0x00000000 0x403801e8 0x60023000 0x40389cf6 0x40389d6e 0x00000000
3fcb6ba0: 0x3fcb6b9c 0x00000000 0x00000000 0x00000000 0x3fcb6bb4 0xffffffff 0x3fcb6bb4 0x3fcb6bb4
3fcb6bc0: 0x00000000 0x3fcb6bc8 0xffffffff 0x3fcb6bc8 0x3fcb6bc8 0x00000001 0x00000001 0x00000000
3fcb6be0: 0x0001ffff 0x00000000 0x00000000 0x00000000 0x00000000 0x3fcb6bf0 0x00000000 0x00000000
3fcb6c00: 0x00000000 0x3fcb6c08 0xffffffff 0x3fcb6c08 0x3fcb6c08 0x00000000 0x3fcb6c1c 0xffffffff
3fcb6c20: 0x3fcb6c1c 0x3fcb6c1c 0x00000001 0x00000001 0x00000000 0x0001ffff 0x00000000 0x00000000
3fcb6c40: 0x00000000 0x60023000 0x40389cf6 0x40389d6e 0x3fcbba30 0x3fcbbaf4 0x3fcbf108 0x00000000
3fcb6c60: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6c80: 0x00000000 0x00000000 0x00000000 0x3fcb531c 0x0000010b 0x00000000 0x00000000 0x00000000
3fcb6ca0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6cc0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6ce0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6d00: 0x00000000 0x00000006 0x00000000 0x00000000 0x00000000 0x00000000 0x3fcca60c 0x00000101
3fcb6d20: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xdeadbeef
3fcb6d40: 0x0000001c 0x00000000 0x3fcb5a08 0x004e004e 0x00010241 0x4208ad72 0x3fcc0f44 0x3fcb5964
3fcb6d60: 0x00000010 0x00000002 0x3fcb6d44 0x3fcc0fc8 0x42087208 0x0000001c 0x00000000 0x3fcb60a8
3fcb6d80: 0x003e003e 0x00010241 0x4208ad72 0x3fcc0f44 0x3fcb6004 0x00000010 0x00000002 0x3fcb6d78
3fcb6da0: 0x3fcc0fc8 0x42087208 0x0000001c 0x00000000 0x3fcb6748 0x00960096 0x00010241 0x4208ad72
3fcb6dc0: 0x3fcc0f44 0x3fcb66a4 0x00000010 0x00000002 0x3fcb6dac 0x3fcc0fc8 0x42087208 0x00004555
3fcb6de0: 0x3fcb52bc 0x3fcb52bc 0x00000000 0x4038bb6c 0x3fcb6b90 0x00000000 0x00000000 0x00000000
3fcb6e00: 0x00000009 0x00000000 0x0000000a 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6e20: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6e40: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6e60: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6e80: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6ea0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000001 0x00000009 0x00000000
3fcb6ec0: 0x00200000 0x00200000 0x000d8000 0x00128000 0x0000001b 0x00000001 0x3fcbeb4c 0x3fcbeba0
3fcb6ee0: 0x403883ce 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6f20: 0x3fcc1a58 0x3fcc4738 0x00000002 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6f40: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
3fcb6f60: 0x00000101 0x3fcb3f4c 0x0004005d 0x00000000 0x00000400 0x3fcbd21c 0x00000000 0x00000002

ELF file SHA256: a9dbcb40e

Rebooting...

More Information.

This app works on a ESP-32-C6-DevKitM-1 V1.0

esp-lrh commented 7 months ago

Hi, @mukymuk , this issue is caused by a mistake in components/bt/CMakeLists.txt:87 , we will fix it soon.

Thanks for your report!