Hi, I am using the DSPS profile for development using PAN1740 modules based on the DA14580 chipset,
Unfortunately as soon as I try to disconnect the host from a device I get a hard reset, I use the app_disconnect();
function:
void app_disconnect(void)
{
struct gapc_disconnect_cmd *cmd = KE_MSG_ALLOC(GAPC_DISCONNECT_CMD,
KE_BUILD_ID(TASK_GAPC, app_env.conidx), TASK_APP,
gapc_disconnect_cmd);
cmd->operation = GAPC_DISCONNECT;
cmd->reason = CO_ERROR_REMOTE_USER_TERM_CON;
// Send the message
ke_msg_send(cmd);
}
to disconnect based on a serial command.
Any help regarding this will be much appreciated.
Thanks.
Keywords:
Device:
Looking at the PC from the hardfault handler the culprits seems to vary between STRH, LDRH instructions accessing misaligned memory addresses.
However I'm not sure what causes that I have added alignment checks for all my variables.
Any ideas on how to solve further debug this ??
Hi aley_i,
When you send through uart the disconnect command you get platform_reset ? Perhaps you are having a memory leak, generating data and not consuming them when you disconnect.
Thanks MT_dialog
HI MT_dialog,
Thanks for your reply, I don't get a software or a platform reset after I've issued the app_disconnect() on the host,
should I issue the reset platform myself along with the disconnect function?
When you say generating data and not consuming them are you talking about the relevant app controller task not deleted properly?
Is there any way I can make sure the task is deleted properly before I start scanning again?
Thanks
Just to clarify, I've got a BLE central Device acting as host( client ) and and BLE Peripheral configured as a device( client ), I send a disconnect command from the host APP to the host GAP layer and this seems to be the culprit, this doesn't always happen the first time, sometimes it takes two or three attempts.
I have tried disconnecting from the peripheral instead and have the same issue.
Hi aley_i,
Sorry, i didn't realized that you get a hard reset on your host after the disconnection command. You are getting a GAPM_DEVICE_READY_IND as soon as you disconnect on your host? You are using the DSPS (host and device) as is and you ve added extra code that receives data from UART and translate it into commands (most changes done in the peripheral side) ? Are you able to track the command with a sniffer and check the LL_TERMINATE event (are there any retransmissions of the event) ? Also on what SDK is your design ? Your host is on fully embedded or fully hosted mode, is the host running on a external CPU using GTL?
Thanks MT_dialog
Hi MT_dialog,
No I am not getting a GAPM_DEVICE_READY_IND on the host after I disconnect, all I get is the GAPC_DISCONNECT_EVT.I only get the GAPM_DEVICE_READY_IND at startup.
Yes I am using DSPS host and device and I've added extra code to get the following commands on host:
START_SCAN
GET_ADVERTISED_LIST( dump a list of advertised peripherals )
CONNECT ( connect to a specific peripheral )
DISCONNECT( disconnect and restart scanning )
on the peripheral side I only have:
SET_NAME( set the name of the peripheral ( advertised packet ) )
DISCONNECT
I am using DSPSV3.150.2, The host is not running on external CPU using GTL.
I get the GAPC_DISCONNECT_EVT in both host and device in case of a disconnect, I have tried forcing a GAPM_RESET and GAPM_PLF_RESET after every disconnect but the problem still persists.
Hi aley_i,
I was able to reproduce your problem. The issue is due to a bug on an older SDK3 on which the DSPS is build, a fix is introduced in the previous SDK3.0.10.1. So i would recommend to move to the latest SDK for solving your issue or wait for the new, SDK5 based release of the DSPS which will come soon.
Thanks MT_dialog
Thanks MT_Dialog,
任何想法基于SDK5当需求方出来? also is there a guide to port the project if I want to do it myself.
Thanks
Hi aley_i,
我不知道exact date but is through the evaluation proccess i trust that it will be released very soon, unfortunatelly no there isn't a porting guide to the new SDK5.
Thanks MT_dialog