<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sporadic Reboots During Idle Mode on nRF9160</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114900/sporadic-reboots-during-idle-mode-on-nrf9160</link><description>I am using a Mikroe development board with the nRF9160 to establish an LTE connection and send MQTT messages to a broker. The application successfully connects to the network, establishes the MQTT connection, and sends messages with a 60-second interval</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Sep 2024 05:38:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114900/sporadic-reboots-during-idle-mode-on-nrf9160" /><item><title>RE: Sporadic Reboots During Idle Mode on nRF9160</title><link>https://devzone.nordicsemi.com/thread/503659?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2024 05:38:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd11941b-d754-4e72-8f8a-47bd5345e36e</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;I didn&amp;#39;t recognize, that the other ticket is yours as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/113973/lte-nb-iot-connection-with-mikroe-lte-iot-4-click"&gt;LTE/NB-IOT connection with MIKROE LTE IOT 4 CLICK&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The good news:&lt;/p&gt;
&lt;p&gt;My MIKROE LTE IOT 4 click runs stable over weeks.&lt;/p&gt;
&lt;p&gt;I guess, your wiring and so the power supply is the issues.&lt;/p&gt;
&lt;p&gt;For my experiments I found a USB + power supply board, which works well (see my last comment in the other ticket).&lt;/p&gt;
&lt;p&gt;I also send you a private message. If you like, just exchange ours apps and see, how they work on the boards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sporadic Reboots During Idle Mode on nRF9160</title><link>https://devzone.nordicsemi.com/thread/503649?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2024 02:01:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7381c7d0-9962-42f9-b6f5-5cbe6d62c34f</guid><dc:creator>Luis Santos</dc:creator><description>&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;As you mentioned in the previous conversation #331671, I am using too a Mikroe LTE IoT 4 Click. I reviewed the schematic and compared it with the one provided in the datasheet, and everything seems correct.&lt;/p&gt;
&lt;p&gt;The strange part is that sometimes my application enters a restart loop, while other times the restart can take hours to happen. For instance, yesterday, the system restarted every 10 seconds&amp;nbsp;and sometimes&amp;nbsp;it&amp;rsquo;s not happening anymore.&lt;br /&gt;&lt;br /&gt;When a run my application, i got the output:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: Current reset cause: 00000003
I: RESET_PIN
I: RESET_SOFTWARE
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
I: RRC mode: Connected
I: Network registration status: Connected - home network
I: Connected to LTE network
I: mqttInit ..
I: IPv4 Address found 20.82.16.164
I: client_id = nrf-358447177549400
I: Connection to broker using mqtt_connect
I: MQTT client connected
I: Subscribing on &amp;quot;stlab/down/cmd&amp;quot;
I: SUBACK packet id: 1234
I: RRC mode: Idle
I: Publishing &amp;quot;1&amp;quot; on &amp;quot;stlab/up/status&amp;quot;
I: RRC mode: Connected
I: RRC mode: Idle
I: Publishing &amp;quot;1&amp;quot; on &amp;quot;stlab/up/status&amp;quot;
I: RRC mode: Connected
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
I: RRC mode: Connected
I: RRC mode: Idle
I: RRC mode: Connected
I: RRC mode: Idle
I: RRC mode: Connected
I: RRC mode: Idle
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
I: RRC mode: Connected
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
I: RRC mode: Connected
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
I: No reset cause or error reading reset cause (error: 0)
I: lteInit ..
I: RRC mode: Connected
I: Network registration status: Connected - home network
I: Connected to LTE network
I: mqttInit ..
I: IPv4 Address found 20.82.16.164
I: client_id = nrf-358447177549400
I: Connection to broker using mqtt_connect
I: MQTT client connected
I: Subscribing on &amp;quot;stlab/down/cmd&amp;quot;
I: SUBACK packet id: 1234
I: RRC mode: Idle
I: Publishing &amp;quot;1&amp;quot; on &amp;quot;stlab/up/status&amp;quot;
I: RRC mode: Connected
I: RRC mode: Idle
I: Publishing &amp;quot;1&amp;quot; on &amp;quot;stlab/up/status&amp;quot;
I: RRC mode: Connected
I: RRC mode: Idle
I: Publishing &amp;quot;1&amp;quot; on &amp;quot;stlab/up/status&amp;quot;
I: RRC mode: Connected
I: RRC mode: Idle
I: Publishing &amp;quot;1&amp;quot; on &amp;quot;stlab/up/status&amp;quot;
I: RRC mode: Connected
I: RRC mode: Idle
I: Publishing &amp;quot;1&amp;quot; on &amp;quot;stlab/up/status&amp;quot;
I: RRC mode: Connected
I: RRC mode: Idle
I: Publishing &amp;quot;1&amp;quot; on &amp;quot;stlab/up/status&amp;quot;
I: RRC mode: Connected
I: RRC mode: Idle
...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The reboots don&amp;#39;t return the code mapping.&lt;/p&gt;
&lt;p&gt;I ran this code earlier today, but no reboot occurred like now.&lt;/p&gt;
&lt;p&gt;I observed that when I use a 5-second interval between messages, reboots occur very sporadically. On this case, the modem doesn&amp;#39;t go into RCC Idle.&lt;/p&gt;
&lt;p&gt;My setup is:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/WhatsApp-Image-2024_2D00_09_2D00_24-at-22.55.49.jpeg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="flex max-w-full flex-col flex-grow"&gt;
&lt;div dir="auto" data-message-author-role="assistant" data-message-id="4b458e0b-2c24-49a5-8c42-29758039090f"&gt;
&lt;div&gt;
&lt;div class="markdown prose w-full break-words dark:prose-invert light"&gt;
&lt;p&gt;Let me know if you&amp;#39;d like any further adjustments!&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;main.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;ncs_version.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;

