GSM Modem Driver Initialization Question

Hi. I've been working on getting a gsm modem functional using the GSM Modem Zephyr driver on an nRF5340. I believe I have the overlay file setup correctly, but am recieving unexpected log output. There is log output for net & ppp configuration before any code in main is called to initialize the modem, as per the sample gsm_modem. The modem is on UART1 and the output is going to the console on UART0, as best as I can tell. 

The first 2 log lines show different address for the gsm modem than what device_get_binding("modem_gsm") returns.I'm currently blocked at an error message from gsm_ppp.c in gsm_configure() that sends "AT" to the modem and expects "AT" back. Origin or last log error message: gsm_ppp.c #L975.

Should I be concerned with the different device addresses or not?

  • net_ppp.ppp_driver_init: 0x20000214
  • modem_gsm.gsmo_init: Generic GSM Modem: 0x20000730
  • main() gsm device: 0x2000025c

uart:~$ *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
[00:00:00.407,562] <dbg> net_ppp.ppp_driver_init: [0x20001d88] dev 0x20000214
[00:00:00.407,653] <dbg> modem_gsm.gsm_init: Generic GSM modem (0x20000730)
[00:00:00.407,684] <dbg> modem_gsm.gsm_init: iface->read 0x1594f iface->write 0x15985
[00:00:00.407,714] <dbg> modem_gsm.gsm_rx: starting
[00:00:00.407,775] <dbg> modem_gsm.gsm_configure: Starting modem 0x20000730 configuration
[00:00:00.407,989] <dbg> net_mgmt.net_mgmt_event_init: (main): Net MGMT initialized: queue of 2 entries, stack size of 768
[00:00:00.407,989] <dbg> net_ppp.ppp_iface_init: [0x20001d88] iface 0x20000544
[00:00:00.408,020] <dbg> net_l2_ppp.net_ppp_init: (main): Initializing PPP L2 0x20001b58 for iface 0x20000544
[00:00:00.412,597] <dbg> net_mgmt.net_mgmt_add_event_callback: (conn_mgr): Adding event callback 0x200032d8
[00:00:00.412,597] <dbg> net_mgmt.net_mgmt_add_event_callback: (conn_mgr): Adding event callback 0x200032ec
[00:00:00.412,628] <dbg> conn_mgr.conn_mgr_handler: (conn_mgr): Connection Manager started
[00:00:00.412,658] <dbg> net_l2_ppp.tx_handler: (tx_handler_thread): PPP TX started
[00:00:00.412,658] <inf> main: Configured: PIN_MUX_CELL_WIFI_ENABLE
[00:00:00.412,658] <inf> main: Configured: PIN_MUX_CELL_WIFI_SWITCH
[00:00:00.412,689] <inf> main: Select Cell GSM Modem
[00:00:00.412,689] <inf> main: Configured: PIN_main_STATUS
[00:00:00.412,689] <inf> main: Configured: PIN_main_DTR
[00:00:00.412,689] <inf> main: Configured: PIN_main_ON_OFF
[00:00:00.412,689] <inf> main: Configured: PIN_main_RESET
[00:00:00.412,689] <inf> main: Turning gsm modem on via 1500ms sleep time.
[00:00:00.412,719] <inf> main: GSM Modem is already on. Returning.
[00:00:00.412,719] <inf> main: Board 'nrf5340dk_nrf5340_cpuapp' APN 'ATT' UART 'UART_1' device 0x200001b4 (modem_gsm)
[00:00:00.412,719] <dbg> main.init_main: GSM Device: 0x2000025c
[00:00:00.412,750] <dbg> net_mgmt.net_mgmt_add_event_callback: (main): Adding event callback 0x20002550
[00:00:02.408,020] <dbg> modem_gsm.gsm_configure: modem not ready -116
[00:00:02.408,050] <dbg> net_l2_ppp.ppp_startup: (sysworkq): PPP 0x20001b58 startup for interface 0x20000544
[00:00:02.408,050] <dbg> net_l2_ppp.ipcp_init: (sysworkq): proto IPCP (0x8021) fsm 0x20001c70
[00:00:02.408,081] <dbg> net_l2_ppp.lcp_init: (sysworkq): proto LCP (0xc021) fsm 0x20001ba0
[00:00:02.408,111] <dbg> modem_gsm.gsm_configure: Starting modem 0x20000730 configuration
[00:00:04.408,355] <dbg> modem_gsm.gsm_configure: modem not ready -116
[00:00:04.408,386] <dbg> modem_gsm.gsm_configure: Starting modem 0x20000730 configuration
[00:00:04.408,401] <dbg> modem_gsm.gsm_configure: modem not ready -116
. . .repeating forever...

.

Based on other overlay files on github I believe I have the overlay file correct.

&uart0 {
    status = "okay";
};

&uart1 {
    status = "okay";
    tx-pin = <3>;
    rx-pin = <8>;
    rts-pin = <2>;
    cts-pin = <7>;
    current-speed = <115200>;
    gsm: gsm-modem {
        status = "okay";
        compatible = "zephyr,gsm-ppp";
        label = "modem_gsm";
    };
};

Edit: Modem: NL-SW-LTE-TC4NAG

I'm using Pin 3 for TX. Pin 3 can be used for NFC or GPIO. I had to add a config option to prj.conf: `CONFIG_NFCT_PINS_AS_GPIOS=n`.

Related