LwIP (PPP) not work with X-CUBE-CELLULAR
Hello,
I am evaluating PPP with X-CUBE-CELLULAR but it doesn't work on my board.
Test environment
- SMT32 CubeIDE 1.6.0
- Customized board (STM32L4A6VG) with the Quectel BG96 on UART interface (no flow control)
- X-CUBE-CELLULAR V5.2
Purpose:
Using BG96 with PPP and BSD socket to connect to remote server. High level application developer can use socket api and develop on this board.
Problem:
Running Ping_Application, seems PPP is not working properly. Using socket mode is OK
ATD*99#<CR><CR><LF>
CONNECT<CR><LF>
BG96:MODEM SWITCHES TO DATA MODE
ATCore:<<< DATA MODE SELECTED >>>
AUTOM TASK: MODEM_PDN_ACTIVATING_STATE - PDP_ACTIVATED_EVENT
UTILS:ppposif_client_config
UTILS:client ppp_notify_phase_cb: PPP_PHASE_DEAD
UTILS:ppposif_client_dead: DC_SERVICE_OFF
UTILS:client ppp_notify_phase_cb: PPP_PHASE_INITIALIZE
Ping: Network is down
ComClt: Network is down
-----> New State: CST_PPP_CONFIG_ON_GOING_STATE <-----
AUTOM TASK: CST_PPP_CONFIG_ON_GOING_STATE - PPP_CLOSED_EVENT
AUTOM TASK: CST_PPP_CONFIG_ON_GOING_STATE - NO_EVENT
============ CST_cellular_service_task : autom_event = no event
UTILS:ppposif_config_timeout_timer_callback
=== CST_get_autom_event Fail !!! ===
LOG ERROR #1: channel=8 / errorId=1 / gravity=2
Ping: Network is down
ComClt: Network is down
-----> New State: MODEM_RESET_STATE <-----
AUTOM TASK: MODEM_RESET_STATE - NO_EVENT
============ CST_cellular_service_task : autom_event = no event
AUTOM TASK: MODEM_RESET_STATE - NO_EVENT
============ CST_cellular_service_task : autom_event = no event
AUTOM TASK: MODEM_RESET_STATE - MODEM_INIT_EVENT
*********** CST_modem_reset_mngt ********
UTILS:client ppp_notify_phase_cb: PPP_PHASE_DEAD
UTILS:ppposif_client_dead: DC_SERVICE_OFFHere is my configuration in plf_features.h
/* ===================================== */
/* BEGIN - Cellular data mode */
/* ===================================== */
/* Possible values for USE_SOCKETS_TYPE */
#define USE_SOCKETS_LWIP (0) /* define value affected to LwIP sockets type */
#define USE_SOCKETS_MODEM (1) /* define value affected to Modem sockets type */
/* Sockets location */
#if !defined USE_SOCKETS_TYPE
#define USE_SOCKETS_TYPE (USE_SOCKETS_LWIP)
#endif /* !defined USE_SOCKETS_TYPE */
/* ===================================== */
/* END - Cellular data mode */
/* ===================================== */
/* ===================================== */
/* BEGIN - Applications to include */
/* ===================================== */
#if !defined USE_ECHO_CLIENT
#define USE_ECHO_CLIENT (0) /* 0: not activated, 1: activated */
#endif /* !defined USE_ECHO_CLIENT */
#if !defined USE_HTTP_CLIENT
#define USE_HTTP_CLIENT (0) /* 0: not activated, 1: activated */
#endif /* !defined USE_HTTP_CLIENT */
#if !defined USE_PING_CLIENT
#define USE_PING_CLIENT (1) /* 0: not activated, 1: activated */
#endif /* !defined USE_PING_CLIENT */
#if !defined USE_COM_CLIENT
#define USE_COM_CLIENT (1) /* 0: not activated, 1: activated */
#endif /* !defined USE_COM_CLIENT */
#if !defined USE_MQTT_CLIENT
#define USE_MQTT_CLIENT (0) /* 0: not activated, 1: activated */
#endif /* !defined USE_MQTT_CLIENT */
#if !defined USE_UI_CLIENT
#define USE_UI_CLIENT (0) /* 0: not activated, 1: activated */
#endif /* !defined USE_UI_CLIENT */
/* MEMS Setup BEGIN */
/* USE_DC_MEMS enables MEMS management */
#if !defined USE_DC_MEMS
#define USE_DC_MEMS (0) /* 0: not activated, 1: activated */
#endif /* !defined USE_DC_MEMS */
/* USE_SIMU_MEMS enables MEMS simulation management */
#if !defined USE_SIMU_MEMS
#define USE_SIMU_MEMS (0) /* 0: not activated, 1: activated */
#endif /* !defined USE_SIMU_MEMS */
/* MEMS Setup END */
/* if USE_DC_MEMS and USE_SIMU_MEMS are both defined, the behaviour of availability of MEMS board:
if MEMS board is connected, true values are returned
if MEMS board is not connected, simulated values are returned
Note: USE_DC_MEMS and USE_SIMU_MEMS are independent
*/
/* use generic datacache entries */
#if !defined USE_DC_GENERIC
#define USE_DC_GENERIC (1) /* 0: not activated, 1: activated */
#endif /* !defined USE_DC_GENERIC */
/* ===================================== */
/* END - Applications to include */
/* ===================================== */
/* ======================================= */
/* BEGIN - Miscellaneous functionalities */
/* ======================================= */
/* To activate Network Library */
#if !defined USE_NETWORK_LIBRARY
#if (USE_MQTT_CLIENT == 1)
#define USE_NETWORK_LIBRARY (1) /* MqttClient use Network Library 1: activated */
#else /* USE_MQTT_CLIENT == 0 */
#define USE_NETWORK_LIBRARY (1) /* 0: not activated, 1: activated */
#endif /* USE_MQTT_CLIENT == 1 */
#endif /* !defined USE_NETWORK_LIBRARY */
/* If included then MbedTls Library is integrated */
/* USE_MBEDTLS must be included if USE_MQTT_CLIENT is activated */
#if !defined USE_MBEDTLS
#if (USE_MQTT_CLIENT == 1)
#define USE_MBEDTLS (1) /* MqttClient use MbedTls Library 1: activated */
#else /* USE_MQTT_CLIENT == 0 */
#define USE_MBEDTLS (0) /* 0: not activated, 1: activated */
#endif /* USE_MQTT_CLIENT == 1 */
#endif /* !defined USE_MBEDTLS */
/* If included then ComPing library is integrated */
/* USE_COM_PING must be included if USE_NETWORK_LIBRARY or USE_PING_CLIENT are included */
#if !defined USE_COM_PING
#if ((USE_NETWORK_LIBRARY == 1) || (USE_PING_CLIENT == 1))
#define USE_COM_PING (1) /* NetworkLibrary and PingClient use ComPing library 1: included */
#else /* (USE_NETWORK_LIBRARY == 0) && (USE_PING_CLIENT == 0) */
#define USE_COM_PING (0) /* 0: not included, 1: included */
#endif /* (USE_NETWORK_LIBRARY == 1) || (USE_PING_CLIENT == 1) */
#endif /* !defined USE_COM_PING */
/* If included then ComIcc library is integrated */
#if !defined USE_COM_ICC
#define USE_COM_ICC (1) /* 0: not included, 1: included */
#endif /* !defined USE_COM_ICC */
/* To include RTC service */
#if !defined USE_RTC
#define USE_RTC (1) /* 0: not activated, 1: activated */
#endif /* !defined USE_RTC */
/* To configure some parameters of the software */
#if !defined USE_CMD_CONSOLE
#define USE_CMD_CONSOLE (0) /* 0: not activated, 1: activated */
#endif /* !defined USE_CMD_CONSOLE */
#if !defined USE_DEFAULT_SETUP
#define USE_DEFAULT_SETUP (0) /* 0: Use setup menu,
1: Use default parameters, no setup menu */
#endif /* !defined USE_DEFAULT_SETUP */
/* Begin Stack analysis tools configuration */
#if !defined USE_STACK_ANALYSIS
#define USE_STACK_ANALYSIS (1) /* 0: Stack analysis is not embedded
1: Stack analysis is available */
#endif /* !defined USE_STACK_ANALYSIS */
#if (USE_STACK_ANALYSIS == 1)
#if !defined STACK_ANALYSIS_TIMER
/* Value of the timer to trace automatically the thread stack value
To do this, stack analysis will create a thread
unit is ms
default value 0 : timer = 0U means feature not activated
usage example :
for long duration test, activate the timer to detect thread stack overflow.
value example :
1min:60000 - 5min: 300000 - 1h: 3600000 ...
*/
#define STACK_ANALYSIS_TIMER (0U) /* default configuration: no thread stack display every x ms */
#endif /* !defined STACK_ANALYSIS_TIMER */
#endif /* USE_STACK_ANALYSIS == 1 */
/* End Stack analysis tools configuration */
#if !defined USE_BUTTONS
#define USE_BUTTONS (0) /* 0: not activated, 1: activated */
#endif /* !defined USE_BUTTONS */
#if !defined USE_LEDS
#define USE_LEDS (0) /* 0: not activated, 1: activated */
#endif /* !defined USE_LEDS */
/* use UART Communication between two boards */
#if !defined USE_LINK_UART
#define USE_LINK_UART (0) /* 0: not activated, 1: activated */
#endif /* !defined USE_LINK_UART */What I already did:
- Since USE_SOCKETS_TYPE (USE_SOCKETS_LWIP) doesn't work, I try to use USE_SOCKETS_MODEM and it works without problem. Pin connection and SIM card should be OK.
- I also used Quectel's QNavigator. Its PPP function is OK
I am not sure if I missed something in configuration, especially software. The attachment is the full log when using LwIP. Thanks for your time.
Best,
Sean
