<?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>nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91490/nrf9160-crash-on-assert-after-going-offline-then-online</link><description>Hello, I&amp;#39;m developing firmware for our custom board with a nRF9160. 
 The problem I&amp;#39;m having is that the modem crashes with error code 0x10 sometimes (read: about every 3rd or 4th time) after its turned off and on again and we try to connect to mqtt.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Sep 2022 10:47:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91490/nrf9160-crash-on-assert-after-going-offline-then-online" /><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/387049?ContentTypeID=1</link><pubDate>Tue, 20 Sep 2022 10:47:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66706e1c-88a2-4b4c-9d2f-662e64ccb3a0</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;I now have feed back from the modem team:&lt;/p&gt;
&lt;p&gt;Memory full causes assert:&lt;br /&gt; 00:01:58.639038 TR_ERROR_MEMORY_FULL Failed allocation: size 2028, from heap 0080a0e8&amp;nbsp;&lt;br /&gt; 00:01:58.639068 MDM_ERROR_ASSERT @PC:0x000d90bc&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The modem supports up to three simultaneous TLS sockets. In this case the opening of a third TLS socket causes assert due to memory full. You have somehow hit an issue which consumes more memory than expected.&lt;/p&gt;
&lt;p&gt;You would need to go over the application logic. It leaves TLS sockets open thus all reservations for memory stays there.&lt;/p&gt;
&lt;p&gt;The application should close all unused sockets to free modem resources. The modem is indicating that PDN connection is closed (SOCKET_RPC_CLOSED_NTF_MSG) but it is the application&amp;#39;s responsibility to close the socket.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/386905?ContentTypeID=1</link><pubDate>Mon, 19 Sep 2022 13:18:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89cab840-36fd-4672-bee4-ac3ba6a99151</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Thank you for the update! I will let the modem team comment and get back to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/386453?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 18:32:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:250ef9eb-9e50-47f8-b3c9-0187fb828b86</guid><dc:creator>Ludwig Linder</dc:creator><description>&lt;p&gt;Hi, we found the issue in our code that triggers the modem crash.&lt;/p&gt;
&lt;p&gt;We had a race condition that sometimes put the modem in flight mode before disconnecting mqtt (and therefore the socket). I figured this out because i spun up another MQTT server and on that server i instead get -12 (ENOMEM) when calling zsock_connect (inside of mqtt_connect) which according to some devzone post means that no sockets are available. (It&amp;#39;s not in any docs I can find but it makes sense)&lt;/p&gt;
&lt;p&gt;That means that the modem dosent clear sockets when in flight mode (which I assumed it did for some reason). It also seems that nrf_modem_lib_shutdown and nrf_modem_lib_init dosen&amp;#39;t clear sockets either because I get continued errors after one modem crash.&lt;/p&gt;
&lt;p&gt;But the modem crash is clearly some bug that triggers because the modem thinks it has sockets available but it actually dosent. I don&amp;#39;t have time to figure out what causes this but it presumably is because of combination of TLS cipher suites/certs and maybe port/hostname because that is all that differed between the mqtt servers i spun up.&lt;/p&gt;
&lt;p&gt;But you can assume our issue is fixed but I would give it to your modem team as a bug report ^^&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/386438?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 14:49:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88f79135-43a3-4ab3-89db-500b56942268</guid><dc:creator>Mark Olsson</dc:creator><description>&lt;p&gt;Our product currently uses B0 (rev1) silicon so we have to use &amp;#39;&lt;span&gt;mfw1.2.x&amp;#39;.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/386420?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 13:55:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0a26111-c4c0-49aa-8c75-e68fe5d786c3</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;We would also recommend to make the move to mfw1.3.2, unless there is any specific reason to use mfw1.2.x&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/386419?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 13:49:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b39594f6-44c8-489a-a177-8e75cbf3db3c</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Ludwig,&lt;/p&gt;
&lt;p&gt;Would you be able to provide logs/modem trace from when using mfw1.3.2?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/386066?ContentTypeID=1</link><pubDate>Tue, 13 Sep 2022 22:00:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87f8ee40-14cd-46be-9c60-73067dbd388b</guid><dc:creator>Ludwig Linder</dc:creator><description>&lt;p&gt;Hi Helsing, thank you. :) Tell me if theres any other info I could provide that might be of help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/385937?ContentTypeID=1</link><pubDate>Tue, 13 Sep 2022 11:33:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b144c79-55f9-4fac-be72-c25f6da00b83</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Ludwig,&lt;/p&gt;
[quote user="Ludwig Linder"]The nrf9160dk I have has a B1 nrf9160.[/quote]
&lt;p&gt;Sorry, my mistake. Yes, SiP Revision B2, mfw1.3.2 and nRF Connect SDK v2.0.2 is a valid combination. I am now looking further into what could be causing the modem error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/385767?ContentTypeID=1</link><pubDate>Mon, 12 Sep 2022 14:02:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7c91523-d6d7-4c41-94ec-60fd4aec433a</guid><dc:creator>Ludwig Linder</dc:creator><description>&lt;p&gt;My nrf9160dk is revision 2 and that&amp;#39;s where I got the latest log from. (using mfw1.3.2)&lt;/p&gt;
&lt;p&gt;The first post I wrote was when I was testing on a revision 1 (also called b0). However, in order to show you that this is a modem error I used my nrf9160dk b1 (also called revision 2) which I wrote in my reply to try with mfw1.3.2.&lt;/p&gt;
&lt;p&gt;And to be clear, this nrf9160dk had version 1.2.3 before I upgraded to mfw1.3.2 and I havent downgraded it at anytime.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/385758?ContentTypeID=1</link><pubDate>Mon, 12 Sep 2022 13:35:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad51a79e-5013-467a-bab7-c0aa60ba4b32</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Unfortunately, the modem firmware you upgraded to is not compatible with the nRF9160 SiP Revision 1.&amp;nbsp; You also need to be aware that it is not recommended to downgrade to some of the older modem firmware versions. From the &lt;a href="https://www.nordicsemi.com/Products/nRF9160/Download#infotabs"&gt;changelog &lt;/a&gt;for mfw 1.3.2:&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Before applying this version:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Note that this modem firmware is targeted&amp;nbsp;&lt;strong&gt;nRF9160 SiP Revision 2&amp;nbsp;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;It can be used for nRF9160 SiP Revision 1, but&amp;nbsp;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;only for testing and development&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;It&amp;nbsp;&lt;strong&gt;cannot&lt;/strong&gt;&amp;nbsp;be used for engineering samples of Revision 1 (&lt;em&gt;e.g. DKs or Thingy:91 with version older than v0.9.0&lt;/em&gt;)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;After you upgrade to MFW 1.3.x it is&amp;nbsp;&lt;strong&gt;not recommended to&amp;nbsp;downgrade to MFW 1.2.x or MFW 1.1.x.&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;(potential file system issues)&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1662989624238v1.png" alt=" " /&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/385349?ContentTypeID=1</link><pubDate>Thu, 08 Sep 2022 14:59:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09d3e9c2-d4cc-4f19-b94a-67f7ba6b4a6d</guid><dc:creator>Ludwig Linder</dc:creator><description>&lt;p&gt;The nrf9160dk I have has a B1 nrf9160.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Using mfw1.3.2 on it I instead get the following error during same circumstances:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:03:11.744,506] &amp;lt;err&amp;gt; modem_module: Modem error: 0x4, PC: 0xe4648&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/385063?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2022 14:08:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19f08fea-f762-42bf-985d-9a1c9e7ea31c</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Ludwig,&lt;/p&gt;
&lt;p&gt;Sorry I did not see this right away: It looks like you are using a combination of modem firmware and nRF Connect SDK versions that are not supported:&lt;/p&gt;
&lt;p&gt;Please see this matrix showing compatibility: &lt;a href="https://infocenter.nordicsemi.com/topic/comp_matrix_nrf9160/COMP/nrf9160/nrf9160_modem_fw.html?cp=2_0_3_5"&gt;https://infocenter.nordicsemi.com/topic/comp_matrix_nrf9160/COMP/nrf9160/nrf9160_modem_fw.html?cp=2_0_3_5&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;In general, it is also recommended that you upgrade to revision 2(B1).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/384657?ContentTypeID=1</link><pubDate>Mon, 05 Sep 2022 17:06:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4de64fa-28ce-4af6-b511-efb6eb750258</guid><dc:creator>Ludwig Linder</dc:creator><description>&lt;p&gt;We are using v2.0.2 of the nRF Connect SDK.&lt;/p&gt;
&lt;p&gt;The problem with PSM is that not all networks support it and we need to support most networks. We would be offering a very poor service if we have to pick and choose customers based on what networks are near them.&lt;/p&gt;
&lt;p&gt;For example even the network which im testing against is not supporting PSM:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.802,154] &amp;lt;dbg&amp;gt; modem_module: configure_low_power: PSM requested
[00:00:00.809,906] &amp;lt;inf&amp;gt; modem_module: nRF9160 modem firmware version: mfw_nrf9160_1.2.7
[00:00:00.810,485] &amp;lt;inf&amp;gt; app_event_manager: MODEM_EVT_INITIALIZED
[00:00:00.861,511] &amp;lt;inf&amp;gt; app_event_manager: MODEM_EVT_LTE_CONNECTING
[00:00:00.861,694] &amp;lt;inf&amp;gt; modem_module: LTE attempting to connect... waiting 120 seconds before timeout
[00:00:00.861,755] &amp;lt;dbg&amp;gt; modem_module: state_set: State transition STATE_DISCONNECTED --&amp;gt; STATE_CONNECTING
[00:00:02.867,492] &amp;lt;dbg&amp;gt; modem_module: modem_rsrp_handler: Incoming RSRP status message, RSRP value is -96
[00:00:02.867,584] &amp;lt;dbg&amp;gt; lte_lc: at_handler_cereg: +CEREG notification: +CEREG: 2,&amp;quot;2724&amp;quot;,&amp;quot;01ADDA0B&amp;quot;,7,0,0,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;

