<?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>Softdevice Task crash on disconnection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43317/softdevice-task-crash-on-disconnection</link><description>Hi, 
 I am developing a product based on nrf52832 using FreeRTOS and the softdevice. 
 I use sdk 15 and I based my softdevice configuration on the ble_app_hrs_freertos example. My problem is that on a disconnection event the device does not start to advertising</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 08 Feb 2019 13:17:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43317/softdevice-task-crash-on-disconnection" /><item><title>RE: Softdevice Task crash on disconnection</title><link>https://devzone.nordicsemi.com/thread/170131?ContentTypeID=1</link><pubDate>Fri, 08 Feb 2019 13:17:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c95b259c-3300-4490-8842-6df7557316a0</guid><dc:creator>lcalvez</dc:creator><description>&lt;p&gt;Thanks I found it. I was writing in an array at an index out of bounds. I would not have found the error without the watch point.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Task crash on disconnection</title><link>https://devzone.nordicsemi.com/thread/170107?ContentTypeID=1</link><pubDate>Fri, 08 Feb 2019 11:39:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4da16be-b413-4f5a-90fc-adfa9802c0a7</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;try to set a memory write watch point on write condition on address 20004D8 and see when and which context corrupts it. It will give you the context of where the error is happening.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Task crash on disconnection</title><link>https://devzone.nordicsemi.com/thread/169940?ContentTypeID=1</link><pubDate>Thu, 07 Feb 2019 13:49:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3971eb9-4d30-4314-afe4-b69cbc9633e8</guid><dc:creator>lcalvez</dc:creator><description>&lt;p&gt;So here is my linker script and infos on size of my code. But when I say it disappears depending on size of code I mean it can disappear either if I add code or if I remove code without any rule.&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;arm-none-eabi-size _build/app_sdk15_s132.elf
   text	   data	    bss	    dec	    hex	filename
 108856	   2732	  20028	 131616	  20220	_build/app_sdk15_s132.elf&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;/* Linker script to configure memory regions. */

SEARCH_DIR(.)
GROUP(-lgcc -lc -lnosys)

MEMORY
{
  FLASH (rx) :  ORIGIN = 0x26000, LENGTH = 512K - 0x26000 - 4K
  CONFIG (rw) : ORIGIN = 512K - 4K, LENGTH = 4K
  RAM (rwx) :   ORIGIN = 0x20002A98, LENGTH = 0xD568
}

SECTIONS
{
}

SECTIONS
{
  . = ALIGN(4);
  .mem_section_dummy_ram :
  {
  }
  .cli_sorted_cmd_ptrs :
  {
    PROVIDE(__start_cli_sorted_cmd_ptrs = .);
    KEEP(*(.cli_sorted_cmd_ptrs))
    PROVIDE(__stop_cli_sorted_cmd_ptrs = .);
  } &amp;gt; RAM
  .fs_data :
  {
    PROVIDE(__start_fs_data = .);
    KEEP(*(.fs_data))
    PROVIDE(__stop_fs_data = .);
  } &amp;gt; RAM
  .log_dynamic_data :
  {
    PROVIDE(__start_log_dynamic_data = .);
    KEEP(*(SORT(.log_dynamic_data*)))
    PROVIDE(__stop_log_dynamic_data = .);
  } &amp;gt; RAM
  .log_filter_data :
  {
    PROVIDE(__start_log_filter_data = .);
    KEEP(*(SORT(.log_filter_data*)))
    PROVIDE(__stop_log_filter_data = .);
  } &amp;gt; RAM

} INSERT AFTER .data;

SECTIONS
{
  .mem_section_dummy_rom :
  {
  }
  .sdh_soc_observers :
  {
    PROVIDE(__start_sdh_soc_observers = .);
    KEEP(*(SORT(.sdh_soc_observers*)))
    PROVIDE(__stop_sdh_soc_observers = .);
  } &amp;gt; FLASH
  .sdh_ble_observers :
  {
    PROVIDE(__start_sdh_ble_observers = .);
    KEEP(*(SORT(.sdh_ble_observers*)))
    PROVIDE(__stop_sdh_ble_observers = .);
  } &amp;gt; FLASH
  .sdh_stack_observers :
  {
    PROVIDE(__start_sdh_stack_observers = .);
    KEEP(*(SORT(.sdh_stack_observers*)))
    PROVIDE(__stop_sdh_stack_observers = .);
  } &amp;gt; FLASH
  .sdh_req_observers :
  {
    PROVIDE(__start_sdh_req_observers = .);
    KEEP(*(SORT(.sdh_req_observers*)))
    PROVIDE(__stop_sdh_req_observers = .);
  } &amp;gt; FLASH
  .sdh_state_observers :
  {
    PROVIDE(__start_sdh_state_observers = .);
    KEEP(*(SORT(.sdh_state_observers*)))
    PROVIDE(__stop_sdh_state_observers = .);
  } &amp;gt; FLASH
    .nrf_queue :
  {
    PROVIDE(__start_nrf_queue = .);
    KEEP(*(.nrf_queue))
    PROVIDE(__stop_nrf_queue = .);
  } &amp;gt; FLASH
    .nrf_balloc :
  {
    PROVIDE(__start_nrf_balloc = .);
    KEEP(*(.nrf_balloc))
    PROVIDE(__stop_nrf_balloc = .);
  } &amp;gt; FLASH
    .cli_command :
  {
    PROVIDE(__start_cli_command = .);
    KEEP(*(.cli_command))
    PROVIDE(__stop_cli_command = .);
  } &amp;gt; FLASH
  .crypto_data :
  {
    PROVIDE(__start_crypto_data = .);
    KEEP(*(SORT(.crypto_data*)))
    PROVIDE(__stop_crypto_data = .);
  } &amp;gt; FLASH
  .pwr_mgmt_data :
  {
    PROVIDE(__start_pwr_mgmt_data = .);
    KEEP(*(SORT(.pwr_mgmt_data*)))
    PROVIDE(__stop_pwr_mgmt_data = .);
  } &amp;gt; FLASH
  .log_const_data :
  {
    PROVIDE(__start_log_const_data = .);
    KEEP(*(SORT(.log_const_data*)))
    PROVIDE(__stop_log_const_data = .);
  } &amp;gt; FLASH
  .log_backends :
  {
    PROVIDE(__start_log_backends = .);
    KEEP(*(SORT(.log_backends*)))
    PROVIDE(__stop_log_backends = .);
  } &amp;gt; FLASH

} INSERT AFTER .text