#include &amp;lt;zephyr/drivers/hwinfo.h&amp;gt;
#include &amp;lt;zephyr/drivers/watchdog.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;zephyr/logging/log_ctrl.h&amp;gt;
#include &amp;lt;zephyr/sys/__assert.h&amp;gt;
#include &amp;lt;zephyr/sys/reboot.h&amp;gt;

#include &amp;quot;lte.h&amp;quot;
#include &amp;quot;mqtt.h&amp;quot;

LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);

static atomic_t read_reset_cause = ATOMIC_INIT(0);

static volatile uint32_t reset_cause = 0;
static volatile int32_t reset_error = 0;

uint32_t appl_reset_cause(int *flags, uint16_t *reboot_code) {
    uint32_t cause = 0;

    if (atomic_cas(&amp;amp;read_reset_cause, 0, 1)) {
        reset_error = hwinfo_get_reset_cause(&amp;amp;cause);
        if (reset_error == 0 &amp;amp;&amp;amp; cause) {
            LOG_INF(&amp;quot;Current reset cause: %08x&amp;quot;, cause);

            if (cause &amp;amp; RESET_PIN) {
                LOG_INF(&amp;quot;RESET_PIN&amp;quot;);
            }
            if (cause &amp;amp; RESET_SOFTWARE) {
                LOG_INF(&amp;quot;RESET_SOFTWARE&amp;quot;);
            }
            if (cause &amp;amp; RESET_BROWNOUT) {
                LOG_INF(&amp;quot;RESET_BROWNOUT&amp;quot;);
            }
            if (cause &amp;amp; RESET_POR) {
                LOG_INF(&amp;quot;RESET_POR&amp;quot;);
            }
            if (cause &amp;amp; RESET_WATCHDOG) {
                LOG_INF(&amp;quot;WATCHDOG&amp;quot;);
            }
            if (cause &amp;amp; RESET_DEBUG) {
                LOG_INF(&amp;quot;DEBUG&amp;quot;);
            }
            if (cause &amp;amp; RESET_SECURITY) {
                LOG_INF(&amp;quot;RESET_SECURITY&amp;quot;);
            }
            if (cause &amp;amp; RESET_LOW_POWER_WAKE) {
                LOG_INF(&amp;quot;LOWPOWER&amp;quot;);
            }
            if (cause &amp;amp; RESET_CPU_LOCKUP) {
                LOG_INF(&amp;quot;CPU&amp;quot;);
            }
            if (cause &amp;amp; RESET_PARITY) {
                LOG_INF(&amp;quot;RESET_PARITY&amp;quot;);
            }
            if (cause &amp;amp; RESET_PLL) {
                LOG_INF(&amp;quot;RESET_PLL&amp;quot;);
            }
            if (cause &amp;amp; RESET_CLOCK) {
                LOG_INF(&amp;quot;RESET_CLOCK&amp;quot;);
            }
            if (cause &amp;amp; RESET_HARDWARE) {
                LOG_INF(&amp;quot;RESET_HARDWARE&amp;quot;);
            }
            if (cause &amp;amp; RESET_USER) {
                LOG_INF(&amp;quot;RESET_USER&amp;quot;);
            }
            if (cause &amp;amp; RESET_TEMPERATURE) {
                LOG_INF(&amp;quot;RESET_TEMPERATURE&amp;quot;);
            }
        } else {
            LOG_INF(&amp;quot;No reset cause or error reading reset cause (error: %d)&amp;quot;, reset_error);
        }
    }
    
    return cause;
}

