Open createskyblue opened 7 months ago
Seems not an Arduino project. This github is for issues with Arduino
Seems not an Arduino project. This github is for issues with Arduino
It's the Arduino project. But the location of the crash should not be in my code
road road road road road road road road road road road road road road road road road
child node . . . . . . .child node . . . . . . . .root node . . . . . .child node. . . . . . .child node
road road road road road road road road road road road road road road road road road
Test environment, compare the distance between each node to the limit. I issue test instructions through the serial port at the root node in the middle, Painless_ Mesh will help me broadcast the instructions of the serial port to all child nodes. Under extreme relay distance, it is easy for the root node to crash after receiving replies from several child nodes. But if transferred to indoor testing, there are no issues with the test and it runs well, so I suspect that the triggering of the problem is related to WiFi extreme distance communication
you used an external library and provided no code that can help to reproduce. Can hardly help here...
you used an external library and provided no code that can help to reproduce. Can hardly help here...
I will organize the code later and separate the minimum reproduction code from the business. Because some of the current code does not belong to me personally 😢
your memory get's corrupted. We do not need your whole project, just the camera initialization code and configuration, so we could check if it could be anything on our end. Just the info above is way not enough to come to any conclusion.
your memory get's corrupted. We do not need your whole project, just the camera initialization code and configuration, so we could check if it could be anything on our end. Just the info above is way not enough to come to any conclusion.
There is no camera used in the project, only the wifi STA+AP function is used, and in the pianless mesh, there should only be a TCP connection opened. I also noticed that the automatic reset after the crash trigger will trigger a new crash during the initial mesh (the crash report above occurs in chronological order).
Will my application happen to damage the memory of the 'sys_evt' thread here? However, if each node is close together, there will be no problem, so I guess it shouldn't be a problem with some of my own code, maybe?
I will organize the relevant code as soon as possible. (About 12 hours later?)
setLogLevel: ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE |
Guru Meditation Error: Core 0 panic'ed (Unhandled debug exception).
Debug exception reason: Stack canary watchpoint triggered (sys_evt)
Core 0 register dump:
PC : 0x40092903 PS : 0x00060536 A0 : 0x800911c0 A1 : 0x3ffb4e50
A2 : 0x3ffbf5f8 A3 : 0xb33fffff A4 : 0x0000abab A5 : 0x00060523
A6 : 0x00060523 A7 : 0x0000cdcd A8 : 0x0000abab A9 : 0xffffffff
A10 : 0x3ffbdc6c A11 : 0x3ffc5f00 A12 : 0x3ffc1a0c A13 : 0x3ffc1b34
A14 : 0x007bf5f8 A15 : 0x003fffff SAR : 0x00000004 EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000 LBEG : 0x4008b994 LEND : 0x4008b9aa LCOUNT : 0xffffffff
Backtrace: 0x40092900:0x3ffb4e50 0x400911bd:0x3ffb4e90 0x4008f67c:0x3ffb4ec0 0x4008f62c:0xa5a5a5a5 |<-CORRUPTED
#0 0x40092900:0x3ffb4e50 in compare_and_set_native at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/compare_set.h:25
(inlined by) spinlock_acquire at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/spinlock.h:103
(inlined by) xPortEnterCriticalTimeout at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/port.c:301
#1 0x400911bd:0x3ffb4e90 in vPortEnterCritical at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/include/freertos/portmacro.h:578
(inlined by) vTaskSwitchContext at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/tasks.c:3458
#2 0x4008f67c:0x3ffb4ec0 in _frxt_dispatch at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/portasm.S:436
#3 0x4008f62c:0xa5a5a5a5 in _frxt_int_exit at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/portasm.S:231
setLogLevel: ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE |
Guru Meditation Error: Core 0 panic'ed (Unhandled debug exception).
Debug exception reason: Stack canary watchpoint triggered (sys_evt)
Core 0 register dump:
PC : 0x40092903 PS : 0x00060936 A0 : 0x800911c0 A1 : 0x3ffb4970
A2 : 0x3ffbf5f8 A3 : 0xb33fffff A4 : 0x0000abab A5 : 0x00060923
A6 : 0x00060923 A7 : 0x0000cdcd A8 : 0xb33fffff A9 : 0xffffffff
A10 : 0x3ffbdc6c A11 : 0x3ffc5f00 A12 : 0x3ffc1a0c A13 : 0x3ffc1b34
A14 : 0x007bf5f8 A15 : 0x003fffff SAR : 0x00000004 EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000 LBEG : 0x4008b994 LEND : 0x4008b9aa LCOUNT : 0xffffffff
Backtrace: 0x40092900:0x3ffb4970 0x400911bd:0x3ffb49b0 0x4008f67c:0x3ffb49e0 0x4008f62c:0xa5a5a5a5 |<-CORRUPTED
#0 0x40092900:0x3ffb4970 in compare_and_set_native at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/compare_set.h:25
(inlined by) spinlock_acquire at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/spinlock.h:103
(inlined by) xPortEnterCriticalTimeout at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/port.c:301
#1 0x400911bd:0x3ffb49b0 in vPortEnterCritical at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/include/freertos/portmacro.h:578
(inlined by) vTaskSwitchContext at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/tasks.c:3458
#2 0x4008f67c:0x3ffb49e0 in _frxt_dispatch at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/portasm.S:436
#3 0x4008f62c:0xa5a5a5a5 in _frxt_int_exit at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/portasm.S:231
setLogLevel: ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE |
Guru Meditation Error: Core 0 panic'ed (Unhandled debug exception).
Debug exception reason: Stack canary watchpoint triggered (sys_evt)
Core 0 register dump:
PC : 0x40092903 PS : 0x00060336 A0 : 0x800911c0 A1 : 0x3ffb4970
A2 : 0x3ffbf5f8 A3 : 0xb33fffff A4 : 0x0000abab A5 : 0x00060323
A6 : 0x00060323 A7 : 0x0000cdcd A8 : 0xb33fffff A9 : 0xffffffff
A10 : 0x3ffbdc6c A11 : 0x3ffc5f00 A12 : 0x3ffc1a0c A13 : 0x3ffc1b34
A14 : 0x007bf5f8 A15 : 0x003fffff SAR : 0x00000004 EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000 LBEG : 0x4008b994 LEND : 0x4008b9aa LCOUNT : 0xffffffff
Backtrace: 0x40092900:0x3ffb4970 0x400911bd:0x3ffb49b0 0x4008f67c:0x3ffb49e0 0x4008f62c:0xa5a5a5a5 |<-CORRUPTED
#0 0x40092900:0x3ffb4970 in compare_and_set_native at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/compare_set.h:25
(inlined by) spinlock_acquire at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/spinlock.h:103
(inlined by) xPortEnterCriticalTimeout at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/port.c:301
#1 0x400911bd:0x3ffb49b0 in vPortEnterCritical at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/include/freertos/portmacro.h:578
(inlined by) vTaskSwitchContext at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/tasks.c:3458
#2 0x4008f67c:0x3ffb49e0 in _frxt_dispatch at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/portasm.S:436
#3 0x4008f62c:0xa5a5a5a5 in _frxt_int_exit at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/portasm.S:231
Crashes seem to occur more easily on the esp32-V3-02 when using the following log redirection code. 崩溃似乎容易发生在esp32-V3-02 中使用下面的日志重定向代码
#ifdef USE_UDP_LOG
#define UDP_LOG_BUF_SIZE (512)
QueueHandle_t UDP_queue = xQueueCreate(UDP_LOG_BUF_SIZE, sizeof(String));
//写一个网络任务,负责UDP广播数据,在端口1024,使用消息队列获取要发送的数据,arduino esp32
void UDP_task(void *pvParameters){
// uint8_t* buf_tmp = (uint8_t*)malloc(UDP_LOG_BUF_SIZE); //会引发崩溃,不知道为啥
uint8_t buf_tmp[UDP_LOG_BUF_SIZE];
//创建UDP对象
AsyncUDP udp;
uint64_t send_buf_invalid_timer = millis();
while(1){
//检查消息队列
char msg;
//检查队列长度,大于32字节发一次
if(uxQueueMessagesWaiting(UDP_queue) > UDP_LOG_BUF_SIZE / 2 || millis() - send_buf_invalid_timer > 1000){
uint32_t len = uxQueueMessagesWaiting(UDP_queue);
if (len > UDP_LOG_BUF_SIZE) len = UDP_LOG_BUF_SIZE;
if (len) {
//从缓冲区取特定个数数据
for (size_t i = 0; i < len; i++)
xQueueReceive(UDP_queue, buf_tmp + i, 0);
//发送广播
udp.broadcastTo(buf_tmp, len, DEFAULT_LOG_UDP_BROADCAST_PORT);
}
send_buf_invalid_timer = millis();
}else vTaskDelay(10 / portTICK_PERIOD_MS);
}
}
// Custom log output function
static int custom_log_output(const char* format, va_list args) {
// Your custom log implementation here
char buffer[512];
int len = vsnprintf(buffer, sizeof(buffer), format, args);
for (int i = 0; i < len; i++) {
xQueueSend(UDP_queue, &buffer[i], 0);
}
return len;
}
#endif
Here is my PlatformIO configuration. 下面是我的platformIO的配置
[env:pico32_V3_02]
platform = espressif32
board = denky_d4
framework = arduino
build_flags =
-D MALLOC=malloc
-D REALLOC=realloc
-D CORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE
-D CONFIG_COMPILER_OPTIMIZATION_SIZE=y
-D CONFIG_ARDUHAL_LOG_COLORS=1
-D BOARD_HAS_PSRAM
-mfix-esp32-psram-cache-issue
-D CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y
-D RELAY_REVERSAL=0
-D RELAY_OUTPUT_PIN=27
-D PWM_OUTPUT_PIN=26
-D RADAR_INPUT_PIN=25
-D HEART_LED_OUTPUT_PIN=2
-D AUX_INPUT_PIN=35
-D RF_M0_OUTPUT_PIN=19
-D RF_M1_OUTPUT_PIN=5
-D UART1_ENABLE
-D UART1_TX_PIN=7
-D UART1_RX_PIN=8
-D UART2_ENABLE
-D UART2_TX_PIN=32
-D UART2_RX_PIN=33
-D POWER_VOL_ADC=39
; -D USE_UDP_LOG
-DUSE_ESP_IDF_LOG -DLOG_LOCAL_LEVEL=5 -DTAG="\"ARDUINO\"" -DCONFIG_LOG_COLORS
; -D USE_UDP_LOG
build_type = debug
monitor_filters = esp32_exception_decoder
debug_tool = jlink
debug_speed = 7500
board_build.partitions = app_0x160000_spiffs_0x510000_8MB.csv
upload_speed = 921600
monitor_speed = 921600
The approximate cause of the crash is that I connected to the AP opened by Esp32. When the issue occurs, it must be temporarily resolved by power cycling. Otherwise, there is a probability of triggering this problem each time I connect to the AP, and it may not necessarily be the same triggering method mentioned earlier. The same code runs well on ESP32-C3, which is confusing to me. If I discover a more effective triggering method, I will continue to report it.
崩溃大致触发的原因是我连接了Esp32开启的AP,当问题触发后必须要通过断电复位才能暂时摆脱问题,否则每次连接AP的时候就有概率触发这个问题,不一定是前面提到的触发方式 相同的代码在ESP32-C3中运行良好,这让我感到很困惑 如果我发现更有效的触发方式,我将继续报告
Board
ESP32 PICO V3-02
Device Description
On the self-made development board
Hardware Configuration
In esp32 pico v3-02, the SD0 and SD1 pins should be available to users. After reading the data sheet, it should not be connected to flash or psram. Please ignore the warning label in the schematic diagram above.
Version
latest master (checkout manually)
IDE Name
PlatfornIO
Operating System
Windows 10
Flash frequency
80MHz
PSRAM enabled
yes
Upload speed
921600
Description
Using Painless_ Mesh 1.5.0 library for Mesh networking experiments, while using serial port 0 to send and receive instructions. It has been found that when running the same code with different configuration files, the child nodes and main nodes are physically far away, it is easy to crash. But if the nodes are relatively close, the crash described below will not occur for a long time. Currently, we have not further identified the specific location of the error
使用Painless_Mesh-1.5.0库进行Mesh组网实验,同时使用串口0收发指令。发现当运行相同代码,不同配置文件的子节点和主节点物理较远的时候,容易发生崩溃。但是如果节点们比较近,则长时间都不会发生下面描述的崩溃。暂时没有进一步定位到错误的具体位置
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide