LTE Link Control can't recover from LTE_LC_MODEM_EVT_BATTERY_LOW ?

Hi,

OS: Windows 10
Editor: VS Code 1.74.0
nrfjprog version: 10.18.1 external
JLinkARM.dll version: 7.80c
nRF Connect SDK version: 2.2.0
nRF9160 modem firmware version: 1.3.3

I noticed that when the battery is low and the application raises +CGEV: ME BATTERY LOW and %MDMEV: ME BATTERY LOW, the LTE LC receives the LTE_LC_MODEM_EVT_BATTERY_LOW, the application can't connect to LTE after that. 

[00:12:49.443,817] <dbg> application: modem_on: No LTE connection, go offline and then connect.
[00:12:49.453,430] <inf> application: Sending the modem to offline mode.
[00:12:49.467,559] <dbg> application: modem_offline: lte_lc_func_mode: 4
[00:12:49.475,158] <dbg> application: modem_offline: Modem is already offline.
[00:12:49.483,245] <inf> application: Starting to connect to LTE network.
[00:12:49.490,905] <dbg> lte_lc_helpers: event_handler_list_append_handler: Handler already registered. Nothing to do
[00:12:49.515,930] <err> lte_lc: Could not send AT command, error: 65536
[00:12:49.523,529] <err> application: Error: lte_lc_connect_async() failed, err: -14
[00:12:49.532,470] <err> application: Error: LTE link could not be established, or maintained.

lte_lc_connect_async() calls connect_lte() which calls lte_lc_system_mode_set() which returns error Could not send AT command, error: 65536. As much I have tested this, it happens every time after the battery low event has been received and it can revocer from this only when rebooting the device. I have set AT%XPOFWARN=1,33 and set the supply voltage to about 2.5-2.6V to make it fail easier.

If I set AT+CFUN=1 over UART, the device connects to LTE successfully. That makes me wonder if there is a bug on the LTE Link Control or on the Modem library AT commands interface.

Regards,
Tero

Parents
  • Hi, 

    When the power is low the modem won't connect to avoid misbehaving in the operator network. Does it start to work again if the power is back to normal levels, without a reboot?

    -Amanda H.

  • Hi,

    In my experience, the modem (or LTE Link Control) won't connect again without a reboot even if the power levels are set to normal 3V again.

    Regards,
    Tero

  • Hi again,

    You can get the application log over RTT, and the trace over the one UART you have. 

    I tried to get the trace over UART but without success. Is it even possible because we don't have CTS and RTS pins?

    -Tero

  • anicare-tero said:
    Is it even possible because we don't have CTS and RTS pins?

    Yes. 

    What UART port are you connecting to? The modem trace uses UART1. 

    -Amanda H.

  • I tried to add UART1 like in this guide: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/libraries/modem/nrf_modem_lib.html#sending-traces-over-uart1-on-a-custom-board

    / {
    ...
    	chosen {
    		zephyr,console = &uart0;
    		zephyr,shell-uart = &uart0;
    		zephyr,uart-mcumgr = &uart0;
    	};
    ...
    };
    
    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 7)>,
    				<NRF_PSEL(UART_RX, 0, 6)>;
    		};
    	};
    
    	uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 7)>,
    				<NRF_PSEL(UART_RX, 0, 6)>;
    			low-power-enable;
    		};
    	};
    
    	uart1_default: uart1_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 7)>,
    				<NRF_PSEL(UART_RX, 0, 6)>;
    		};
    	};
    
    	uart1_sleep: uart1_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 7)>,
    				<NRF_PSEL(UART_RX, 0, 6)>;
    			low-power-enable;
    		};
    	};
    };
    
    &uart0 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    	/delete-property/ rts-pin;
    	/delete-property/ cts-pin;
    	/delete-property/ hw-flow-control;
    };
    
    &uart1 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart1_default>;
    	pinctrl-1 = <&uart1_sleep>;
    	pinctrl-names = "default", "sleep";
    	/delete-property/ rts-pin;
    	/delete-property/ cts-pin;
    	/delete-property/ hw-flow-control;
    };

    Do I have to disable UART0 or do something else to get both RTT and modem traces over UART1 working?

  • Hi, 

    You can just change the pins used by UART1 in the device tree to the one UART you have. 

    If you are using the log system for the logs, you can just enable the RTT backend (See this example). And as you are not using UART0, disabling it in the device tree is probably the easiest. Otherwise, you have to assign new pins to it.

    -Amanda H.

  • Hi,

    I've tried to get the modem traces working but without any success.

    I tried to disable UART0 from device tree and assigned UART1 pins to the pins that UART0 normally uses.

    We also tried to solder two jumpers to P0.00 and P0.01 and assigned UART1 TX and RX to those. We got the logs from UART0 correctly.

    With both of those methods, when started the tracing from Cellular Monitor, the file size increases a little but I can't see anything on Wireshark and in the Cellular Monitor none of the values gets updated.

    Do you confirm that modem traces don't need CTS and RTS pins?

    Is there anything wrong in the devicetree?

    / {
    ...
    	chosen {
    		zephyr,console = &uart0;
    		zephyr,shell-uart = &uart0;
    		zephyr,uart-mcumgr = &uart0;
    	};
    ...
    };
    
    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 7)>,
    				<NRF_PSEL(UART_RX, 0, 6)>;
    		};
    	};
    
    	uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 7)>,
    				<NRF_PSEL(UART_RX, 0, 6)>;
    			low-power-enable;
    		};
    	};
    
    	uart1_default: uart1_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 1)>,
    				<NRF_PSEL(UART_RX, 0, 0)>;
    		};
    	};
    
    	uart1_sleep: uart1_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 1)>,
    				<NRF_PSEL(UART_RX, 0, 0)>;
    			low-power-enable;
    		};
    	};
    };
    
    &uart0 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    
    	/* Disable hardware flow control and
    	 * remove GPIOs and pins of RTS and CTS. */
    	/delete-property/ rts-gpios;
    	/delete-property/ cts-gpios;
    	/delete-property/ rts-pin;
    	/delete-property/ cts-pin;
    	/delete-property/ hw-flow-control;
    };
    
    &uart1 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart1_default>;
    	pinctrl-1 = <&uart1_sleep>;
    	pinctrl-names = "default", "sleep";
    
    	/* Disable hardware flow control and
    	 * remove GPIOs and pins of RTS and CTS. */
    	/delete-property/ rts-gpios;
    	/delete-property/ cts-gpios;
    	/delete-property/ rts-pin;
    	/delete-property/ cts-pin;
    	/delete-property/ hw-flow-control;
    };

