<?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>CONFIG_HEAP_MEM_POOL_SIZE &amp;gt; 8192 creates system reset</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72164/config_heap_mem_pool_size-8192-creates-system-reset</link><description>Hi, 
 I am using ncs 1.5.0 and modem firmware version 1.2.3. 
 if I keep CONFIG_HEAP_MEM_POOL_SIZE=8192 then my application runs without any issue but 
 If I set CONFIG_HEAP_MEM_POOL_SIZE &amp;gt; 8192 (e.g. 16384 ) then systems keeps resetting while I try to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Mar 2021 17:05:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72164/config_heap_mem_pool_size-8192-creates-system-reset" /><item><title>RE: CONFIG_HEAP_MEM_POOL_SIZE &gt; 8192 creates system reset</title><link>https://devzone.nordicsemi.com/thread/298486?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 17:05:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c01d3a8-423b-4ef1-9778-38975b79c5ba</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/khodidas"&gt;khodidas&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;As your prj.conf looks like the one from the http_application_update sample, I have tried to compile it with your prj.conf file in both NCS 1.4.1 and 1.5.0. However, I have not been able to find any significant change in stack sizes alone.&lt;/p&gt;
&lt;p&gt;Could you share your code, so that I could try to reproduce your issue, and debug it myself? If you don&amp;#39;t want to share your code in a public ticket, you can create a private one where you tag me.&lt;/p&gt;
&lt;p&gt;@John coud you make a new ticket for your error?&lt;/p&gt;
&lt;p&gt;Just because it is a bus fault doesn&amp;#39;t mean it is caused by the same problem.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_HEAP_MEM_POOL_SIZE &gt; 8192 creates system reset</title><link>https://devzone.nordicsemi.com/thread/298255?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 07:51:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61d38e21-3034-43c5-8e2b-bbf8088ed634</guid><dc:creator>John</dc:creator><description>&lt;p&gt;I seem to have a similar problem when using v1.5&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;AWS connection (connected: 0, in progress: 0) &lt;br /&gt;Not connected to AWS, trying to connect&lt;br /&gt;Received: T60BADA7AD5D3/60BADA7AD5D3/B929E82A85F4/02475F00FF662890&lt;br /&gt;Woo hoo, listener has heard something:&lt;br /&gt;Received: T60BADA7AD5D3/60BADA7AD5D3/6A78B6E6F5F6/51792B00FF733609&lt;br /&gt;[00:01:04.637,939] [1;31m&amp;lt;err&amp;gt; os: ***** HARD FAULT *****[0m&lt;br /&gt;[00:01:04.643,859] [1;31m&amp;lt;err&amp;gt; os: Fault escalation (see below)[0m&lt;br /&gt;[00:01:04.650,512] [1;31m&amp;lt;err&amp;gt; os: ***** BUS FAULT *****[0m&lt;br /&gt;[00:01:04.656,372] [1;31m&amp;lt;err&amp;gt; os: Precise data bus error[0m&lt;br /&gt;[00:01:04.662,475] [1;31m&amp;lt;err&amp;gt; os: BFAR Address: 0x20040af6[0m&lt;br /&gt;[00:01:04.668,823] [1;31m&amp;lt;err&amp;gt; os: r0/a1: 0x2001aed0 r1/a2: 0x00004b84 r2/a3: 0x20040af0[0m&lt;br /&gt;[00:01:04.678,131] [1;31m&amp;lt;err&amp;gt; os: r3/a4: 0x00002001 r12/ip: 0x00000000 r14/lr: 0x00029f59[0m&lt;br /&gt;[00:01:04.687,408] [1;31m&amp;lt;err&amp;gt; os: xpsr: 0x8100001a[0m&lt;br /&gt;[00:01:04.692,993] [1;31m&amp;lt;err&amp;gt; os: s[ 0]: 0x00000000 s[ 1]: 0x00000000 s[ 2]: 0x00000000 s[ 3]: 0x00000000[0m&lt;br /&gt;[00:01:04.704,162] [1;31m&amp;lt;err&amp;gt; os: s[ 4]: 0x00000000 s[ 5]: 0x00000000 s[ 6]: 0x00000000 s[ 7]: 0x00000000[0m&lt;br /&gt;[00:01:04.715,332] [1;31m&amp;lt;err&amp;gt; os: s[ 8]: 0x00000000 s[ 9]: 0x00000000 s[10]: 0x00000000 s[11]: 0x00000000[0m&lt;br /&gt;[00:01:04.726,501] [1;31m&amp;lt;err&amp;gt; os: s[12]: 0x00000000 s[13]: 0x00000000 s[14]: 0x00000000 s[15]: 0x00000000[0m&lt;br /&gt;[00:01:04.737,640] [1;31m&amp;lt;err&amp;gt; os: fpscr: 0x20022208[0m&lt;br /&gt;[00:01:04.743,255] [1;31m&amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x00029d8c[0m&lt;br /&gt;[00:01:04.751,678] [1;31m&amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0[0m&lt;br /&gt;[00:01:04.760,009] [1;31m&amp;lt;err&amp;gt; os: Fault during interrupt handling&lt;br /&gt;[0m&lt;br /&gt;[00:01:04.766,845] [1;31m&amp;lt;err&amp;gt; os: Current thread: 0x20016920 (unknown)[0m&lt;br /&gt;[00:01:04.779,174] [1;31m&amp;lt;err&amp;gt; os: Halting system[0m&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_HEAP_MEM_POOL_SIZE &gt; 8192 creates system reset</title><link>https://devzone.nordicsemi.com/thread/297133?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 10:44:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5889b7d1-0832-464d-92a0-21bad0fff35b</guid><dc:creator>khodidas</dc:creator><description>&lt;p&gt;I found one more thing.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Before &amp;quot;k_malloc&amp;quot; is called to create buffer to store data from flash &amp;quot;k_calloc&amp;quot; is called in my application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is inside &amp;quot;at_params_list_init&amp;quot; function. This function is called from &amp;quot;modem_info_init&amp;quot; function.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Smitesh Mali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_HEAP_MEM_POOL_SIZE &gt; 8192 creates system reset</title><link>https://devzone.nordicsemi.com/thread/297083?ContentTypeID=1</link><pubDate>Tue, 02 Mar 2021 09:21:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01b68c0b-42b2-4be5-a5aa-43f7ded7db25</guid><dc:creator>khodidas</dc:creator><description>[quote userid="81181" url="~/f/nordic-q-a/72164/config_heap_mem_pool_size-8192-creates-system-reset/296890#296890"]Could you try to enable logging, and disabling auto-resetting on faults?[/quote]
&lt;p&gt;I have done this. Following is the log.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.4.99-ncs1  ***&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
&amp;lt;LF&amp;gt;
I: 4 Sectors of 4096 bytes&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
I: alloc wra: 0, 828&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
I: data wra: 0, 7ec&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: ***** HARD FAULT *****&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E:   Fault escalation (see below)&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: ***** BUS FAULT *****&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E:   Precise data bus error&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E:   BFAR Address: 0x2109aa8c&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: r0/a1:  0x2001aa48  r1/a2:  0x00000029  r2/a3:  0x0000000c&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: r3/a4:  0x00210008 r12/ip:  0x00000000 r14/lr:  0x00035ad9&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E:  xpsr:  0x81000200&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: s[ 0]:  0x00000000  s[ 1]:  0x00000000  s[ 2]:  0x00000000  s[ 3]:  0x00000000&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: s[ 4]:  0x00000000  s[ 5]:  0x00000000  s[ 6]:  0x00000000  s[ 7]:  0x00000000&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: s[ 8]:  0x00000000  s[ 9]:  0x00000000  s[10]:  0x00000000  s[11]:  0x00000000&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: s[12]:  0x00000000  s[13]:  0x00000000  s[14]:  0x00000000  s[15]:  0x00000000&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: fpscr:  0x20014898&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: Faulting instruction address (r15/pc): 0x00035940&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 0: CPU exception on CPU 0&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: Current thread: 0x200165e0 (unknown)&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
E: Halting system&amp;lt;CR&amp;gt;&amp;lt;LF&amp;gt;
&lt;/pre&gt;&lt;/p&gt;
[quote userid="81181" url="~/f/nordic-q-a/72164/config_heap_mem_pool_size-8192-creates-system-reset/296890#296890"]What libraries/subsystems is it using? What stack sizes are you using for the different threads? etc.[/quote]
&lt;p&gt;Following are the settings in prj.conf file&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
# General config
CONFIG_NCS_SAMPLES_DEFAULTS=y
CONFIG_REBOOT=y
#CONFIG_HW_STACK_PROTECTION=y
CONFIG_ASSERT=y
CONFIG_REBOOT=y

