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

Related