2022-06-02 03:00 PM
I have run into a bug when turning off the modem (using the command line) while the modem in an PPP session. This bug exists in x cube cellular 7.0.0 but Does Not exist in x-cube-cellular 6.0.1.
The following are console logs on the same HW with the difference being x-cube-cellular versions:
When the PPP session is closed the Cellular service task should recieve a PPP_CLOSED_EVENT autom_event to continue the modem shutdown. See the log snippet (line 11) below from x-cube-cellular 6
===== X-Cube-Cellular version : X-CUBE-CELLULAR-6.0.0 =====
=====>CST_notif_callback (Data Cache event=7)
AUTOM TASK: MODEM_DATA_READY_STATE - TARGET_STATE_CMD_EVENT
=====>CST_notif_callback (Data Cache event=2)
CellularApp: Modem NOT ready to transmit data!
=====>CST_notif_callback (Data Cache event=0)
=====>CST_notif_callback (Data Cache event=1)
UTILS:ppposif_client_close
UTILS:ppposif_client_close : Closing PPP for POWER OFF
New modem target state : OFF
$>-----> New State: CST_PPP_CLOSE_ON_GOING_STATE <-----
AUTOM TASK: CST_PPP_CLOSE_ON_GOING_STATE - PPP_CLOSED_EVENT < -------- Expected Event
AUTOM TASK: CST_PPP_CLOSE_ON_GOING_STATE - NO_EVENT
============ CST_cellular_service_task : autom_event = no event
UTILS:client ppp_notify_phase_cb: PPP_PHASE_DEAD
UTILS:ppposif_client_dead: DC_SERVICE_OFF
=====>CST_notif_callback (Data Cache event=0)
UTILS:status_cb: User interrupt
AUTOM TASK: CST_PPP_CLOSE_ON_GOING_STATE - MODEM_POWER_DOWN_EVENT
CS API:CS_suspend_data
On x-cube-cellular 7 a PPP_OPENED_EVENT is received instead of a PPP_CLOSED_EVENT. See line 17 from the log snippet below
===== X-Cube-Cellular version : X-CUBE-CELLULAR-7.0.0 =====
CST: CST_notif_callback (Data Cache event=7)
CST: CST_send_message: PDP_ACTIVATED_EVENT
[INFO] Azure IoT Security Module has been disabled, status=0
Sample thread job is finished - thread is relinquished
02-06-2022 / 20:18:31
CST: AUTOM TASK: MODEM_DATA_READY_STATE - TARGET_STATE_CMD_EVENT
CST: CST_notif_callback (Data Cache event=2)
CST: CST_notif_callback (Data Cache event=0)
CST: CST_send_message: BOOT_EVENT
CST: CST_notif_callback (Data Cache event=1)
CST: CST_send_message: MODEM_INIT_EVENT
PPPosif:ppposif_client_close
PPPosif:ppposif_client_close : Closing PPP for POWER OFF
CST: New State: CST_PPP_CLOSE_ON_GOING_STATE
CST: AUTOM TASK: CST_PPP_CLOSE_ON_GOING_STATE - PPP_OPENED_EVENT <<<<<<--- BUG BEHAVIOR - SHOULD be PPP_CLOSED_EVENT
CST: autom_event = no event
If I use the debugger to change the Autom Event from PPP_OPENED_EVENT to PPP_CLOSED_EVENT in the cellular service task the modem shuts down correctly (See line 17 in the snippet below). I cannot find where the logic flaw is during modem shutdown. If you have an idea or suggestion I can make the change and report back on the result.
CST: CST_notif_callback (Data Cache event=7)
CST: CST_send_message: PDP_ACTIVATED_EVENT
[INFO] Azure IoT Security Module has been disabled, status=0
Sample thread job is finished - thread is relinquished
02-06-2022 / 19:33:54
CST: AUTOM TASK: MODEM_DATA_READY_STATE - TARGET_STATE_CMD_EVENT
CST: CST_notif_callback (Data Cache event=2)
CST: CST_notif_callback (Data Cache event=0)
CST: CST_send_message: BOOT_EVENT
CST: CST_notif_callback (Data Cache event=1)
CST: CST_send_message: MODEM_INIT_EVENT
CST: New State: CST_PPP_CLOSE_ON_GOING_STATE
CST: AUTOM TASK: CST_PPP_CLOSE_ON_GOING_STATE - PPP_OPENED_EVENT <<<<<<<<<---------- FORCED AUTOM_EVENT TO PPP_CLOSED_EVENT in the debugger
CST: osCDS_suspend_data()
TC4NAG API:enter ATCustom_TC4NAG_getCmd() for SID 125
ATCModem API:enter reset_CMD_context()
ATCModem:Tempo started (1000 ms)...
~<SC>}#<SC>!}!} } }9}"}&} } } } }#}%<SC>#}%}%}&f5<SC><SC>}'}"}(}"W<SC>~,"641D618",7<CR><LF>
TC4NAG API:enter ATCustom_NL_TCXNAG_extractElement()
TC4NAG API:enter ATCustom_NL_TCXNAG_analyzeCmd()
TC4NAG API:enter ATCustom_NL_TCXNAG_analyzeParam()
ATCModem API:enter fRspAnalyze_None()
ATCore:<<< COMMAND MODE SELECTED >>>
2022-07-28 08:45 AM
Hello,
Yes, there is an issue with PPP on XCC 700 on both azure and RTOS version. This will be corrected in the next version of the XCC.
Can you clarify which hardware platform you are using?
Best Regards
Solofo
2022-07-28 10:24 AM
I am using a custom hardware platform - Nucleo144 F429ZI and a Nimblelink TC4NAG LTE Cat 4 modem. I based my FW on the Quectel BG96 and the Discovery 462 board I think.
It if helps I found this resolved shutting down the ppp for me.
Created a ppposif_client_dead() in ppposif_client.c
static void ppposif_client_dead(void)
{
dc_cellular_info_t cellular_info;
(void)dc_com_read(&dc_com_db, DC_CELLULAR_INFO, (void *)&cellular_info, sizeof(cellular_info));
PRINT_PPPOSIF("ppposif_client_dead: DC_SERVICE_OFF\r\n")
cellular_info.rt_state_ppp = DC_SERVICE_OFF;
(void)dc_com_write(&dc_com_db, DC_CELLULAR_INFO, (void *)&cellular_info, sizeof(cellular_info));
}
And then add a call to that function in link_down_callback() in the same fi
/**
* @brief Link Down callback function
* @param ppp_ptr Pointer to main PPP data structure
* @retval none
*/
static void link_down_callback(NX_PPP *ppp_ptr)
{
/* Restart the PPP instance. */
ppposif_client_dead(); //Need to notify anyone listening that PPP has been closed
(void) nx_ppp_restart(ppp_ptr);
}
Thanks