ESP32 STATION 正接AP时候发生了PANIC然后重启了

ttxs1002004
Posts: 13
Joined: Thu Apr 22, 2021 7:09 pm

Re: ESP32 STATION 正接AP时候发生了PANIC然后重启了

Postby ttxs1002004 » Sun Apr 25, 2021 6:45 am

“能否解析一下 crash 时候 backtrace?看一下 call stack。”,我感觉是BTC任务狗触发,既然高优先级的BTC都触发,那么IDLE0和IDLE1触发显然是必然的。问题是,为何没有什么操作的BTC WDT会触发? 当时运行的BTC任务只是BLE广播状态而已。

此外,我的业务逻辑调用分区写备份数据,分区写/擦除会不会太占用时间,导致BTC有时没法及时工作(即使仅仅广播?)

ESP_Gargamel
Posts: 224
Joined: Wed Nov 14, 2018 8:45 am

Re: ESP32 STATION 正接AP时候发生了PANIC然后重启了

Postby ESP_Gargamel » Sun Apr 25, 2021 7:28 am

1、你还是把发生 task WDT 和 crash 时的 backtrace 解析一下,可以获取一些 BTC task 内的情况,看为何 CPU0 都被这个 task 占用了,这个可能还需要内部蓝牙的同事看一下;
2、你现在 task WDT 的时间设置多大?能否设大一些做下测试?
3、不能确认是否和你的擦写有关,要做排除的话,能否暂时先把这部分做空操作;另外,建议在连不上网络时,不要频繁的做擦写操作,毕竟 flash 是有一定的寿命的。

ttxs1002004
Posts: 13
Joined: Thu Apr 22, 2021 7:09 pm

Re: ESP32 STATION 正接AP时候发生了PANIC然后重启了

Postby ttxs1002004 » Sun Apr 25, 2021 2:41 pm

多谢回复!!

“1、你还是把发生 task WDT 和 crash 时的 backtrace 解析一下,可以获取一些 BTC task 内的情况,看为何 CPU0 都被这个 task 占用了,这个可能还需要内部蓝牙的同事看一下;”

是的,需要你们蓝牙的专家看下,为何BTC控制器这个任务会触发WDT?尽管只是作广播?是不是这个BTC协议栈有测试不很充分??

“2、你现在 task WDT 的时间设置多大?能否设大一些做下测试?”

默认的5秒WDT 超时,按照手册,IDLE有存储回收功能,如果设置太长会不会影响到API系统稳定??我看IDF 源代码,大量使用动态存储分配释放。如果IDLE超时太长,会否出现没有及时释放回收动态存储器,导致耗尽内存?
我倒是想设置为30秒(最大60秒),但是实际上我的TASK不可能连续工作30秒,API内部任务会否需要连续30秒占用CPU?
我的TASK主循环要么用select(500毫秒左右),要么在主循环有vTaskDealy,最忙的主循环也有用vTaskDelay(5) 5毫秒的,而且我的任务最高优先级为10,我看源代码蓝牙的任务优先级是19,那么我的TASK本身是不会抢占到BTC,那么会不会是我调用的某些API抢占了CPU,导致BTC Task Watchdog Timeout .我固件中代码频繁调用的API有ADC、UART2读(不是基于事件)、WIFI的连接和断开,分区表API.


“3、不能确认是否和你的擦写有关,要做排除的话,能否暂时先把这部分做空操作;另外,建议在连不上网络时,不要频繁的做擦写操作,毕竟 flash 是有一定的寿命的。”

我是数据采集终端,2秒钟1K数据,连不上网就暂存在本地,暂存满了就循环覆盖,产品是这么设计的。
这个我会跟产品沟通下,也许不循环覆盖了。
我用的模块是8M FLASH版本的 ESP32-WROOM-32E,没有外部RAM的。

ESP_Gargamel
Posts: 224
Joined: Wed Nov 14, 2018 8:45 am

Re: ESP32 STATION 正接AP时候发生了PANIC然后重启了

Postby ESP_Gargamel » Mon Apr 26, 2021 1:35 am