int main(void) {

	int reset_cause = 0;
	uint16_t reboot_cause = 0;

	appl_reset_cause(&amp;amp;reset_cause, &amp;amp;reboot_cause);

	k_sleep(K_MSEC(100));

	lteInit();	

	k_sleep(K_MSEC(100));

	mqttInit();

	return 0;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sporadic Reboots During Idle Mode on nRF9160</title><link>https://devzone.nordicsemi.com/thread/503496?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2024 05:20:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:075aab87-7fc7-4232-98a9-ce9a7b73eb68</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;If you have doubts, add a logging statement at line 100 and print the &amp;quot;cause&amp;quot;. If that&amp;#39;s 0, it&amp;#39;s a POR. And ensure, that you not hwinfo_clear_reset_cause and then read it again ;-). The times in the log itself after booting are not that useful. Maybe you enable the &amp;quot;serial terminal&amp;quot; to add times, if possible (I use linux/GTKTerm, which offers that).&lt;/p&gt;
&lt;p&gt;If that verifies, that you read 0 as reset cause, then it&amp;#39;s a POR.&lt;/p&gt;
&lt;p&gt;Do you use a custom board? Do you have the capacitors close to the modem? Do you supply both VDD and VDD_GPIO from the regulated 3.3V output (you may, up to a certain voltage, supply VDD direct and only VDD_GPIO via the regulated output)?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure, why a POR happens in Idle. I would guess, it&amp;#39;s triggered by a wakeup.&lt;/p&gt;
&lt;p&gt;Anyway, I guess you have some ideas to investigate.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sporadic Reboots During Idle Mode on nRF9160</title><link>https://devzone.nordicsemi.com/thread/503487?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2024 03:51:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38e2e2bb-2254-4a31-ad0b-7abdfcf5b657</guid><dc:creator>Luis Santos</dc:creator><description>&lt;p&gt;I am now using a 5V, 1A power supply with a step-down converter to achieve a 3.3V output.&lt;/p&gt;
&lt;p&gt;I briefly adapted your code into my main source, and here is the output I got:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;ncs_version.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;

#include &amp;lt;zephyr/drivers/hwinfo.h&amp;gt;
#include &amp;lt;zephyr/drivers/watchdog.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;zephyr/logging/log_ctrl.h&amp;gt;
#include &amp;lt;zephyr/sys/__assert.h&amp;gt;
#include &amp;lt;zephyr/sys/reboot.h&amp;gt;

#include &amp;quot;lte.h&amp;quot;
#include &amp;quot;mqtt.h&amp;quot;

LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);

static atomic_t shutdown_delay = ATOMIC_INIT(-1);
static atomic_t reboot_cause = ATOMIC_INIT(-1);


static atomic_t read_reset_cause = ATOMIC_INIT(0);

