Zephyr & PPP GSM Modem without RTS/CTS

Hi, I have a problem configuring the PPP Modem correctly and I'm not quite sure what i'm missing here.

I'm running the code on a custom board. We are using nRF52832 to talk to Telit ML865G1 modem over UART and we don't have any HW control pins implemented so it's pretty much just RX&TX.

Everything seems to be functioning correctly but the response from modem is not being received by nRF52.

  • modem is powered and activated.
  • UART get correctly initialized
  • modem list (shell) lists the modem on the correct UART Iface
  • I scoped the UART lines and the AT command that's called by gsm_ppp_start->gsm_configure gets sent correctly with correct baud rate
  • The correct AT OK response is also generated by the modem and is detected both by a scope & a USB to serial converter
  • we also have an NRF5 sdk based solution that is able to successfully comunicate with the modem on the same board

however, with net_dbg logging enabled the modem generates the following error:

modem_gsm.gsm_configure: modem not ready -116

My suspicion is that the configurations i'm trying to run this in doesn't work unless RTS/CTS pins are implemented. Could you suggest something to troubleshoot this further or some other configuration combo that i'm missing here.

Code, board definitions and configuration provided below.

Here's a snippet of our custom board.dts:

 &uart0 {
	 status = "okay";
	 compatible = "nordic,nrf-uarte";
	 current-speed = <9600>;
	 tx-pin = <6>;
	 rx-pin = <8>;
	 label = "HTS_UART_0";
	 rts-pin = <0xFFFFFFFF>;
	 cts-pin = <0xFFFFFFFF>;
 };

I'm also using an additional overlay file with the following contents:

&uart0 {
	status = "okay";
	current-speed = <115200>;
	/delete-property/ rts-pin;
	/delete-property/ cts-pin;
	gsm: gsm-modem {
		compatible = "zephyr,gsm-ppp";
		label = "gsm_ppp";
		status = "okay";
	};
};

Here's the relevant bits of prj.conf:

CONFIG_UART_ASYNC_API=y

CONFIG_UART_0_ASYNC=y
CONFIG_UART_0_INTERRUPT_DRIVEN=n

CONFIG_MODEM=y
CONFIG_MODEM_GSM_PPP=y

CONFIG_NET_DRIVERS=y
CONFIG_NET_PPP=y
CONFIG_NET_L2_PPP=y
CONFIG_NET_NATIVE=y
CONFIG_NETWORKING=y

CONFIG_GSM_PPP_AUTOSTART=n

CONFIG_NET_PPP_ASYNC_UART=y

Here's the code itself:

const struct device *uart_dev = DEVICE_DT_GET(DT_BUS(DT_INST(0, zephyr_gsm_ppp)));
	gsm_dev = DEVICE_DT_GET(DT_INST(0, zephyr_gsm_ppp));

	LOG_INF("Board '%s' APN '%s' UART '%s' device %p (%s)",
		CONFIG_BOARD, CONFIG_MODEM_GSM_APN,
		DT_BUS_LABEL(DT_INST(0, zephyr_gsm_ppp)), uart_dev,
		gsm_dev->name);

	net_mgmt_init_event_callback(&mgmt_cb, event_handler,
				     NET_EVENT_L4_CONNECTED |
				     NET_EVENT_L4_DISCONNECTED);
	net_mgmt_add_event_callback(&mgmt_cb);

	LOG_INF("Modem Device INIT");

	gsm_ppp_start(gsm_dev);

It's pretty much a verbatim copy of net/gsm_modem example.

Parents
  • Hello Nikolozka,

    nikolozka said:

    there a function driver/net/ppp/ppp_async_uart_rx_enable() that is part of ppp.c file. now this is the function that actually enables RX on the UART. This function is in turn being called by driver/net/ppp/ppp_start() (this function is exposed through (struct ppp_api->start)

    The modem example calls driver/modme/gsm_ppp_start() (defined in gsm_ppp.c) which is in turn supposed to call the abovementioned ppp_start() however it seems like to reach ppp_api->start() it already has to have received a response on to AT on UART. 

    gsm_ppp_start() calls modem_iface_uart_init_dev(), where IRQ RX and a callback is configured. I wonder if this makes it incompatible with the usage of the async API then?

    nikolozka said:
    I'm not sure if i'm doing something rather wrong or if this is indeed a bug? maybe some problem with init order?

    Anyhow, my recommendation here would be to get in touch with the Zephyr support, as they have written this sample. They have an own #networking channel on Discord.

    Regards,

    Markus

Reply
  • Hello Nikolozka,

    nikolozka said:

    there a function driver/net/ppp/ppp_async_uart_rx_enable() that is part of ppp.c file. now this is the function that actually enables RX on the UART. This function is in turn being called by driver/net/ppp/ppp_start() (this function is exposed through (struct ppp_api->start)

    The modem example calls driver/modme/gsm_ppp_start() (defined in gsm_ppp.c) which is in turn supposed to call the abovementioned ppp_start() however it seems like to reach ppp_api->start() it already has to have received a response on to AT on UART. 

    gsm_ppp_start() calls modem_iface_uart_init_dev(), where IRQ RX and a callback is configured. I wonder if this makes it incompatible with the usage of the async API then?

    nikolozka said:
    I'm not sure if i'm doing something rather wrong or if this is indeed a bug? maybe some problem with init order?

    Anyhow, my recommendation here would be to get in touch with the Zephyr support, as they have written this sample. They have an own #networking channel on Discord.

    Regards,

    Markus

Children
Related