Hi Dialog
Hi Dialog
我有一个DA1458C充当中央设备使用DSPS主项目,DA14583充当从属(6)使用DSPS从项目。
My use case is Central will connect to one slave, receive data and once data received, disconnect from slave(app_easy_gap_disconnet(con_id) called from user_sps_client_data_rx_ind_handler() function) then in user_on_disconnection() i have added user_scan_start() so new slaves started scanned and connected (at a time master connects to only one slave) In slave side once slave disconnected from master, slave will enterds into exetended sleep mode.
i have run the master code without connecting to any slaves... i found no issues..
我已经把所有6 t奴隶到1分钟的睡眠ime, my problem is after some time like 12- 18 hrs of execution master gets hanged...i debugged the code, code stops at wrap_platform_reset()...
在主侧,我已经禁用了延伸和深睡眠......因为这个堆配置将更少..它会影响吗???
还有什么可能是这个问题?
Thank you ..
Hi prasanth,
If the device is operating and after 12-18 hours the device hits the platform reset that means that there is a memory leak in the code, a memory allocation that happens most probably in every connection or transaction and its never freed, so eventually you run out of memory and the wrap_platform_reset() occurs. By increasing the heap it wont be that much of a help since even if you do increase it, it will eventually run out as well in a longer period.
Thanks MT_dialog
Hi Dialog
感谢你的回复..
分配的内存将由内核自动释放,在将指针发送到KE_MSG_SEND()之后。如果未发送消息,则必须使用KE_MSG_FREE()显式释放它。
In DSPS master code only once ke_msg_free() was used ... how can i use this to solve my issue ??
在user_sps_host.c => user_on_connection => user_gattc_connection => user_gattc_exc_mtu_cmd()中的主代码在此代码停止之后...
如何解决此Wrap_platform_reset()问题?
Thank you...
Hi prasanth,
As mentioned, in your application there should be somekind of memory leakage pilling up after each connection i suppose (when the wrap_platform_reset() occurs make sure that the error code is RESET_MEM_ALLOC_FAIL), you will have to debug this in order to find it, there is no generic method that would allow you to find it. Check if there are any messages that you have send during the customization that you ve done (since this doesn't occur in the original central) and make sure that you are consuming the messages that you get when the message is handled or if you are allocating data they should be freed.
Thanks MT_dialog
Hi Dialog
i have tested by debugging error code was RESET_MEM_ALLOC_FAIL , after commenting all Arch_printf() memory issue disn't happened.
仍在脱离问题,
My use case is Central will connect to one slave, receive data and once data received, disconnect from slave(app_easy_gap_disconnet(con_id) called from user_sps_client_data_rx_ind_handler() function) , after this slave will disconnect and go to sleep
/*******************************Slave code ************************************/
void user_on_disconnect( struct gapc_disconnect_ind const *param )
{
// default_app_on_disconnect(param);
ARCH_PRINTF(“设备已断开\ r \ n”);
//if(Console_print) {
// /****************************UART PRINT FUCNTION***************************************/
// uart_init(Uart_baudrate_115k2,3);
// uart_flow_off();
// uint8_t something2 [] = {“user_disconnected \ n”};
// UART_WRITE((uint8_t *)某事物2,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, wake_up_sm ); // 1000 -> 10s
}
/ ********************************************************************************************************** /
/ *********************主侧***************************************************************************** /
if slave discoonected then in master side gapc_disconnect_ind_handler()-> app_on_doiconnection -> user_on_disconnection() will get called ...
但是,在长期vers_on_disconnection()没有被称为......可能是问题???请帮助
谢谢对话框
Hi prasanth,
我将坚持到注释arch_printf()时,当使用Arch_printf()实用程序打印太多数据时,您实际地分配数据以及设备时,设备将打印时,请勿发生内存分配问题。如果您经常调用ARCH_PRINTF(),那么您分配太多内存,如果设备未达到打印点,内存分配将失败。但据我所知,即使你没有看到这种情况发生这个设备仍然断开连接,但我无法理解你正试图描述的是什么,所以你能澄清吗?
Thanks MT_dialog
Hi Dialog
感谢你的回复..
掌握正在向从站发送断开连接请求,一旦从站断开连接的指示将发送到Master,Master将接收断开连接指示并调用user_on_disconnect()....
master <------------------------------------------------------------------------------------->奴隶
-> disconnected , stops advertising -> enters into sleep
Master < - < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - isconnectc指示------------------------>发送断开连接指示掌握
Master <-- Disconnect ind received -----------<-------------
Master <---
有些时候Master没有收到指示,所以user_on_disconnection()没有被叫,(但是我可以看到从站断开连接并进入睡眠),在某些延迟(6 - 7分钟)user_on_disconnection()被调用后,直到常常运行time user_on_disconnect被叫user_on_system_powered()是继续运行
In user_on_disconnection() i am starting user_scan_start(), if this is not called master won't be scanning for new devices....
Thank you
Hi prasanth,
So to get a more clear pitcure, on the problematic case the user_on_disconnect gets called on the master side (you get the disconnection indication) but not as soon as the slave sends the disconnection request, is that right ? If that is the case then most probably the link is lost for some reason before the disconnection is issued by the slave, and the link is terminated from the superision timeout and not because of the disconnection command send by the slave, because of that the master "thinks" that the link is still valid. Check at the disconnection callback on the master's side when the issue occurs and check what is the reason that stack returns when that happens.
Thanks MT_dialog