Coder Social home page Coder Social logo

eg-cloud's Introduction

eg-cloud

eg-cloud mtk4.5

eg-cloud's People

Contributors

jzxiecll avatar

Watchers

 avatar

eg-cloud's Issues

测试thread启动后出现free mem crash的原因

是由于在启动send thread的时候先清除发送队列中的packet的时候用了msg packet type导致的,我们在dev snap到队列中的时候入队的类型是dev packet type

for(i = 0; i < packetCount; i++)
{
EG_MSG_Packet *pDevice2CloudPacket = NULL;
if (EG_queue_recv(EG_msg_queue_get(EG_CLOUD_MSG_OUT), &pDevice2CloudPacket, EG_msec_to_ticks(1000)) == EG_SUCCESS)
{
EG_msg_packet_free(pDevice2CloudPacket);
}
}

改变为

for(i = 0; i < packetCount; i++)
{
EG_DEV_Packet *pDevice2CloudPacket = NULL;
if (EG_queue_recv(EG_msg_queue_get(EG_CLOUD_MSG_OUT), &pDevice2CloudPacket, EG_msec_to_ticks(1000)) == EG_SUCCESS)
{
EG_device_packet_free(pDevice2CloudPacket);
}
}

lwip crash 原因

  1. 初步猜测可能是由于MQTTClient 的timeout时间设置为3秒(由于时钟不准)可能太短,可以将其设置到4秒后测试效果
  2. 就是由于mqtt send thread for循环设置的上报间隔太短导致的,可以将间隔调大到500ms上报一次数据测试效果

lwip 出现bus default 导致crash(v4.5.200)

[20:43:26]In Bus Fault Handler
[20:43:26]SCB->CFSR = 0x00008200
[20:43:26]Bus fault: A precise data access error has occurred @x42b108ae
[20:43:26]SCB->BFAR = 0x42b108ae

[20:43:26]r0 = 0x00000001
[20:43:26]r1 = 0x00000002
[20:43:26]r2 = 0x20001050
[20:43:26]r3 = 0x0000e9d7
[20:43:26]r4 = 0x2000211c
[20:43:26]r5 = 0x42b1089a
[20:43:26]r6 = 0x00000001
[20:43:26]r7 = 0x00000000
[20:43:26]r8 = 0x20002324
[20:43:26]r9 = 0x00000040
[20:43:26]r10 = 0x0000e9d7
[20:43:26]r11 = 0x00000006
[20:43:26]r12 = 0x0010326c
[20:43:26]lr = 0x10087781
[20:43:26]pc = 0x1007eeba
[20:43:26]psr = 0x21000000
[20:43:26]EXC_RET = 0xfffffffd
[20:43:26]CONTROL = 0x00000002
[20:43:26]MSP = 0x2003fbe0
[20:43:26]PSP = 0x2000a658
[20:43:26]sp = 0x2000a658

crash分析result
== the analysis report for reference only,and specific problem please contact SS ==

== exception report ==
exception type:Bus fault: A precise data access error has occurred @x42b108ae
BFAR has valid contents.SCB->BFAR = 0x42b108ae
current thread: lwIP -> please refer task analysis part

== heap analysis ==
heap total size:0x19000, free size:0xb808, max used:0x10300
no corruption detected.

== task analysis ==
TASK: lwIP (running, priority: 6)
callstack: SP: 0x2000A658, LR: 0x10087781, PC: 0x1007EEBA
event_callback()
sent_tcp()
tcp_input()
ip4_input()
ethernet_input()
tcpip_thread()
== end of frame ==

TASK: IDLE (ready, priority: 0)
callstack: SP: 0x2000CC98, LR: 0x100AD40F, PC: 0x100AD40C
xTaskResumeAll()
prvIdleTask()
== end of frame ==

TASK: EG_Ev (block, priority: 1)
callstack: SP: 0x2000F730, LR: 0x100AD40F, PC: 0x100AD456
vTaskDelay()
== end of frame ==

TASK: EG_Re (block, priority: 1)
callstack: SP: 0x200129B8, LR: 0x100AD40F, PC: 0x100AD456
vTaskDelay()
EG_msg_recv()
== end of frame ==

TASK: Tmr S (block, priority: 19)
callstack: SP: 0x2000D4E8, LR: 0x100AD40F, PC: 0x100AE6FE
prvTimerTask()
== end of frame ==

TASK: EG_te (block, priority: 1)
callstack: SP: 0x2000FB78, LR: 0x100AD40F, PC: 0x100AD456
vTaskDelay()
EG_test()
== end of frame ==

TASK: User (block, priority: 1)
callstack: SP: 0x2000C830, LR: 0x100AD40F, PC: 0x100AD456
vTaskDelay()
user_wifi_app_entry()
== end of frame ==

TASK: EG_Se (block, priority: 1)
callstack: SP: 0x20011788, LR: 0x100AD40F, PC: 0x100AE20A
xQueueGenericReceive()
sys_arch_sem_wait()
lwip_select()
ej_mqtt_read()
cycle()
waitfor()
MQTTPublish()
EG_msg_pub()
EG_msg_send()
== end of frame ==

TASK: wpa_s (block, priority: 5)
callstack: SP: 0x20009B90, LR: 0x100AD40F, PC: 0x100AE20A
xQueueGenericReceive()
sys_arch_sem_wait()
lwip_select()
eloop_run()
wpa_supplicant_run()
wpa_supplicant_entry()
wpa_supplicant_task()
== end of frame ==

TASK: net (suspend, priority: 6)
callstack: SP: 0x20007C78, LR: 0x100AD40F, PC: 0x100AE20A
xQueueGenericReceive()
wifi_os_queue_receive()
prvNetTask()
== end of frame ==

TASK: cli (suspend, priority: 7)
callstack: SP: 0x2000B738, LR: 0x100AD40F, PC: 0x100AE20A
xQueueGenericReceive()
bsp_io_def_uart_getchar()
_cli_getline()
cli_task()
== end of frame ==

TASK: SYSLO (suspend, priority: 1)
callstack: SP: 0x20005488, LR: 0x100AD40F, PC: 0x100AE20A
xQueueGenericReceive()
log_queue_receive()
syslog_task_entry()
== end of frame ==

TASK: inban (suspend, priority: 6)
callstack: SP: 0x20006AB0, LR: 0x100AD40F, PC: 0x100AE20A
xQueueGenericReceive()
wifi_os_queue_receive()
inband_queue_task()
== end of frame ==

mqtt readpacket问题

rc = c->ipstack->mqttread(c->ipstack, c->readbuf, 1, left_ms(timer));
if (rc != 1)
{

#ifdef MQTT_MARVELL
if (rc == 0)
rc = MQTT_CONNECTION_LOST;
#else
if(rc == -3)
rc = MQTT_CONNECTION_LOST;
#endif
goto exit;

}

从这个地方看 ,说明不同平台mqttread的返回值判断是有区别的,默认的是没有从socket read的反馈来判断连接断开的判断,我们这里加入了connect lost的判断,所以要求socket read反馈的要更详细才能完成在这个地方完成lost 的判断!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.