static const struct device *const wdt = DEVICE_DT_GET_OR_NULL(DT_ALIAS(watchdog0));
static int wdt_channel_id = -1;

static volatile uint32_t reset_cause = 0;
static volatile int32_t reset_error = 0;

#define ERROR_CODE_INIT_NO_LTE 0x0000
#define ERROR_CODE_INIT_NO_DTLS 0x1000
#define ERROR_CODE_INIT_NO_SUCCESS 0x2000
#define ERROR_CODE_OPEN_SOCKET 0x3000
#define ERROR_CODE_TOO_MANY_FAILURES 0x4000
#define ERROR_CODE_MODEM_FAULT 0x5000
#define ERROR_CODE_REBOOT_CMD 0x6000
#define ERROR_CODE_REBOOT_MANUAL 0x7000
#define ERROR_CODE_UPDATE 0x8000
#define ERROR_CODE_LOW_VOLTAGE 0x9000
#define ERROR_CODE_REINIT_CMD 0xA000

#define ERROR_CODE(BASE, ERR) ((BASE &amp;amp; 0xf000) | (ERR &amp;amp; 0xfff))
#define ERROR_CLASS(ERR) (ERR &amp;amp; 0xf000)
#define ERROR_DETAIL(ERR) (ERR &amp;amp; 0xfff)

#define ERROR_CLASS_IS_REBOOOT(ERR) (ERROR_CLASS(ERR) == ERROR_CODE_REBOOT_CMD || ERROR_CLASS(ERR) == ERROR_CODE_REINIT_CMD)

#define FLAG_REBOOT_RETRY 1
#define FLAG_REBOOT_LOW_VOLTAGE 2
#define FLAG_REBOOT 4
#define FLAG_RESET 8
#define FLAG_POWER_ON 16

#define REBOOT_HISTORY 4
#define REBOOT_TIME_SIZE 6
#define REBOOT_CODE_SIZE sizeof(uint16_t)
#define REBOOT_SIZE (REBOOT_TIME_SIZE + REBOOT_CODE_SIZE)

static uint8_t reboot_codes[REBOOT_SIZE * REBOOT_HISTORY];

static K_MUTEX_DEFINE(settings_mutex);

int appl_settings_get_reboot_code(size_t index, int64_t *time, uint16_t *code)
{
   int res = 0;
   uint8_t buf[sizeof(reboot_codes)];

   index *= REBOOT_SIZE;
   if (index + REBOOT_SIZE &amp;lt;= sizeof(buf)) {
      k_mutex_lock(&amp;amp;settings_mutex, K_FOREVER);
      memmove(buf, reboot_codes, sizeof(reboot_codes));
      k_mutex_unlock(&amp;amp;settings_mutex);
      if (sys_get_be48(&amp;amp;buf[index])) {
         if (time) {
            uint64_t time_s = sys_get_be48(&amp;amp;buf[index]);
            if (time_s == 1) {
               *time = 0;
            } else {
               *time = time_s * MSEC_PER_SEC;
            }
         }
         if (code) {
            *code = sys_get_be16(&amp;amp;buf[index + REBOOT_TIME_SIZE]);
         }
         res = 1;
      }
   }

   return res;
}

