nRF91 modem watchdog fault when re-activating LTE

I have an application with a shipping mode that when enabled/disabled calls `conn_mgr_all_if_connect/conn_mgr_all_if_disconnect`.
These functions eventually end up in `lte_net_if.c`, running `lte_lc_func_mode_set` with either `LTE_LC_FUNC_MODE_ACTIVATE_LTE` or `LTE_LC_FUNC_MODE_DEACTIVATE_LTE`.

Connecting to the LTE network on boot works fine, as does entering shipping mode.
The modem fault occurs when attempting to re-activate the modem after it has already been active.
If less than a minute has passed since the modem was de-activated, it re-activates fine and the application continues as per normal.
If over a minute has passed, the modem faults more or less immediately with:

[00:01:26.754,638] <inf> app: Device activated, enable LTE
[00:01:26.982,513] <err> nrf_modem: Modem has crashed, reason 0x2, PC: 0x468de

This issue is 100% reproducible (happens every time), always with the same error code and program counter.
The error code corresponds with NRF_MODEM_FAULT_HW_WD_RESET.

Replacing `LTE_LC_FUNC_MODE_ACTIVATE_LTE` and `LTE_LC_FUNC_MODE_DEACTIVATE_LTE` with `LTE_LC_FUNC_MODE_NORMAL` and `LTE_LC_FUNC_MODE_OFFLINE` does not change the behavior of the fault.

nrfxlib version: Tag v3.1.1 (Commit 3b210a24d3bc7ecfc268e0feab6436306b11e7cb)
Modem firmware: mfw_nrf91x1_2.0.4
Modem model: nRF9151-LACA

Parents
  • Hi,

    Thanks for the detailed report. NRF_MODEM_FAULT_HW_WD_RESET (0x2) means the modem firmware has become unresponsive and its internal hardware watchdog has reset the modem. And from your description, this is triggered when LTE is deactivated for a longer period and then re-activated. Can you try fully shutting down and re-initializing the modem in the following way as mentioned in the documentation:

    • When entering shipping mode: stop LTE users and call nrf_modem_shutdown()
    • When exiting shipping mode: call nrf_modem_init() and then reconnect LTE

    If the issue still reproduces after using this sequence, please enable modem traces and share them so it can be investigated further.

    Best Regards,
    Syed Maysum

  • > Can you try fully shutting down and re-initializing the modem in the following way as mentioned in the documentation:

    I unintentionally left out some information in the original post. The activation and de-activation code paths look like this:

    		LOG_INF("Device activated, enable LTE");
    		conn_mgr_all_if_up(false);
    		conn_mgr_all_if_connect(false);
    		...
    		LOG_INF("Device de-activated, disable LTE");
    		conn_mgr_all_if_disconnect(false);
    		conn_mgr_all_if_down(false);

    The connect/disconnect calls do indeed call the functional modes I mentioned, but the `if_up` and `if_down` calls get routed down to lte_net_if_enable and lte_net_if_disable, which are already fully shutting down and re-initialising the modem.

    This was confirmed by adding extra logging inside those functions, but also by the trace module logging (see below).

    > If the issue still reproduces after using this sequence, please enable modem traces and share them so it can be investigated further.

    I have enabled modem traces (attached below), however I am doubtful the trace will be useful in practice, since the tracing module suspends in response to the modem powering down, and there is no logic to re-enable it once it comes back up.

    [00:00:01.783,386] <inf> modem_trace_backend: Modem_trace RTT backend channel 1
    [00:00:01.783,416] <inf> nrf_modem_lib_trace: Trace thread ready
    [00:00:01.784,942] <inf> nrf_modem_lib_trace: Trace level override: 2
    ...
    [00:00:26.409,027] <inf> app: Device de-activated, disable LTE
    [00:00:27.173,004] <inf> epacket_udp: Network disconnected
    [00:00:27.189,422] <inf> nrf_modem_lib_trace: Modem was turned off, no more traces
    ...
    [00:02:02.850,982] <inf> app: Device activated, enable LTE
    [00:02:03.280,090] <err> nrf_modem: Modem has crashed, reason 0x2, PC: 0x468de
    [00:02:03.280,120] <err> modem_monitor: Modem fault, rebooting in 2 seconds...


     1770250638_nrf_modem_trace.zip

    After removing the calls to `conn_mgr_all_if_up/down` (and therefore not shutting down the modem entirely), I am able to transition between shipping and active modes without faults. However this doesn't explain the root cause of this issue, which is how a hardware watchdog can expire less than a second after booting from the shutdown state.

  • Hi Syed,

    Thank you for persisting with getting the reproducing sample working and for escalating internally.

    The Windows error is interesting, it would be amazing if you could submit a PR upstream to update https://docs.zephyrproject.org/latest/services/tfm/overview.html with the error that can occur on Windows and how to fix it, as I am certain you will not be the only person to run into it.

  • Hi,

    Thanks for the suggestion. The issue we observed was related to Windows symlink handling. If symlinks are not enabled before cloning the workspace, Git may check them out as regular files, which causes TFM include path issues during build. Enabling Windows Developer Mode and ensuring symlinks are properly created resolved the problem on our side.

    We will review this further and consider contributing if needed.

    Best Regards,
    Syed Maysum

  • Hi,

    This is to update you that our internal team were able to reproduce the issue and determined that the modem crash is linked to the RTT logging functionality. As the crash occurs when RTT logging is enabled and the modem is restarted after a specific idle period (around 65 seconds). However disabling RTT logging prevents the crash.

    Workaround could be to disable RTT logging for testing scenarios that involve modem shutdown and restart. And since RTT is primarily a development tool, we assess that this issue is unlikely to affect your end products.

    We are continuing to investigate this issue and will inform as soon as we have any update on it. Thanks

    Best Regards,
    Syed Maysum

  • Hi Syed, thanks for the update and the root cause analysis. It is good to know that the issue is triggered by RTT, and I agree with your comment that it is unlikely to affect end products.

    It would still be good to have resolved, as crashes during development both waste time investigating the issue and hinders testing the application once the issue is known.

  • Hi,

    Yes, our team are looking into it and we will keep you updated. Thanks

    Best Regards,
    Syed Maysum

Reply Children
No Data
Related