nRF9160 modem hard fault debugging

  • Hello,

My nRF9160 hard faults (i think?) when issuing a command to the modem, specifically this line:

query_modem("AT+CGSN", imei_buf, sizeof(imei_buf));

which then calls ncs function:

/**
 * @brief Send a formatted AT command to the modem
 *	  and receive the response into the supplied buffer.
 *
 * @param buf Buffer to receive the response into.
 * @param len Buffer length.
 * @param fmt Command format.
 * @param ... Format arguments.
 *
 * @retval  0 On "OK" responses.
 * @returns A positive value On "ERROR", "+CME ERROR", and "+CMS ERROR" responses.
 *	    The type of error can be distinguished using @c nrf_modem_at_err_type.
 *	    The error value can be retrieved using @c nrf_modem_at_err.
 * @retval -NRF_EPERM The Modem library is not initialized.
 * @retval -NRF_EFAULT @c buf or @c fmt are @c NULL.
 * @retval -NRF_ENOMEM Not enough shared memory for this request.
 * @retval -NRF_E2BIG The response is larger than the supplied buffer @c buf.
 * @retval -NRF_EINVAL If @c len is zero.
 */
int nrf_modem_at_cmd(void *buf, size_t len, const char *fmt, ...);

This leads to I think is a hard fault and the board resets, the modem never returns any values, so I can't see what is happening.

NCS 1.9.1

mfw 1.3.2

What might cause this?

How can I debug this?

Thank you

Parents Reply Children
  • Hi,

     

    Robert K said:
    Im not quite sure how to see what Thread that was running

    As previously mentioned:

    Håkon Alseth said:
    Content of R2, 537000870 (0x2001fba6), is in the RAM and must be checked in the build/zephyr/zephyr.map file manually to see which section/thread/etc that this might be.

    You can look for any of the faulting registers that has this 0x200XXXXX offset, as this will be in the RAM region.

    If you're lucky, you can see it in the call stack trace as well.

     

    Kind regards,

    Håkon

Related