uint32_t appl_reset_cause(int *flags, uint16_t *reboot_code)
{
   uint32_t cause = 0;
   if (atomic_cas(&amp;amp;read_reset_cause, 0, 1)) {
      reset_error = hwinfo_get_reset_cause(&amp;amp;cause);
      if (!reset_error) {
         hwinfo_clear_reset_cause();
         if (!cause) {
            // the nRF9160 uses 0 (no reset cause) to indicate POR
            uint32_t supported = 0;
            hwinfo_get_supported_reset_cause(&amp;amp;supported);
            if (!(supported &amp;amp; RESET_POR)) {
               LOG_INF(&amp;quot;nRF9160 no reset cause, add POR&amp;quot;);
               cause = RESET_POR;
            }
         }
         reset_cause = cause;
      }
   }
   LOG_INF(&amp;quot;Reset cause 0x%04x&amp;quot;, reset_cause);
   if (reset_cause) {
      // supported flags: 0x1b3
      if (reset_cause &amp;amp; RESET_PIN) {
         LOG_INF(&amp;quot;PIN&amp;quot;);
         if (flags) {
            *flags |= FLAG_RESET;
         }
      }
      if (reset_cause &amp;amp; RESET_SOFTWARE) {
         uint16_t code = 0;
         int rc = appl_settings_get_reboot_code(0, NULL, &amp;amp;code);
         int reboot = ERROR_CLASS(code);
         int detail = ERROR_DETAIL(code);
         if (rc &amp;gt; 0 &amp;amp;&amp;amp; reboot == ERROR_CODE_TOO_MANY_FAILURES) {
            LOG_INF(&amp;quot;Reboot 1.&amp;quot;);
            if (!detail) {
               code = ERROR_CODE(ERROR_CODE_TOO_MANY_FAILURES, 1);
            }
            if (flags) {
               *flags |= FLAG_REBOOT_RETRY;
            }
         } else if (rc &amp;gt; 0 &amp;amp;&amp;amp; reboot == ERROR_CODE_INIT_NO_SUCCESS) {
            LOG_INF(&amp;quot;Reboot %u.&amp;quot;, detail);
            if (flags) {
               *flags |= FLAG_REBOOT_RETRY;
            }
         } else if (rc &amp;gt; 0 &amp;amp;&amp;amp; reboot == ERROR_CODE_LOW_VOLTAGE) {
            LOG_INF(&amp;quot;Reboot low voltage.&amp;quot;);
            if (flags) {
               *flags |= FLAG_REBOOT_LOW_VOLTAGE;
            }
         } else {
            LOG_INF(&amp;quot;Reboot&amp;quot;);
            if (flags) {
               *flags |= FLAG_REBOOT;
            }
         }
         if (rc &amp;gt; 0 &amp;amp;&amp;amp; reboot_code) {
            *reboot_code = code;
         }
      }
      if (reset_cause &amp;amp; RESET_POR) {
         LOG_INF(&amp;quot;Power-On&amp;quot;);
         if (flags) {
            *flags |= FLAG_POWER_ON;
         }
      }
      if (reset_cause &amp;amp; RESET_WATCHDOG) {
         LOG_INF(&amp;quot;WATCHDOG&amp;quot;);
      }
      if (reset_cause &amp;amp; RESET_DEBUG) {
         LOG_INF(&amp;quot;DEBUG&amp;quot;);
      }
      if (reset_cause &amp;amp; RESET_LOW_POWER_WAKE) {
         LOG_INF(&amp;quot;LOWPOWER&amp;quot;);
      }
      if (reset_cause &amp;amp; RESET_CPU_LOCKUP) {
         LOG_INF(&amp;quot;CPU&amp;quot;);
      }
   } else {
      LOG_INF(&amp;quot;none&amp;quot;);
   }
   return reset_cause;
}