[00:00:02.867,858] &amp;lt;dbg&amp;gt; lte_lc_helpers: parse_cereg: Network registration status: 2
[00:00:02.867,889] &amp;lt;dbg&amp;gt; lte_lc_helpers: parse_cereg: LTE mode: 7
[00:00:02.867,980] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch: Dispatching events:
[00:00:02.867,980] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch:  - handler=0x000587B9
[00:00:02.868,377] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch:  - handler=0x0003BF09
[00:00:02.868,408] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch: Done
[00:00:02.868,438] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch: Dispatching events:
[00:00:02.868,438] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch:  - handler=0x000587B9
[00:00:02.868,469] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch:  - handler=0x0003BF09
[00:00:02.868,499] &amp;lt;dbg&amp;gt; modem_module: lte_evt_handler: LTE cell changed: Cell ID: 28170763, Tracking area: 10020
[00:00:02.868,499] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch: Done
[00:00:02.868,530] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch: Dispatching events:
[00:00:02.868,530] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch:  - handler=0x000587B9
[00:00:02.868,560] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch:  - handler=0x0003BF09
[00:00:02.868,560] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch: Done
[00:00:02.868,682] &amp;lt;inf&amp;gt; app_event_manager: MODEM_EVT_LTE_RSRP_UPDATE
[00:00:02.868,835] &amp;lt;inf&amp;gt; app_event_manager: MODEM_EVT_LTE_DISCONNECTED
[00:00:02.953,704] &amp;lt;dbg&amp;gt; lte_lc: at_handler_cscon: +CSCON notification
[00:00:02.953,857] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch: Dispatching events:
[00:00:02.953,857] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch:  - handler=0x000587B9
[00:00:02.953,887] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch:  - handler=0x0003BF09
[00:00:02.953,887] &amp;lt;dbg&amp;gt; modem_module: lte_evt_handler: RRC mode: Connected
[00:00:02.953,918] &amp;lt;dbg&amp;gt; lte_lc_helpers: event_handler_list_dispatch: Done
[00:00:06.714,813] &amp;lt;dbg&amp;gt; lte_lc: at_handler_cereg: +CEREG notification: +CEREG: 5,&amp;quot;2724&amp;quot;,&amp;quot;01ADDA0B&amp;quot;,7,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Either way, putting the modem in flight mode should be supported, right? And for some reason the modem is crashing&amp;nbsp;because of that.&lt;/p&gt;
&lt;p&gt;I collected a modem trace on the nrf9160dk with firmware 1.2.3. There i get&amp;nbsp;&lt;em&gt;Modem error: 0x10, PC: 0xd90bc&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve noticed that the modem crash happends during TLS negotiation. Specifically when the modem is supposed to send client key exchange. I&amp;#39;ve verified traffic logs from our operator.&lt;/p&gt;
&lt;p&gt;Attached is a modem trace from a nrf9160dk running fw1.2.3. The last thing i can see when converting to pcap is the &amp;quot;Certificate&amp;quot; sending to our server and then the ACK back. After that it crashes. Hopefully you can use the modem error and the trace to locate why?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/trace_2D00_2022_2D00_09_2D00_05T16_2D00_56_2D00_31.872Z.bin"&gt;devzone.nordicsemi.com/.../trace_2D00_2022_2D00_09_2D00_05T16_2D00_56_2D00_31.872Z.bin&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/384204?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2022 17:54:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3e320a9-e3ee-48ca-829c-23b9c1b42af6</guid><dc:creator>Mark Olsson</dc:creator><description>&lt;p&gt;I&amp;#39;m working with Ludwig on this project.&lt;/p&gt;
&lt;p&gt;We want to sleep for 24 hours unless we&amp;#39;re woken by an external interrupt.&lt;/p&gt;
&lt;p&gt;But the main issue is why we&amp;#39;re getting an assert error at PC:&amp;nbsp;0xda418, could you explain what the code is trying to do at that point?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 crash on assert after going offline then online</title><link>https://devzone.nordicsemi.com/thread/384153?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2022 13:17:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc0041f4-092d-42fd-832c-d5de32e3519a</guid><dc:creator>helsing</dc:creator><description>&lt;p&gt;Hi Ludwig,&lt;/p&gt;
&lt;p&gt;What is the goal with this approach for entering sleep? Have you considered PSM (Power Saving Mode)? PSM is efficient unless you would like to sleep for a very long time. This post covers &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/57959/nrf91-power-saving-modes"&gt;important aspects when considering PSM&lt;/a&gt;. (The post is three years old, so it might contain some outdated information.)&lt;/p&gt;
&lt;p&gt;Also check out this post commenting on &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/91006/nrf9160-power-on-sleep-waking-without-discrete-event-or-interrupt."&gt;sleep mode in Zephyr&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Which nRF Connect SDK are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>