This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF9160 behavior when changing mode and switching SIM

Hi,

We are currently trying to create a small test code to test multiple operator with different modes:

- lte-m1 or lte-nb1

- edrx 0s, 5.12s, 10.24s

- with and without psm

Our board has multiple SIM slot, with a SIM switch rerouting the SIM_xxx signals from the nRF9160.

After an initial lte_lc_init(), we setup the link control to use the configuration for the test.

Then we wait for a connection, turn the modem off, reconfigure the modem etc...

for (int i = 0; i < ARRAY_SIZE(test); i++) {
	const struct test_data *data = &test[i];

	LOG_WRN("====Starting test %d in 3 seconds=====", i);

	k_sleep(K_SECONDS(3));

	lte_lc_system_mode_set(data->mode, 0);
	lte_lc_psm_req(false);

	if (!data->use_edrx) {
		lte_lc_edrx_req(false);
	}
	else {
		lte_lc_edrx_param_set(LTE_LC_LTE_MODE_LTEM,
			data->ltem_edrx_value);
		lte_lc_edrx_param_set(LTE_LC_LTE_MODE_NBIOT,
			data->nbiot_edrx_value);
		lte_lc_edrx_req(true);
	}

	err = lte_lc_connect();
	if (err) {
		LOG_ERR("Test %d fails: no connection", i);
	}
	else {
		LOG_WRN("Connected ! Checking eDRX value");
		at_cmd_write("AT+CEDRXRDP", NULL, 0, NULL);
		k_sleep(K_SECONDS(2));
		at_cmd_write("AT+CEDRXRDP", NULL, 0, NULL);
		k_sleep(K_SECONDS(2));
		at_cmd_write("AT+CEDRXRDP", NULL, 0, NULL);
	}

	LOG_WRN("====Test %d done. "
		"Starting next one in 10 seconds====", i);
	lte_lc_power_off();
	k_sleep(K_SECONDS(10));
}

Once we are done with a SIM card, we turn off the modem, switch sim card and we go again.

The main issue that we have is that the modem is not reliable at all in that configuration.

Sometimes, a SIM card can connect when we start the test with it, but if it's the second SIM card to be tested, the connection is stuck at +CEREG=2 forever (literally)

With CONFIG_LTE_NETWORK_TIMEOUT=90, I would expect the connection to return an error once the timeout is reached, but not stuck forever.

What is the correct workflow to set the modem in multiple configuration in a short amount of time without the firmware being unreliable ?

Regards

Giuliano

Parents Reply
  • Hi!

    There have been some issues with the trace bitmasks in certain MFW versions. I have copied the workaround below, which I'm hoping will fix this issue for you.

    1. Flash corrected MFW Production Test Image via the Programmer application: mfw-pti_nrf9160_1.1.2.zip

    NOTE: The application may give an error message at the end. However, flashing should be just fine and can be confirmed by giving "AT+CGMR" which should reply "mfw-pti_nrf9160_1.1.2".

    2. Execute AT command: AT%XFSSYNC

    3. Observe OK response for AT command

    4. Make sure that the device boots once (either reset by flashing tool (nrfjprog --reset) or manually). Wait a few seconds and reset

    Now the trace masks in the modem filesystem should be OK, so that traces get enabled. Go ahead and flash the normal MFW and try to take a new modem trace.

Children
Related