int main(void) {

	int reset_cause = 0;
	uint16_t reboot_cause = 0;

	appl_reset_cause(&amp;amp;reset_cause, &amp;amp;reboot_cause);

	k_sleep(K_MSEC(100));

	lteInit();	

	k_sleep(K_MSEC(100));

	mqttInit();

	return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
[00:00:00.253,936] &amp;lt;inf&amp;gt; main: nRF9160 no reset cause, add POR
[00:00:00.253,936] &amp;lt;inf&amp;gt; main: Reset cause 0x0008
[00:00:00.253,967] &amp;lt;inf&amp;gt; main: Power-On
[00:00:00.354,034] &amp;lt;inf&amp;gt; lte: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
[00:00:00.253,784] &amp;lt;inf&amp;gt; main: nRF9160 no reset cause, add POR
[00:00:00.253,784] &amp;lt;inf&amp;gt; main: Reset cause 0x0008
[00:00:00.253,814] &amp;lt;inf&amp;gt; main: Power-On
[00:00:00.353,881] &amp;lt;inf&amp;gt; lte: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
[00:00:00.253,631] &amp;lt;inf&amp;gt; main: nRF9160 no reset cause, add POR
[00:00:00.253,631] &amp;lt;inf&amp;gt; main: Reset cause 0x0008
[00:00:00.253,662] &amp;lt;inf&amp;gt; main: Power-On
[00:00:00.353,729] &amp;lt;inf&amp;gt; lte: lteInit ..
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
[00:00:00.253,814] &amp;lt;inf&amp;gt; main: nRF9160 no reset cause, add POR
[00:00:00.253,814] &amp;lt;inf&amp;gt; main: Reset cause 0x0008
[00:00:00.253,845] &amp;lt;inf&amp;gt; main: Power-On
[00:00:00.353,912] &amp;lt;inf&amp;gt; lte: lteInit ..&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could this still be happening because of a power supply issue?&lt;/p&gt;
&lt;h2 id="mcetoc_1i8h2fee60" class="memtitle"&gt;&lt;span class="permalink"&gt;&lt;a href="https://docs.nordicsemi.com/bundle/zephyr-apis-latest/page/group_hwinfo_interface.html#ga21fa7b8a5ec2e1c077dbc453ca3a4265"&gt;◆&amp;nbsp;&lt;/a&gt;&lt;/span&gt;RESET_POR&lt;/h2&gt;
&lt;div class="memitem"&gt;
&lt;div class="memproto"&gt;
&lt;div class="table-wrap"&gt;
&lt;table class="memname"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="memname"&gt;#define RESET_POR&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a class="el" href="https://docs.nordicsemi.com/bundle/zephyr-apis-latest/page/group_sys-util.html#ga3a8ea58898cb58fc96013383d39f482c" data-bundleid="zephyr-apis-latest" data-navpath="group_sys-util.html"&gt;BIT&lt;/a&gt;(3)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="memdoc"&gt;
&lt;p&gt;&lt;code&gt;#include &amp;lt;&lt;a class="el" href="https://docs.nordicsemi.com/bundle/zephyr-apis-latest/page/hwinfo_8h.html" data-bundleid="zephyr-apis-latest" data-navpath="hwinfo_8h.html"&gt;zephyr/drivers/hwinfo.h&lt;/a&gt;&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Power-on reset (POR)&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sporadic Reboots During Idle Mode on nRF9160</title><link>https://devzone.nordicsemi.com/thread/503342?ContentTypeID=1</link><pubDate>Sun, 22 Sep 2024 13:07:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:310d1cea-a2f6-430c-8bfe-023961a12eb9</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Such reboot are in my experience either caused by an program fault, a watchdog reset or a &amp;quot;power on&amp;quot; reset, when the power supply/battery doesn&amp;#39;t work proper.&lt;/p&gt;
&lt;p&gt;&amp;gt; 3. How can I debug this issue and pinpoint the cause of the restarts? Are there specific steps or diagnostics I should be focusing on?&lt;/p&gt;
&lt;p&gt;The reset cause may help to narrow the scope.&lt;/p&gt;
&lt;p&gt;prj.conf:&lt;/p&gt;
&lt;p&gt;CONFIG_HWINFO=y&lt;/p&gt;
&lt;p&gt;src:&lt;br /&gt;&lt;a href="https://github.com/boaks/zephyr-coaps-client/blob/main/src/appl_diagnose.c#L181-L264"&gt;hwinfo_get_reset_cause&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; 1. What could be causing these reboots, particularly when the modem is in Idle mode?&lt;/p&gt;
&lt;p&gt;Once you know, the reset cause, the answer may be easier. e.g. if it&amp;#39;s the watchdog and you use an 60s watchdog interval, then you may fix it by extending the a little, say 70s. If it&amp;#39;s a power on reset, then charge the battery.&lt;/p&gt;
&lt;p&gt;&amp;gt; 2.&amp;nbsp; Is it normal for the application to restart if there&amp;#39;s an issue with the modem?&lt;/p&gt;
&lt;p&gt;No, therefore I guess, there is an issue with your application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>