运行很长时间后,待机中发生assert failed: get_cached_log_level log.c:220
Posted: Tue Sep 12, 2023 6:04 am
开发板ESP32程序有BLE和Wifi两个模块,运行半天和一个晚上,第二天早上发现夜间程序被自动重启过,日志显示assert failed: get_cached_log_level log.c:220
Assert发生的时候只有Wifi在通信(BLE应该是待机中),Wifi它是每隔15秒会上传9个指节的心跳数据给AWS。
我上网搜寻一下这个问题,发现和之前https://esp32.com/viewtopic.php?t=19165提出的是一样的。
我也想知道为什么平时怎么测试都很难甚至不能复现,待机中却会发生的这个问题的原因是什么?
谢谢!
环境是ESP-IDF v4.4.3
大部分日志输出是INFO level,有一些个别或底层代码是DEBUG level(例如esp_ssl_tls.c:288里面的 ESP_LOGD(TAG, "fail, error=%d", -ret);
).
在Component config → AWS OTA → Logging 有Error和Warning及Info被选中;
Component config → coreMQTT → Logging仅有Info被选中 ;
Component config → Bluetooth → NimBLE Options → NimBLE Host log verbosity仅有Info被选中
下面是串口输出的信息:
I (18602101) UART: recv uart start len 8.
I (18602421) MQTT_PAYLOAD: payload_pack cmd: 00 ,len:1,val:01
I (18602421) MQTT_TASK: mqtt publish topic daye/iot/device/pt22020000/083a8d2c2a30/response.
I (18619026) mcu_proc: sendHeartbeat sendHeartbeat start.
I (18619026) mcu_proc: sendHeartbeat sendHeartbeat end.
I (18619091) UART: recv uart start len 8.
I (18619281) MQTT_PAYLOAD: payload_pack cmd: 00 ,len:1,val:01
I (18619281) MQTT_TASK: mqtt publish topic daye/iot/device/pt22020000/083a8d2c2a30/response.
I (18636026) mcu_proc: sendHeartbeat sendHeartbeat start.
I (18636026) mcu_proc: sendHeartbeat sendHeartbeat end.
I (18636086) UART: recv uart start len 8.
I (18636131) MQTT_PAYLOAD: payload_pack cmd: 00 ,len:1,val:01
I (18636131) MQTT_TASK: mqtt publish topic daye/iot/device/pt22020000/083a8d2c2a30/response.
assert failed: get_cached_log_level log.c:220 (i == 0 || s_log_cache[(i - 1) / 2].generation < s_log_cache.generation)
Backtrace: 0x400823b9:0x3fffb0d0 0x40096275:0x3fffb0f0 0x4009d345:0x3fffb110 0x401afb86:0x3fffb230 0x401afdf2:0x3fffb250 0x4009d0bf:0x3fffb280 0x40145317:0x3fffb2d0 0x401410c3:0x3fffb330 0x4013b1d1:0x3fffb360 0x400e3c8b:0x3fffb380 0x400ed8bc:0x3fffb3a0 0x400ec4fe:0x3fffb3c0 0x400ec59f:0x3fffb3f0 0x400e1806:0x3fffb410 0x400e06a0:0x3fffb430 0x4009aaa1:0x3fffb460
0x400823b9: panic_abort at /home/niuyq/daye_dev/dayefw2/esp-idf/components/esp_system/panic.c:402
0x40096275: esp_system_abort at /home/niuyq/daye_dev/dayefw2/esp-idf/components/esp_system/esp_system.c:128
0x4009d345: __assert_func at /home/niuyq/daye_dev/dayefw2/esp-idf/components/newlib/assert.c:85
0x401afb86: get_cached_log_level at /home/niuyq/daye_dev/dayefw2/esp-idf/components/log/log.c:220
(inlined by) s_log_level_get_and_unlock at /home/niuyq/daye_dev/dayefw2/esp-idf/components/log/log.c:153
0x401afdf2: esp_log_writev at /home/niuyq/daye_dev/dayefw2/esp-idf/components/log/log.c:195
0x4009d0bf: esp_log_write at /home/niuyq/daye_dev/dayefw2/esp-idf/components/log/log.c:210
0x40145317: esp_mbedtls_add_rx_buffer at /home/niuyq/daye_dev/dayefw2/esp-idf/components/mbedtls/port/dynamic/esp_mbedtls_dynamic_impl.c:394 (discriminator 12)
0x401410c3: __wrap_mbedtls_ssl_read at /home/niuyq/daye_dev/dayefw2/esp-idf/components/mbedtls/port/dynamic/esp_ssl_tls.c:211
0x4013b1d1: esp_mbedtls_read at /home/niuyq/daye_dev/dayefw2/esp-idf/components/esp-tls/esp_tls_mbedtls.c:206
0x400e3c8b: esp_tls_conn_read at /home/niuyq/daye_dev/dayefw2/esp-idf/components/esp-tls/esp_tls.h:496
(inlined by) espTlsTransportRecv at /home/niuyq/daye_dev/dayefw2/Application/libraries/coreHTTP/port/network_transport/network_transport.c:107
0x400ed8bc: MQTT_GetIncomingPacketTypeAndLength at /home/niuyq/daye_dev/dayefw2/Application/libraries/coreMQTT/coreMQTT/source/core_mqtt_serializer.c:2359
0x400ec4fe: receiveSingleIteration at /home/niuyq/daye_dev/dayefw2/Application/libraries/coreMQTT/coreMQTT/source/core_mqtt.c:1307
0x400ec59f: MQTT_ProcessLoop at /home/niuyq/daye_dev/dayefw2/Application/libraries/coreMQTT/coreMQTT/source/core_mqtt.c:2195
0x400e1806: mqtt_impl_loop at /home/niuyq/daye_dev/dayefw2/Application/components/aws_iot/src/mqtt_impl.c:225
0x400e06a0: task at /home/niuyq/daye_dev/dayefw2/Application/components/aws_iot/src/mqtt_task.c:168
0x4009aaa1: vPortTaskWrapper at /home/niuyq/daye_dev/dayefw2/esp-idf/components/freertos/port/xtensa/port.c:131
ELF file SHA256: bd2795b2219fd188
Rebooting...
ets Jul 29 2019 12:21:46
rst:0xc (SW_CPU_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:6660
load:0x40078000,len:14944
Assert发生的时候只有Wifi在通信(BLE应该是待机中),Wifi它是每隔15秒会上传9个指节的心跳数据给AWS。
我上网搜寻一下这个问题,发现和之前https://esp32.com/viewtopic.php?t=19165提出的是一样的。
我也想知道为什么平时怎么测试都很难甚至不能复现,待机中却会发生的这个问题的原因是什么?
谢谢!
环境是ESP-IDF v4.4.3
大部分日志输出是INFO level,有一些个别或底层代码是DEBUG level(例如esp_ssl_tls.c:288里面的 ESP_LOGD(TAG, "fail, error=%d", -ret);
).
在Component config → AWS OTA → Logging 有Error和Warning及Info被选中;
Component config → coreMQTT → Logging仅有Info被选中 ;
Component config → Bluetooth → NimBLE Options → NimBLE Host log verbosity仅有Info被选中
下面是串口输出的信息:
I (18602101) UART: recv uart start len 8.
I (18602421) MQTT_PAYLOAD: payload_pack cmd: 00 ,len:1,val:01
I (18602421) MQTT_TASK: mqtt publish topic daye/iot/device/pt22020000/083a8d2c2a30/response.
I (18619026) mcu_proc: sendHeartbeat sendHeartbeat start.
I (18619026) mcu_proc: sendHeartbeat sendHeartbeat end.
I (18619091) UART: recv uart start len 8.
I (18619281) MQTT_PAYLOAD: payload_pack cmd: 00 ,len:1,val:01
I (18619281) MQTT_TASK: mqtt publish topic daye/iot/device/pt22020000/083a8d2c2a30/response.
I (18636026) mcu_proc: sendHeartbeat sendHeartbeat start.
I (18636026) mcu_proc: sendHeartbeat sendHeartbeat end.
I (18636086) UART: recv uart start len 8.
I (18636131) MQTT_PAYLOAD: payload_pack cmd: 00 ,len:1,val:01
I (18636131) MQTT_TASK: mqtt publish topic daye/iot/device/pt22020000/083a8d2c2a30/response.
assert failed: get_cached_log_level log.c:220 (i == 0 || s_log_cache[(i - 1) / 2].generation < s_log_cache.generation)
Backtrace: 0x400823b9:0x3fffb0d0 0x40096275:0x3fffb0f0 0x4009d345:0x3fffb110 0x401afb86:0x3fffb230 0x401afdf2:0x3fffb250 0x4009d0bf:0x3fffb280 0x40145317:0x3fffb2d0 0x401410c3:0x3fffb330 0x4013b1d1:0x3fffb360 0x400e3c8b:0x3fffb380 0x400ed8bc:0x3fffb3a0 0x400ec4fe:0x3fffb3c0 0x400ec59f:0x3fffb3f0 0x400e1806:0x3fffb410 0x400e06a0:0x3fffb430 0x4009aaa1:0x3fffb460
0x400823b9: panic_abort at /home/niuyq/daye_dev/dayefw2/esp-idf/components/esp_system/panic.c:402
0x40096275: esp_system_abort at /home/niuyq/daye_dev/dayefw2/esp-idf/components/esp_system/esp_system.c:128
0x4009d345: __assert_func at /home/niuyq/daye_dev/dayefw2/esp-idf/components/newlib/assert.c:85
0x401afb86: get_cached_log_level at /home/niuyq/daye_dev/dayefw2/esp-idf/components/log/log.c:220
(inlined by) s_log_level_get_and_unlock at /home/niuyq/daye_dev/dayefw2/esp-idf/components/log/log.c:153
0x401afdf2: esp_log_writev at /home/niuyq/daye_dev/dayefw2/esp-idf/components/log/log.c:195
0x4009d0bf: esp_log_write at /home/niuyq/daye_dev/dayefw2/esp-idf/components/log/log.c:210
0x40145317: esp_mbedtls_add_rx_buffer at /home/niuyq/daye_dev/dayefw2/esp-idf/components/mbedtls/port/dynamic/esp_mbedtls_dynamic_impl.c:394 (discriminator 12)
0x401410c3: __wrap_mbedtls_ssl_read at /home/niuyq/daye_dev/dayefw2/esp-idf/components/mbedtls/port/dynamic/esp_ssl_tls.c:211
0x4013b1d1: esp_mbedtls_read at /home/niuyq/daye_dev/dayefw2/esp-idf/components/esp-tls/esp_tls_mbedtls.c:206
0x400e3c8b: esp_tls_conn_read at /home/niuyq/daye_dev/dayefw2/esp-idf/components/esp-tls/esp_tls.h:496
(inlined by) espTlsTransportRecv at /home/niuyq/daye_dev/dayefw2/Application/libraries/coreHTTP/port/network_transport/network_transport.c:107
0x400ed8bc: MQTT_GetIncomingPacketTypeAndLength at /home/niuyq/daye_dev/dayefw2/Application/libraries/coreMQTT/coreMQTT/source/core_mqtt_serializer.c:2359
0x400ec4fe: receiveSingleIteration at /home/niuyq/daye_dev/dayefw2/Application/libraries/coreMQTT/coreMQTT/source/core_mqtt.c:1307
0x400ec59f: MQTT_ProcessLoop at /home/niuyq/daye_dev/dayefw2/Application/libraries/coreMQTT/coreMQTT/source/core_mqtt.c:2195
0x400e1806: mqtt_impl_loop at /home/niuyq/daye_dev/dayefw2/Application/components/aws_iot/src/mqtt_impl.c:225
0x400e06a0: task at /home/niuyq/daye_dev/dayefw2/Application/components/aws_iot/src/mqtt_task.c:168
0x4009aaa1: vPortTaskWrapper at /home/niuyq/daye_dev/dayefw2/esp-idf/components/freertos/port/xtensa/port.c:131
ELF file SHA256: bd2795b2219fd188
Rebooting...
ets Jul 29 2019 12:21:46
rst:0xc (SW_CPU_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:6660
load:0x40078000,len:14944