[BUG] in x cube cellular 7.0.0 when turning modem off during a PPP session
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_dataOn 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 >>>