Dialog Semiconductor customer support - app_dsconnect https://support.dialog-semiconductor.com/resource-keywords/appdsconnect en DSPS Disconnect results in HardFault https://support.dialog-semiconductor.com/dsps-disconnect-results-hardfault

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.

Device: 
Mon, 12 Oct 2015 16:17:32 +0000 aley_i 2110 at https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/dsps-disconnect-results-hardfault#comments