# Trusted execution
CONFIG_TRUSTED_EXECUTION_NONSECURE=y
#CONFIG_TEST_RANDOM_GENERATOR=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
#CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_NATIVE=n

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
# Requested Periodic TAU
CONFIG_LTE_PSM_REQ_RPTAU=&amp;quot;10111110&amp;quot;
# Requested Active Time
CONFIG_LTE_PSM_REQ_RAT=&amp;quot;00000000&amp;quot;
CONFIG_MQTT_KEEPALIVE=1200

# Modem library
CONFIG_NRF_MODEM_LIB=y
CONFIG_NRF_MODEM_LIB_SYS_INIT=n
CONFIG_MODEM_KEY_MGMT=y

# Library for buttons and LEDs
CONFIG_DK_LIBRARY=y
CONFIG_DK_LIBRARY_INVERT_LEDS=n

# Console
CONFIG_CONSOLE_SUBSYS=y
CONFIG_CONSOLE_HANDLER=y
CONFIG_CONSOLE_GETCHAR=y

# Main thread
CONFIG_MAIN_THREAD_PRIORITY=7
# Heap and stacks
CONFIG_HEAP_MEM_POOL_SIZE=32768
CONFIG_MAIN_STACK_SIZE=16384

# Image manager
CONFIG_IMG_MANAGER=y
CONFIG_FLASH=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y

