<?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: Serial LTE Modem app eventually crashes after switching to DATA and AT modes numerous times</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93231/nrf9160-serial-lte-modem-app-eventually-crashes-after-switching-to-data-and-at-modes-numerous-times</link><description>Hi, 
 We used the SLM (serial LTE modem) application in our custom board with NRF9160 configured as a slave chip and interfaced with an STM32 MCU via UART interface. The SDK version we are using is v1.8.0. 
 Our STM32 MCU usually sends UDP packet via</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Nov 2022 14:27:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93231/nrf9160-serial-lte-modem-app-eventually-crashes-after-switching-to-data-and-at-modes-numerous-times" /><item><title>RE: NRF9160: Serial LTE Modem app eventually crashes after switching to DATA and AT modes numerous times</title><link>https://devzone.nordicsemi.com/thread/397912?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2022 14:27:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0020f9a2-f410-4fd2-9bbf-a5677d6aa846</guid><dc:creator>ronald-blackline</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry took me a while to respond back. And to quickly answer your questions, we are suspecting the issue is related to UART RX and that fix you reference might be solution we are looking for. Also, our SLM is based on NCS v1.8.0 SDK. We are planning to move to the latest SDK soon but not now and I will keep this ticket updated with our new findings.&lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Ronald&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160: Serial LTE Modem app eventually crashes after switching to DATA and AT modes numerous times</title><link>https://devzone.nordicsemi.com/thread/395625?ContentTypeID=1</link><pubDate>Mon, 14 Nov 2022 16:29:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18cd6d8c-0504-449b-8514-75d603a7754f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My apologies.&lt;/p&gt;