SECTIONS
{
  . = ALIGN(4);
  .device_config(NOLOAD) :
  {
    PROVIDE(__start_config = .);
    KEEP(*(SORT(.device_config*)))
    PROVIDE(__stop_config = .);
  } &amp;gt; CONFIG
}

INCLUDE &amp;quot;nrf_common.ld&amp;quot;
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Task crash on disconnection</title><link>https://devzone.nordicsemi.com/thread/169927?ContentTypeID=1</link><pubDate>Thu, 07 Feb 2019 13:18:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:758d8f3a-3f4b-4cdd-8c2e-660da17aeb57</guid><dc:creator>lcalvez</dc:creator><description>&lt;p&gt;Ok so I found the origin of the hardfaut. It is a call to handler. The pointer to this handler is stored in a static variable. At initialization the value is being set without problem but one it is somehow erased after that and on BLE event i call this handler. The value being corrupted i get a Hardfault :&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;Value of rx handler is 2D88D, addr of handler is 20004D70
Value of tx handler is 2D871, addr of handler is 20004D74
Value of event handler is 2D875, addr of handler is 20004D78
&amp;lt;21&amp;gt; Join or create
&amp;lt;12&amp;gt; Start sniffing
Value of handler is D875, addr of handler is 20004D78
&amp;lt;error&amp;gt; hardfault: HARD FAULT at 0x0000D886
&amp;lt;error&amp;gt; hardfault:   R0:  0x00000001  R1:  0x00000005  R2:  0x0FBC34A9  R3:  0x00000201
&amp;lt;error&amp;gt; hardfault:   R12: 0x20006670  LR:  0x0002D1FD  PSR: 0x01000000
&amp;lt;error&amp;gt; hardfault: Cause: Data bus error (PC value stacked for the exception return points to the instruction that caused the fault).
&amp;lt;error&amp;gt; hardfault: Bus Fault Address: 0x0FBC34B1&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As you can see in this log the value of the event handler (pointer to actual function) is 2D875 at init and is D875 when I call it in ble_evt_handler. A byte has been erased.&lt;br /&gt;&lt;br /&gt;I will come back with some info on my linker script and code size&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Task crash on disconnection</title><link>https://devzone.nordicsemi.com/thread/169889?ContentTypeID=1</link><pubDate>Thu, 07 Feb 2019 10:50:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55c87c58-db48-466b-b2e0-05ad2eef6269</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;can you please tell me more on the below line you mentioned&lt;/p&gt;
[quote userid="74617" url="~/f/nordic-q-a/43317/softdevice-task-crash-on-disconnection/169883"]it disappears and reappears depending on the size of my code without visible cause.[/quote]
&lt;p&gt;What is the size of your code when the bug happens? have you checked to see if your code size is in conflict with your linker scripts? It sounds that way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Task crash on disconnection</title><link>https://devzone.nordicsemi.com/thread/169883?ContentTypeID=1</link><pubDate>Thu, 07 Feb 2019 10:22:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85f2f200-def5-4dc2-862e-b16fdd6b57a7</guid><dc:creator>lcalvez</dc:creator><description>&lt;p&gt;Thanks for the reply. Unfortunately it did not solve my problem. I added the hardfault implementation provided in the SDK to my project. Here are the logs I get : &lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;error&amp;gt; hardfault: HARD FAULT at 0x0000715A
&amp;lt;error&amp;gt; hardfault: R0: 0x20000404 R1: 0x00000000 R2: 0x00000000 R3: 0x00000000
&amp;lt;error&amp;gt; hardfault: R12: 0x00000000 LR: 0x00008E49 PSR: 0x01000000
&amp;lt;error&amp;gt; hardfault: Cause: Data bus error (PC value stacked for the exception return points to the instruction that caused the fault).
&amp;lt;error&amp;gt; hardfault: Bus Fault Address: 0x002C0010&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This bug is very strange to me because it disappears and reappears depending on the size of my code without visible cause.&lt;/p&gt;
&lt;p&gt;I will continue investigate, please tell me if you need more information in order to help me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice Task crash on disconnection</title><link>https://devzone.nordicsemi.com/thread/169838?ContentTypeID=1</link><pubDate>Thu, 07 Feb 2019 07:31:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a47bbd2-df89-434f-a6b2-28cfc3e71b6f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;In the &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34155/what-are-sdk-15-x-0-known-issues"&gt;SDK15 known issues&lt;/a&gt;&amp;nbsp;we have listed a new issue found that sounds like what you are facing. Please take a look at the workaround &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/39459/observer-under-freertos-events-stop-coming-after-a-few-minutes"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>