Reply
  • Hi,

    I've tried to get the modem traces working but without any success.

    I tried to disable UART0 from device tree and assigned UART1 pins to the pins that UART0 normally uses.

    We also tried to solder two jumpers to P0.00 and P0.01 and assigned UART1 TX and RX to those. We got the logs from UART0 correctly.

    With both of those methods, when started the tracing from Cellular Monitor, the file size increases a little but I can't see anything on Wireshark and in the Cellular Monitor none of the values gets updated.

    Do you confirm that modem traces don't need CTS and RTS pins?

    Is there anything wrong in the devicetree?

    / {
    ...
    	chosen {
    		zephyr,console = &uart0;
    		zephyr,shell-uart = &uart0;
    		zephyr,uart-mcumgr = &uart0;
    	};
    ...
    };
    
    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 7)>,
    				<NRF_PSEL(UART_RX, 0, 6)>;
    		};
    	};
    
    	uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 7)>,
    				<NRF_PSEL(UART_RX, 0, 6)>;
    			low-power-enable;
    		};
    	};
    
    	uart1_default: uart1_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 1)>,
    				<NRF_PSEL(UART_RX, 0, 0)>;
    		};
    	};
    
    	uart1_sleep: uart1_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 1)>,
    				<NRF_PSEL(UART_RX, 0, 0)>;
    			low-power-enable;
    		};
    	};
    };
    
    &uart0 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    
    	/* Disable hardware flow control and
    	 * remove GPIOs and pins of RTS and CTS. */
    	/delete-property/ rts-gpios;
    	/delete-property/ cts-gpios;
    	/delete-property/ rts-pin;
    	/delete-property/ cts-pin;
    	/delete-property/ hw-flow-control;
    };
    
    &uart1 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart1_default>;
    	pinctrl-1 = <&uart1_sleep>;
    	pinctrl-names = "default", "sleep";
    
    	/* Disable hardware flow control and
    	 * remove GPIOs and pins of RTS and CTS. */
    	/delete-property/ rts-gpios;
    	/delete-property/ cts-gpios;
    	/delete-property/ rts-pin;
    	/delete-property/ cts-pin;
    	/delete-property/ hw-flow-control;
    };

Children
Related