Disconnection problem

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
8 posts / 0 new
最后一篇
prasanth.velliy...
离线
最后一次露面:1 year 11 months ago
加入:2016-02-18 12:18
Disconnection problem

嗨对话框

嗨对话框

I have a Da1458c acts as Central device use DSPS Master Project and DA14583 acts as slave(6) uses DSPS Slave Project.

我的用例是中心将连接到一个从站,接收数据,一旦收到的数据,从user_sps_client_data_rx_ind_handler(con_id)断开从从机(app_easy_gap_disconnet(con_id)),然后在user_on_disconnection()中我添加了user_scan_start(),所以新的站开始扫描连接(在时间主机上只连接到一个从站),从奴隶一旦从主机断开连接,从而将enderded睡眠模式。

我已经运行了主代码而无需连接到任何奴隶......我发现没有问题..

我把所有6个奴隶放入1分钟的睡眠时间里,我的问题是经过一段时间的一段时间,像12-18小时的执行大师被绞死......我调试代码,代码停止在Wrap_platform_reset()...

in master side i have disabled both extended and deep sleep ... because of this heap configuration will be less.. will it affect ???

what else could be the issue ??

谢谢 ..

Device:
mt_dialog.
离线
最后一次露面:2 months 3 weeks ago
职员
加入:2015-06-08 11:34
嗨prasanth,

嗨prasanth,

如果设备运行并且在12-18小时后,设备会触及平台复位,这意味着代码中存在内存泄漏,最可能发生在每个连接或交易中的内存分配以及它从未释放过,所以最终您已经运行内存中的内存和WRAP_PLATFORM_RESET()发生。通过增加堆,它不会是那么大的帮助,因为即使你增加它,它最终也会在更长的时间内耗尽。

谢谢mt_dialog.

prasanth.velliy...
离线
最后一次露面:1 year 11 months ago
加入:2016-02-18 12:18
嗨对话框

嗨对话框

谢谢for your reply..

The memory allocated will be automatically freed by the kernel, after the pointer has been sent to ke_msg_send(). If the message is not sent, it must be freed explicitly with ke_msg_free().

在DSPS主代码中只有一次使用KE_MSG_FREE()......如何使用它来解决我的问题?

In master code in user_sps_host.c => user_on_connection => user_gattc_exc_mtu_cmd() after this code got stopped...
How can i solve this wrap_platform_reset() issue ??

谢谢...

mt_dialog.
离线
最后一次露面:2 months 3 weeks ago
职员
加入:2015-06-08 11:34
嗨prasanth,

嗨prasanth,

如上所述,在您的应用程序中,每次连接后,应该有一些内存泄漏捕获量(当发生Wrap_platform_reset()时确保错误代码是reset_mem_alloc_fail),您必须调试这一点以便找到它没有通用方法,可以允许您找到它。检查是否有任何邮件在您完成的自定义期间发送了任何消息(因为这在原始中心中不会发生),并确保您在处理消息时会消耗您获得的消息或者您是分配数据应释放。

谢谢mt_dialog.

prasanth.velliy...
离线
最后一次露面:1 year 11 months ago
加入:2016-02-18 12:18
嗨对话框

嗨对话框
我通过调试错误代码进行了测试了,在注释后,在注释所有ARCH_PRINTF()内存问题之后不会发生。

still disconnection issue is there,
我的用例是中心将连接到一个从站,接收数据,一旦收到数据,从user_sps_client_data_rx_ind_handler()函数调用的从站(app_easy_gap_disconnet(con_id)断开连接),在此奴隶将断开连接并转到睡眠状态

/ *******************************从代码************************************* /
void user_on_disconnect(struct gapc_disconnect_ind const * param)
{
//default_app_on_disconnect(param);
arch_printf("Device disconnected\r\n");
// if(console_print){
// / **************************** UART打印fucntion *************************************** /
// uart_init(UART_BAUDRATE_115K2,3);
// uart_flow_off();
// uint8_t something2[] = {"user_disconnected\n"} ;
// uart_write((uint8_t *)something2,sizeof(something2),NULL);
// uart_finish_transfers();
// / *************************************************************************************** /
//}

app_easy_gap_advertise_stop();
ARCH_BLE_EXT_WAKEUP_ON();

wrbl_env2.sensor_read_time_1 = app_easy_timer(6000,key_up_sm);// 1000 - > 10s

}

/**********************************************************************************************************/

/********************* 主方 *****************************************************************************/

如果从属agdoonected然后在主侧Gapc_disconnect_ind_handler() - > app_on_diconnection - > user_on_disconnection()将被叫...

but in a long run user_on_disconnection() is not getting called..what could be the issue ???Please help

谢谢Dialog

mt_dialog.
离线
最后一次露面:2 months 3 weeks ago
职员
加入:2015-06-08 11:34
嗨prasanth,

嗨prasanth,

I will stick to the point that when commenting out the arch_printf() the memory allocation issue doesn't happen, when printing too much data using the arch_printf() utility you actually allocate data and when having the chance the device will print. If you invoke the arch_printf() too often then you allocate too much memory and if the device doesn't reach the printing point the memory allocation will fail. But as far as i can understand even if you dont see this happen the device still disconnects, but i am not able to understand what exactly is that you are trying to describe, so can you please clarify ?

谢谢mt_dialog.

prasanth.velliy...
离线
最后一次露面:1 year 11 months ago
加入:2016-02-18 12:18
嗨对话框

嗨对话框

谢谢for your reply..

Master is sending disconnection request to Slave , once slave disconnected indication will be send to master and master will receive disconnection indication and call user_on_disconnect()....

大师<---<------------------------------------> disconnection_req ----------------------------------> Slave
- >断开连接,停止广告 - >进入睡眠
Master <-- <------------------------------------- disconnectc indication -------------------------> send disconnect indication to master
Master < - Disconnect Ind收到----------- <-------------
大师<---

some times master is not receiving the indication, so user_on_disconnection() not gets called,(but i can see slave disconnected and enter into sleep ),, after some delay (6 - 7 min)user_on_disconnection() gets called , then runs normally till the time user_on_disconnect gets called user_on_system_powered() is keep on running

在user_on_disconnection()我是启动user_scan_start(),如果这不被称为master将不会扫描新设备....

谢谢

mt_dialog.
离线
最后一次露面:2 months 3 weeks ago
职员
加入:2015-06-08 11:34
嗨prasanth,

嗨prasanth,

所以要获得更清晰的pitcure,在有问题的情况下,user_on_disconnect会在主站(你得到断开连接指示)但不是一旦从站发送断开连接请求,就是正确的吗?如果是这种情况,那么大多数可能在从站发出断开连接之前,链路丢失,并且链接从超时超时终止,而不是因为主站的断开命令发送,因为主机“认为”链接仍然有效。在发生问题时检查主站点的断开回调并检查堆栈何时发生的原因是什么。

谢谢mt_dialog.