# GPIO
CONFIG_GPIO=y

# FOTA library
CONFIG_FOTA_DOWNLOAD=y

# Download client
CONFIG_DOWNLOAD_CLIENT=y
CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096

# DFU Target
CONFIG_DFU_TARGET=y

# Modem key management
CONFIG_MODEM_KEY_MGMT=y

# Application Upgrade support
CONFIG_BOOTLOADER_MCUBOOT=y

# Sample configuration
CONFIG_DOWNLOAD_HOST=&amp;quot;nrfconnectsdk.s3.eu-central-1.amazonaws.com&amp;quot;
CONFIG_DOWNLOAD_FILE=&amp;quot;app_update.bin&amp;quot;
CONFIG_APPLICATION_VERSION=1

CONFIG_CJSON_LIB=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_DEPRECATED_ZEPHYR_INT_TYPES=y
#CONFIG_LEGACY_TIMEOUT_API=y

# MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_TLS=y

#Modem_Info

CONFIG_MODEM_INFO=y
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_NRFX=y
CONFIG_SERIAL=y
CONFIG_DEBUG=y
CONFIG_LOG=y
CONFIG_RESET_ON_FATAL_ERROR=n



#Flash Storage
CONFIG_NVS=y
CONFIG_NVS_LOG_LEVEL_DBG=y
CONFIG_NVS_LOG_LEVEL_INF=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y

#Watchdog
CONFIG_WATCHDOG=y
CONFIG_WDT_NRFX=y
CONFIG_NRFX_WDT=y
&lt;/pre&gt;&lt;/p&gt;
[quote userid="81181" url="~/f/nordic-q-a/72164/config_heap_mem_pool_size-8192-creates-system-reset/296890#296890"]Do you see the same resets if you use a different application, e.g. Zephyr&amp;#39;s hello_world sample (modified so that it allocates some heap memory)?[/quote]
&lt;p&gt;I checked with&amp;nbsp;CONFIG_HEAP_MEM_POOL_SIZE=32768 in &amp;quot;MQTT_Simple&amp;quot; example firmware.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is not getting reset.&amp;nbsp;&lt;/p&gt;
[quote userid="81181" url="~/f/nordic-q-a/72164/config_heap_mem_pool_size-8192-creates-system-reset/296890#296890"]Could you describe your application?[/quote]
&lt;p&gt;My application reads some data from flash (host name etc) and stores it in a buffer allocated through &amp;quot;k_malloc&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After this it connects with two brokers after power on through MQTT.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Important thing is My application hasn&amp;#39;t changed between 1.4.1 and 1.5.0.&lt;/p&gt;
&lt;p&gt;But still I am getting this error in 1.5.0 while in 1.4.0 application runs without error.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Smitesh Mali&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CONFIG_HEAP_MEM_POOL_SIZE &gt; 8192 creates system reset</title><link>https://devzone.nordicsemi.com/thread/296890?ContentTypeID=1</link><pubDate>Mon, 01 Mar 2021 14:18:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70e62719-13b3-4033-82ce-10519ae6230c</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This sounds like a stack overflow or similar.&lt;/p&gt;
&lt;p&gt;Could you try to enable logging, and disabling auto-resetting on faults?&lt;/p&gt;
&lt;p&gt;To do that, you can add the following lines to your prj.conf file (if you build with SES, you must run &amp;#39;Project -&amp;gt; Run CMake...&amp;#39; for changes to prj.conf to take effect)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_LOG=y
CONFIG_RESET_ON_FATAL_ERROR=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Could you describe your application?&lt;/p&gt;
&lt;p&gt;What libraries/subsystems is it using? What stack sizes are you using for the different threads? etc.&lt;/p&gt;
&lt;p&gt;Do you see the same resets if you use a different application, e.g. Zephyr&amp;#39;s hello_world sample (modified so that it allocates some heap memory)?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>