deadlock calling pppapi_free
Posted: Fri May 11, 2018 4:40 pm
Hi,
I'm facing the following issue, (code attached below) once pppapi_free been called the current task goes to a deadlock, checking docs, seems that pppapi_free should be called inside tcpip thread but I didn't find any way to do that.
I also checked on espidf ppp example, but there isn't a ppp_pcb release.
Anyone has a full example of ppp re-creation?
All suggestions are welcome, thanks in advance
I'm facing the following issue, (code attached below) once pppapi_free been called the current task goes to a deadlock, checking docs, seems that pppapi_free should be called inside tcpip thread but I didn't find any way to do that.
I also checked on espidf ppp example, but there isn't a ppp_pcb release.
Anyone has a full example of ppp re-creation?
All suggestions are welcome, thanks in advance
Code: Select all
static ppp_pcb *ppp = NULL;
static bool gsm_ppp_connect()
{
ESP_LOGW(TAG, "gsm_ppp_connect 1");
if(ppp != NULL)
{
pppapi_free(ppp);
ppp = NULL;
}
ESP_LOGW(TAG, "gsm_ppp_connect 2");
ppp = pppapi_pppos_create(&ppp_netif, ppp_output_callback, ppp_status_cb, NULL);
if (ppp == NULL)
{
ESP_LOGE(TAG, "Error initializing PPPoS");
return false;
}
ESP_LOGW(TAG, "gsm_ppp_connect 3");
pppapi_set_default(ppp);
ESP_LOGW(TAG, "gsm_ppp_connect 4");
pppapi_set_auth(ppp, PPPAUTHTYPE_PAP, config->gsm_user, config->gsm_pass);
ESP_LOGW(TAG, "gsm_ppp_connect 5");
pppapi_connect(ppp, 0);
ESP_LOGW(TAG, "gsm_ppp_connect 6");
return true;
}