&lt;p&gt;The only place the uart_tx function should return -16 (EBUSY) is if the transmitter is already active:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.0-ncs1/drivers/serial/uart_nrfx_uarte.c#L710"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.0-ncs1/drivers/serial/uart_nrfx_uarte.c#L710&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Q1: However, since there&amp;#39;s is a larger time gap between the transfers, could the issue you&amp;#39;re seeing be related to the UART RX?&lt;/p&gt;
&lt;p&gt;More specifically, this&amp;nbsp;fix in newer NCS versions (present in ncs v2.0.0):&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/commit/ba6d9139bbbda3211e0c1f65f4ccca0719f17fa5#diff-ad7eb7605ae0d455f16d9a4183fcbaca5249e8e6f8cc7338c5dea4f1d48bd453L869-R868"&gt;https://github.com/nrfconnect/sdk-zephyr/commit/ba6d9139bbbda3211e0c1f65f4ccca0719f17fa5#diff-ad7eb7605ae0d455f16d9a4183fcbaca5249e8e6f8cc7338c5dea4f1d48bd453L869-R868&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q2: Could you share more information about your setup?&lt;/p&gt;
&lt;p&gt;What is the baudrate used, and do you have &amp;quot;CONFIG_SLM_EXTERNAL_XTAL=y&amp;quot; set locally?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q3: Have you tried to compile SLM on a newer version of NCS to see if you see the same behavior there?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q4: Does the issue always show itself after some minutes (8 to 10 mins) and is this issue consistent on other boards as well?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160: Serial LTE Modem app eventually crashes after switching to DATA and AT modes numerous times</title><link>https://devzone.nordicsemi.com/thread/395587?ContentTypeID=1</link><pubDate>Mon, 14 Nov 2022 14:26:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d85e8e0-2f4b-4626-9628-4fd2f8d2d0d5</guid><dc:creator>ronald-blackline</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;span style="background-color:#eeeeee;"&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/hkn"&gt;Håkon Alseth&lt;/a&gt;&amp;nbsp;&lt;/span&gt;, any updates on this?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160: Serial LTE Modem app eventually crashes after switching to DATA and AT modes numerous times</title><link>https://devzone.nordicsemi.com/thread/393038?ContentTypeID=1</link><pubDate>Fri, 28 Oct 2022 13:12:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2625e4ec-0008-4ce9-90b7-84661e53b84c</guid><dc:creator>ronald-blackline</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;CONFIG_HEAP_MEM_POOL_SIZE is set to 16384.&lt;/p&gt;
&lt;p&gt;As for your other question, I lost the map file with the crash dump I initially shared.&amp;nbsp;Here is a new crash dump:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; [00:10:34.480,590] &amp;lt;inf&amp;gt; slm_at_host: datamode off pending
00&amp;gt; [00:10:34.490,783] &amp;lt;wrn&amp;gt; slm_at_host: uart_tx failed: -16
00&amp;gt; [00:10:34.490,814] &amp;lt;inf&amp;gt; slm_at_host: Exit datamode
00&amp;gt; [00:10:34.538,360] &amp;lt;err&amp;gt; os: ***** HARD FAULT *****
00&amp;gt; [00:10:34.538,360] &amp;lt;err&amp;gt; os:   Fault escalation (see below)
00&amp;gt; [00:10:34.538,360] &amp;lt;err&amp;gt; os: ***** BUS FAULT *****
00&amp;gt; [00:10:34.538,360] &amp;lt;err&amp;gt; os:   Precise data bus error
00&amp;gt; [00:10:34.538,391] &amp;lt;err&amp;gt; os:   BFAR Address: 0xeb00eb
00&amp;gt; [00:10:34.538,391] &amp;lt;err&amp;gt; os: r0/a1:  0x00eb00eb  r1/a2:  0x200248b4  r2/a3:  0x00000000
00&amp;gt; [00:10:34.538,391] &amp;lt;err&amp;gt; os: r3/a4:  0x00000020 r12/ip:  0x00000000 r14/lr:  0x0003c385
00&amp;gt; [00:10:34.538,421] &amp;lt;err&amp;gt; os:  xpsr:  0x2100001a
00&amp;gt; [00:10:34.538,421] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x000367a2
00&amp;gt; [00:10:34.538,421] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
00&amp;gt; [00:10:34.538,421] &amp;lt;err&amp;gt; os: Fault during interrupt handling
00&amp;gt;
00&amp;gt; [00:10:34.538,421] &amp;lt;err&amp;gt; os: Current thread: 0x20016e88 (unknown)
00&amp;gt; [00:10:34.931,762] &amp;lt;err&amp;gt; fatal_error: Resetting system
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Based on this new dump, the fault happened at&amp;nbsp;&lt;span&gt;0x000367a2:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;0003679e &amp;lt;sys_heap_free&amp;gt;:
{
   3679e:    b510          push    {r4, lr}
    if (mem == NULL) {
   367a0:    b191          cbz    r1, 367c8 &amp;lt;sys_heap_free+0x2a&amp;gt;
   367a2:    6800          ldr    r0, [r0, #0]
    set_chunk_used(h, c, false);
   367a4:    2200          movs    r2, #0
    return big_heap(h) ? 8 : 4;
   367a6:    6883          ldr    r3, [r0, #8]
   367a8:    f5b3 4f00     cmp.w    r3, #32768    ; 0x8000
   367ac:    bf2c          ite    cs
   367ae:    2408          movcs    r4, #8
   367b0:    2404          movcc    r4, #4
    return (mem - chunk_header_bytes(h) - base) / CHUNK_UNIT;
   367b2:    1b0c          subs    r4, r1, r4
   367b4:    1a24          subs    r4, r4, r0
   367b6:    08e4          lsrs    r4, r4, #3
    set_chunk_used(h, c, false);
   367b8:    4621          mov    r1, r4
   367ba:    f7ff fe7c     bl    364b6 &amp;lt;set_chunk_used&amp;gt;
    free_chunk(h, c);
   367be:    4621          mov    r1, r4
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;As for `&lt;span&gt;Current thread: 0x20016e88 (unknown)`, the map file shows this:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt; .bss.z_idle_threads
                0x20016e88       0x80 zephyr/kernel/libkernel.a(init.c.obj)
                0x20016e88                z_idle_threads
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Please let me know if you need for information.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;regards,&lt;/p&gt;
&lt;p&gt;Ronald&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160: Serial LTE Modem app eventually crashes after switching to DATA and AT modes numerous times</title><link>https://devzone.nordicsemi.com/thread/392561?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 10:09:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a2a470b-ed54-428c-a2d3-2342a460de97</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Based on the PC content, the dereferencing of heap-&amp;gt;heap lead to a fault. What is your configured heap size?&lt;/p&gt;
&lt;p&gt;ie. CONFIG_HEAP_MEM_POOL_SIZE.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The log shows that it takes approx. 45 ms from when the uart failed to when the fault occurs. Could the content of &amp;quot;r14/lr:&amp;nbsp; 0x0003d749&amp;quot; and the &amp;quot;Current thread: 0x20016e48 (unknown)&amp;quot; give any indication what happened?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Since the current thread is a ram mapped variable, you will have to check the build/zephyr/zephyr.map to see which thread this belongs to.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>