我看你第二次提供的 log 里有 [0;32mI (667) cpu_start: ESP-IDF: v4.2[0m,所以你当前使用的是 v4.2 的正式 release 版本?
针对 BTC task WDT 问题,我们在后继有相关修复,如你要验证,可拉取最新的 release/v4.3,在 commit b449909b 中有对此的修正;release/v4.2 上也有修正,但暂未同步到 github。

给你两个版本发布信息:
v4.2.1——计划在 4 月底 release
v4.3——计划在 5 月上旬 release

可在 github 留意一下 release 信息。

ttxs1002004
Posts: 13
Joined: Thu Apr 22, 2021 7:09 pm

Re: ESP32 STATION 正接AP时候发生了PANIC然后重启了

Postby ttxs1002004 » Mon Apr 26, 2021 10:54 pm

我实际用的应该是V4.3.

我的克隆如截图:
Screenshot_20210427_065214.png
Screenshot_20210427_065214.png (85.92 KiB) Viewed 933 times

ttxs1002004
Posts: 13
Joined: Thu Apr 22, 2021 7:09 pm

Re: ESP32 STATION 正接AP时候发生了PANIC然后重启了

Postby ttxs1002004 » Mon Apr 26, 2021 10:59 pm

用的是V4.3
Screenshot_20210427_065806.png
Screenshot_20210427_065806.png (12.76 KiB) Viewed 932 times

ttxs1002004
Posts: 13
Joined: Thu Apr 22, 2021 7:09 pm

Re: ESP32 STATION 正接AP时候发生了PANIC然后重启了

Postby ttxs1002004 » Tue Apr 27, 2021 2:07 am

ok!! will try it!
Screenshot_20210427_100517.png
Screenshot_20210427_100517.png (32.73 KiB) Viewed 926 times

ttxs1002004
Posts: 13
Joined: Thu Apr 22, 2021 7:09 pm

Re: ESP32 STATION 正接AP时候发生了PANIC然后重启了

Postby ttxs1002004 » Fri Apr 30, 2021 1:52 am

用的release.

v4.3最新版本
WIFI掉线后重新连接,始终不成功!!蓝牙也扫描不到设备了!!!
日志如下。

[0;33mW (09:42:52.599) BOBO_CONNECT: Wi-Fi disconnected,retry to connect to the AP,restart 1,[0m
W (58557027) wifi:m f probe req l=0

W (58557268) wifi:m f probe req l=0

W (58557511) wifi:m f probe req l=0

W (58557753) wifi:m f probe req l=0

W (58557995) wifi:m f probe req l=0

W (58558236) wifi:m f probe req l=0

W (58558479) wifi:m f probe req l=0

W (58558720) wifi:m f probe req l=0

W (58558961) wifi:m f probe req l=0

W (58559203) wifi:m f probe req l=0

W (58559928) wifi:m f probe req l=0

[0;33mW (09:42:55.743) BOBO_CONNECT: Wi-Fi disconnected,retry to connect to the AP,restart 2,[0m
W (58560171) wifi:m f probe req l=0

W (58560412) wifi:m f probe req l=0

W (58560654) wifi:m f probe req l=0

W (58560895) wifi:m f probe req l=0

W (58561137) wifi:m f probe req l=0

W (58561378) wifi:m f probe req l=0

W (58561619) wifi:m f probe req l=0

W (58561861) wifi:m f probe req l=0

W (58562102) wifi:m f probe req l=0

W (58562344) wifi:m f probe req l=0

W (58563068) wifi:m f probe req l=0

[0;33mW (09:42:58.883) BOBO_CONNECT: Wi-Fi disconnected,retry to connect to the AP,restart 3,[0m
W (58563310) wifi:m f probe req l=0

W (58563552) wifi:m f probe req l=0

W (58563794) wifi:m f probe req l=0

W (58564035) wifi:m f probe req l=0

W (58564277) wifi:m f probe req l=0

W (58564518) wifi:m f probe req l=0

W (58564760) wifi:m f probe req l=0

W (58565001) wifi:m f probe req l=0

W (58565242) wifi:m f probe req l=0

W (58565484) wifi:m f probe req l=0

W (58566208) wifi:m f probe req l=0

[0;33mW (09:43:02.024) BOBO_CONNECT: Wi-Fi disconnected,retry to connect to the AP,restart 4,[0m
W (58566452) wifi:m f probe req l=0

W (58566693) wifi:m f probe req l=0

W (58566935) wifi:m f probe req l=0

W (58567176) wifi:m f probe req l=0

W (58567417) wifi:m f probe req l=0

W (58567659) wifi:m f probe req l=0

W (58567901) wifi:m f probe req l=0

W (58568143) wifi:m f probe req l=0

W (58568384) wifi:m f probe req l=0

W (58568626) wifi:m f probe req l=0

W (58569350) wifi:m f probe req l=0

[0;33mW (09:43:05.166) BOBO_CONNECT: Wi-Fi disconnected,retry to connect to the AP,restart 5,[0m
W (58569593) wifi:m f probe req l=0

W (58569835) wifi:m f probe req l=0

W (58570076) wifi:m f probe req l=0

W (58570318) wifi:m f probe req l=0

W (58570559) wifi:m f probe req l=0

W (58570800) wifi:m f probe req l=0

W (58571042) wifi:m f probe req l=0

W (58571283) wifi:m f probe req l=0

W (58571525) wifi:m f probe req l=0

W (58571766) wifi:m f probe req l=0

[0;31mE (09:43:08.303) BOBO_CONNECT: Report BOBO_NET_MODULE WIFI Can't Successfully Connected AP![0m
[0;31mE (09:43:08.304) BOBO_NET_MODULE: Delay 20 Second to reconnect.[0m

ttxs1002004
Posts: 13
Joined: Thu Apr 22, 2021 7:09 pm

Re: ESP32 STATION 正接AP时候发生了PANIC然后重启了

Postby ttxs1002004 » Fri Apr 30, 2021 2:02 am

@ESP_Gargamel

重新上电后就好了。

重新上电后日志:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6968
load:0x40078000,len:14292
load:0x40080400,len:3688
entry 0x40080678
[0;32mI (27) boot: ESP-IDF v4.3-beta3-dirty 2nd stage bootloader[0m
[0;32mI (27) boot: compile time 18:50:10[0m
[0;32mI (27) boot: chip revision: 3[0m
[0;32mI (31) boot_comm: chip revision: 3, min. bootloader chip revision: 0[0m
[0;32mI (38) boot.esp32: SPI Speed : 40MHz[0m
[0;32mI (43) boot.esp32: SPI Mode : DIO[0m
[0;32mI (47) boot.esp32: SPI Flash Size : 8MB[0m
[0;32mI (52) boot: Enabling RNG early entropy source...[0m
[0;32mI (57) boot: Partition Table:[0m
[0;32mI (61) boot: ## Label Usage Type ST Offset Length[0m
[0;32mI (68) boot: 0 nvs WiFi data 01 02 00009000 00004000[0m
[0;32mI (76) boot: 1 otadata OTA data 01 00 0000d000 00002000[0m
[0;32mI (83) boot: 2 phy_init RF data 01 01 0000f000 00001000[0m
[0;32mI (90) boot: 3 factory factory app 00 00 00010000 00200000[0m
[0;32mI (98) boot: 4 ota0 OTA app 00 10 00210000 00200000[0m
[0;32mI (105) boot: 5 bobo_data WiFi data 01 02 00410000 003f0000[0m
[0;32mI (113) boot: End of partition table[0m
[0;32mI (117) boot: Defaulting to factory image[0m
[0;32mI (122) boot_comm: chip revision: 3, min. application chip revision: 0[0m
[0;32mI (129) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=3048ch (197772) map[0m
[0;32mI (212) esp_image: segment 1: paddr=000404b4 vaddr=3ffbdb60 size=05554h ( 21844) load[0m
[0;32mI (221) esp_image: segment 2: paddr=00045a10 vaddr=40080000 size=0a608h ( 42504) load[0m
[0;32mI (240) esp_image: segment 3: paddr=00050020 vaddr=400d0020 size=d817ch (885116) map[0m
[0;32mI (574) esp_image: segment 4: paddr=001281a4 vaddr=4008a608 size=14bf4h ( 84980) load[0m
[0;32mI (610) esp_image: segment 5: paddr=0013cda0 vaddr=50000000 size=00010h ( 16) load[0m
[0;32mI (627) boot: Loaded app from partition at offset 0x10000[0m
[0;32mI (627) boot: Disabling RNG early entropy source...[0m
[0;32mI (639) cpu_start: Pro cpu up.[0m
[0;32mI (639) cpu_start: Starting app cpu, entry point is 0x400814a8[0m
[0;32mI (0) cpu_start: App cpu up.[0m
[0;32mI (672) cpu_start: Pro cpu start user code[0m
[0;32mI (672) cpu_start: cpu freq: 160000000[0m
[0;32mI (672) cpu_start: Application information:[0m
[0;32mI (675) cpu_start: Project name: bobo_esp32[0m
[0;32mI (680) cpu_start: App version: 1.01[0m
[0;32mI (685) cpu_start: Compile time: Apr 27 2021 18:50:02[0m
[0;32mI (691) cpu_start: ELF file SHA256: 9971ccfe55e731f6...[0m
[0;32mI (697) cpu_start: ESP-IDF: v4.3-beta3-dirty[0m
[0;32mI (703) heap_init: Initializing. RAM available for dynamic allocation:[0m
[0;32mI (710) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM[0m
[0;32mI (716) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM[0m
[0;32mI (722) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM[0m
[0;32mI (728) heap_init: At 3FFD1FB8 len 0000E048 (56 KiB): DRAM[0m
[0;32mI (734) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM[0m
[0;32mI (740) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
[0;32mI (747) heap_init: At 4009F1FC len 00000E04 (3 KiB): IRAM[0m
[0;32mI (754) spi_flash: detected chip: generic[0m
[0;32mI (758) spi_flash: flash io: dio[0m
[0;32mI (763) cpu_start: Starting scheduler on PRO CPU.[0m
[0;32mI (0) cpu_start: Starting scheduler on APP CPU.[0m
I (826) wifi:wifi driver task: 3ffd7370, prio:23, stack:6656, core=0
[0;32mI (00:00:00.209) system_api: Base MAC address is not set[0m
[0;32mI (00:00:00.210) system_api: read default base MAC address from EFUSE[0m
I (838) wifi:wifi firmware version: 9bc0383
I (838) wifi:wifi certification version: v7.0
I (842) wifi:config NVS flash: enabled
I (846) wifi:config nano formating: disabled
I (850) wifi:Init data frame dynamic rx buffer num: 32
I (855) wifi:Init management frame dynamic rx buffer num: 32
I (860) wifi:Init management short buffer num: 32
I (865) wifi:Init dynamic tx buffer num: 32
I (869) wifi:Init static rx buffer size: 1600
I (873) wifi:Init static rx buffer num: 10
I (876) wifi:Init dynamic rx buffer num: 32
[0;32mI (00:00:00.264) wifi_init: rx ba win: 6[0m
[0;32mI (00:00:00.267) wifi_init: tcpip mbox: 32[0m
[0;32mI (00:00:00.272) wifi_init: udp mbox: 6[0m
[0;32mI (00:00:00.277) wifi_init: tcp mbox: 6[0m
[0;32mI (00:00:00.281) wifi_init: tcp tx win: 5744[0m
[0;32mI (00:00:00.286) wifi_init: tcp rx win: 5744[0m
[0;32mI (00:00:00.291) wifi_init: tcp mss: 1440[0m
[0;32mI (00:00:00.296) wifi_init: WiFi IRAM OP enabled[0m
[0;32mI (00:00:00.301) wifi_init: WiFi RX IRAM OP enabled[0m
[0;33mW (00:00:00.308) BOBO_MAIN_MANAGER: bobo_esp app started
[0m
[0;33mW (00:00:00.316) BOBO_MAIN_MANAGER: SSID is:HONGMINYONG-WORK, Password is: HHXX
[0m
[0;33mW (00:00:00.322) BOBO_MAIN_MANAGER: start bobo_net_module.[0m
[0;33mW (00:00:00.328) BOBO_NET_MODULE: bobo net module has started.
[0m
[0;33mW (00:00:00.335) BOBO_CONNECT: Connecting to SSID: HONGMINYONG-WORK ,Passord: HHXX .[0m
[0;32mI (00:00:00.344) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07[0m
[0;33mW (00:00:00.504) phy_init: saving new calibration data because of checksum failure, mode(0)[0m
[0;33mW (00:00:00.507) BOBO_MAIN_MANAGER: bobo_net_module has started.
[0m
I (1205) wifi:mode : sta (c4:dd:57:60:e6:24)
I (1205) wifi:enable tsf
[0;32mI (00:00:00.590) BOBO_CONNECT: Wi-Fi started, connect AP...[0m
[0;32mI (00:00:00.595) BTDM_INIT: BT controller compile version [a4c513b][0m
[0;32mI (00:00:00.909) BOBO_BT: REGISTER_APP_EVT, status 0, app_id 0
[0m
[0;33mW (1528) BT_BTM: BTM_BleWriteAdvData, Partial data write into ADV[0m
[0;33mW (1532) BT_BTM: BTM_BleWriteScanRsp, Partial data write into ADV[0m
[0;32mI (00:00:00.920) gpio: GPIO[0]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:00.923) BOBO_BT: CREATE_SERVICE_EVT, status 0, service_handle 40
[0m
[0;32mI (00:00:00.929) gpio: GPIO[4]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:00.946) gpio: GPIO[5]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:00.956) BOBO_BT: SERVICE_START_EVT, status 0, service_handle 40
[0m
[0;32mI (00:00:00.956) gpio: GPIO[14]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:00.974) BOBO_BT: ADD_CHAR_EVT, status 0, attr_handle 42, service_handle 40
[0m
[0;32mI (00:00:00.974) gpio: GPIO[18]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:00.992) gpio: GPIO[19]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:01.002) gpio: GPIO[25]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:01.013) gpio: GPIO[26]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:01.023) gpio: GPIO[27]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:01.033) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:01.043) gpio: GPIO[12]| InputEn: 1| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:01.053) gpio: GPIO[23]| InputEn: 1| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:01.063) gpio: GPIO[22]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:01.073) gpio: GPIO[21]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m
[0;32mI (00:00:01.083) gpio: GPIO[32]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 [0m
[0;33mW (00:00:01.105) RX8025T: Rx8025 Don't Exist in PCBA[0m
[0;32mI (00:00:01.106) BOBO_ADC: eFuse Two Point: NOT supported
[0m
[0;32mI (00:00:01.107) BOBO_ADC: eFuse Vref: Supported
[0m
[0;32mI (00:00:01.113) BOBO_ADC: Characterized using eFuse Vref
[0m
[0;32mI (00:00:01.119) BOBO_ADC: Start of Adc timer.
[0m
[0;32mI (17:35:44.000) BOBO_MAIN_TASK: Start Time is: [2037-10-01 17:35:44]

[0m
START_LIGHT_CONTROL!
LIGHT CONTROL FIRMWARE VERSION IS: 2

LIGHT CONTROL FIRMWARE KEY TIMEOUT IS: 3000

boot_id=0XBB000D6BB3880BC0

I (4236) wifi:new:<6,1>, old:<1,0>, ap:<255,255>, sta:<6,1>, prof:1
I (4994) wifi:state: init -> auth (b0)
I (4999) wifi:state: auth -> assoc (0)
I (5006) wifi:state: assoc -> run (10)
I (5020) wifi:connected with HONGMINYONG-WORK, aid = 2, channel 6, 40U, bssid = 08:10:78:1c:1d:6d
I (5021) wifi:security: WPA2-PSK, phy: bgn, rssi: -33
I (5024) wifi:pm start, type: 1

I (5030) wifi:AP's beacon interval = 102400 us, DTIM period = 1
[0;32mI (17:35:48.581) esp_netif_handlers: BOBO_CONNECT: sta ip: 192.168.0.4, mask: 255.255.255.0, gw: 192.168.0.1[0m
[0;32mI (17:35:48.583) BOBO_CONNECT: Got IPv4 event: Interface "BOBO_CONNECT: sta" address: 192.168.0.4[0m
[0;32mI (17:35:48.592) BOBO_CONNECT: Connected to BOBO_CONNECT: sta[0m
[0;32mI (17:35:48.598) BOBO_CONNECT: - IPv4 address: 192.168.0.4[0m
[0;31mE (17:35:48.604) BOBO_NET_MODULE: Restart TCP Client 1 for IP address changed.
[0m
W (6363) wifi:<ba-add>idx:0 (ifx:0, 08:10:78:1c:1d:6d), tid:0, ssn:0, winSize:64
[0;32mI (17:35:49.446) BOBO_TCP_CLIENT: DNS lookup succeeded.
[0m
[0;32mI (17:35:49.449) BOBO_TCP_CLIENT: Success connect to server.
[0m
[0;32mI (17:35:49.453) WIFI_CMD.C: wifi_cmd1

[0m
[0;32mI (17:35:49.663) WIFI_CMD.C: wifi_cmd8

[0m
[0;32mI (09:54:48.000) WIFI_CMD.C: [2021-04-30 09:54:48]: End of time config remote.

ESP_Gargamel
Posts: 224
Joined: Wed Nov 14, 2018 8:45 am

Re: ESP32 STATION 正接AP时候发生了PANIC然后重启了

Postby ESP_Gargamel » Fri Apr 30, 2021 9:46 am

用 v4.3-beta3 的 blufi 试了下,设了个错误的 ssid 和 password,没遇到。能否提供一个可复现问题的小 sample?以及测试复现流程。

Who is online

Users browsing this forum: No registered users and 3 guests