ESP32 无限重启的2种情况 - “Stack protection fault“ & “stack overflow in task main“

问题描述

一次ESP32的项目中,连接wifi后,通过API获取数据,但每次刚连接wifi后,ESP32就直接重启了,日志报告如下:
在这里插入图片描述
关键是:

Guru Meditation Error: Core  0 panic'ed (Stack protection fault). 

Detected in task "main" at 0x420107b6
0x420107b6: hefeng_get at C:/Users/chuan/Desktop/DesktopPanel_42_V1.2_20240331/components/net_api/weather.c:384

Stack pointer: 0x3fca3e40
Stack bounds: 0x3fca3f0c - 0x3fca5100

Core  0 register dump:...

关键信息是第一行,Guru Meditation Error: Core 0 panic’ed (Stack protection fault).
查看官方说明:

Guru Meditation Error: Core 0 panic'ed (Stack protection fault). Detected in task "CurrentSensorTa" at 0x400d4624 --- 0x400d4624: _svfprintf_r at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/vfprintf.c:654 Stack pointer: 0x4ff98570 Stack bounds: 0x4ff9857c - 0x4ff994f0 Core 0 register dump: MEPC : 0x400d4636 RA : 0x400cba80 SP : 0x4ff98570 GP : 0x4ff18e00 --- 0x400d4636: _svfprintf_r at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/vfprintf.c:654 --- 0x400cba80: snprintf at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/snprintf.c:87 TP : 0x4ff994d0 T0 : 0x4008e02c T1 : 0x0000000f T2 : 0xffffffff --- 0x4008e02c: vfs_fat_stat at D:/ESP/esp-idf/v5.5.1/esp-idf/components/fatfs/vfs/vfs_fat.c:757 S0/FP : 0x00000403 S1 : 0x4010a570 A0 : 0x4ff99558 A1 : 0x4ff98a08 A2 : 0x4010a570 A3 : 0x4ff98a8c A4 : 0x00000000 A5 : 0x00000402 A6 : 0x00000010 A7 : 0x0000000a S2 : 0xffffffff S3 : 0x00000000 S4 : 0x4ff98acc S5 : 0x00000001 S6 : 0x00000000 S7 : 0x00000000 S8 : 0x4ff99660 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000 T3 : 0x00000000 T4 : 0x00002543 T5 : 0x0000d800 T6 : 0x045b9800 MSTATUS : 0x00011880 MTVEC : 0x4ff00003 MCAUSE : 0x0000001b MTVAL : 0x00000000 --- 0x4ff00003: _vector_table at ??:? MHARTID : 0x00000000 Backtrace: 0x400d4636:0x4ff98570 --- 0x400d4636: _svfprintf_r at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/vfprintf.c:654
最新发布
12-21
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值