我的代码是基于SDK1.2.0编译的,还打了最新的patch。代码的逻辑是如果没有记录AP信息就自动开启Smartconfig,如果有记录AP信息则自动连接到相应的AP,我的客户端是用Airkiss协议的。当连接到AP成功后将自动通过一个UDP端口向服务器发送登录信息(24bytes),如果是通过Smartconfig连接成功(AP信息已被记录)的时候在调用espconn_sent时有可能会发生Fatal exception(9)错误并重启,如果通过记录的AP信息进行连接的话不论怎么也不会发生错误。重新烧录或清除AP记录信息后测试会产生这问题的机率挺高的,40%以上,但是我找不到什么合理的逻辑,只知道把调用espconn_sent那句注释了就一定没问题。可能是Smartconfig库对内存的使用有问题?希望能有人给个指引方向,谢谢!
附上错误打印信息和s文件部分信息:
Fatal exception (9):
epc1=0x4010532b, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000007, depc=0x00000000
UDPSend.h
typedef struct _SendInfo{
volatile unsigned int iValid;
volatile unsigned int iValidTime;
struct espconn *iConn;
SOCKIP iRemoteIP;
int iRemotePort;
int iLength;
char iBuffer[512];
}SendInfo;
user1.1024.new.2.S:
int sendTo(SendInfo *aInfo){
4010531c: f0c112 addi a1, a1, -16
4010531f: 21c9 s32i.n a12, a1, 8
40105321: 3109 s32i.n a0, a1, 12
40105323: 02cd mov.n a12, a2
if (aInfo && aInfo->iConn && aInfo->iConn->proto.udp){
40105325: b2ac beqz.n a2, 40105354 <sendTo+0x38>
40105327: 2228 l32i.n a2, a2, 8
40105329: 72ac beqz.n a2, 40105354 <sendTo+0x38>
4010532b: 2258 l32i.n a5, a2, 8
espconn_sent(aInfo->iConn, (unsigned char *)aInfo->iBuffer, (unsigned short)aInfo->iLength);
return aInfo->iLength;
}
return false;
4010532d: 020c movi.n a2, 0
}
}
}
int sendTo(SendInfo *aInfo){
if (aInfo && aInfo->iConn && aInfo->iConn->proto.udp){
4010532f: 211527 beq a5, a2, 40105354 <sendTo+0x38>
os_memcpy(aInfo->iConn->proto.udp->remote_ip, &aInfo->iRemoteIP, 4);
40105332: 3ccb addi.n a3, a12, 12
40105334: 440c movi.n a4, 4
40105336: 25cb addi.n a2, a5, 12
40105338: ec6601 l32r a0, 401004d0 <call_user_start_local+0x298>
4010533b: 0000c0 callx0 a0
aInfo->iConn->proto.udp->remote_port = aInfo->iRemotePort;
4010533e: 2c28 l32i.n a2, a12, 8
40105340: 4c58 l32i.n a5, a12, 16
40105342: 2238 l32i.n a3, a2, 8
espconn_sent(aInfo->iConn, (unsigned char *)aInfo->iBuffer, (unsigned short)aInfo->iLength);
40105344: 0a1c42 l16ui a4, a12, 20
int sendTo(SendInfo *aInfo){
if (aInfo && aInfo->iConn && aInfo->iConn->proto.udp){
os_memcpy(aInfo->iConn->proto.udp->remote_ip, &aInfo->iRemoteIP, 4);
aInfo->iConn->proto.udp->remote_port = aInfo->iRemotePort;
40105347: 0359 s32i.n a5, a3, 0
espconn_sent(aInfo->iConn, (unsigned char *)aInfo->iBuffer, (unsigned short)aInfo->iLength);
40105349: 18cc32 addi a3, a12, 24
4010534c: fff301 l32r a0, 40105318 <isUDPInited+0xc>
4010534f: 0000c0 callx0 a0
return aInfo->iLength;
40105352: 5c28 l32i.n a2, a12, 20
}
return false;
}
Fatal exception (9)
Re: Fatal exception (9)
Postby ESP_Faye » Mon Aug 03, 2015 10:24 am
您好,
您可以参考帖子 viewtopic.php?f=61&t=292
在 eagle.S 中查找您出错的地址,对应的是哪个函数。添加 log,进一步查证问题原因。
如果您的问题仍未解决,可以提供您的测试代码,我们将协助您一同查证。
您可以参考帖子 viewtopic.php?f=61&t=292
在 eagle.S 中查找您出错的地址,对应的是哪个函数。添加 log,进一步查证问题原因。
如果您的问题仍未解决,可以提供您的测试代码,我们将协助您一同查证。
Who is online
Users browsing this forum: No registered users and 28 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.