<?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>Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34944/device-seems-to-crash-when-adding-new-ble-service</link><description>I&amp;#39;ve been trying to add a new BLE service to my device. I&amp;#39;ve followed the instructions in this tutorial , up to step 7 (so no characteristics or anything), but the device is not advertising. In fact, the software seems to fail entirely; it does not seem</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Apr 2019 15:24:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34944/device-seems-to-crash-when-adding-new-ble-service" /><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/184123?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2019 15:24:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:074f74b8-4c88-406c-b1be-eb17f82efdeb</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/geoffroy"&gt;Geoffroy&lt;/a&gt;: Please create a new&amp;nbsp;question for your issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/183882?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2019 15:15:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42d81413-3549-4665-936e-a370c9483fcf</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;Hello, thx for all explanations,&lt;/p&gt;
&lt;p&gt;i have a similar problem working with nRF52840.&lt;/p&gt;
&lt;p&gt;i have err_code = 0x04 no memory for operation&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i don&amp;#39;t understand how should i change values on file ble_app_template_gcc_nrf52.ld, now i have default values&amp;nbsp; :&lt;/p&gt;
&lt;p&gt;MEMORY&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xda000&lt;br /&gt;&amp;nbsp; RAM (rwx) :&amp;nbsp; ORIGIN = 0x20002210, LENGTH = 0x3ddf0&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;for p_app_ram_start i have 0x2003ff3c (value found in debug mode)&lt;/p&gt;
&lt;p&gt;thank you for help, i&amp;#39;m a bit lost...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Geoffroy&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134491?ContentTypeID=1</link><pubDate>Mon, 04 Jun 2018 09:09:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a30e699-f503-486e-ae8f-85fdc85618ca</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Have you made any progress? I can&amp;#39;t see&amp;nbsp;any SEGGER_RTT_printf(0, &amp;quot;Error code evt_handler: %d\n&amp;quot;, err_code)&amp;nbsp;call in main.c at the line number you&amp;#39;re referring to in the git repo?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134391?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 13:57:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b989c899-e856-4ce1-addd-e64682fc1ba6</guid><dc:creator>sorceressofmaths</dc:creator><description>&lt;p&gt;It&amp;#39;s in main.c, ble_stack_init(), line 1165. I will try looking for a hardfault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134388?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 13:49:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6755323c-f9c4-43e2-9179-a22519ac81b9</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Where is&amp;nbsp;SEGGER_RTT_printf(0, &amp;quot;Error code evt_handler: %d\n&amp;quot;, err_code);&amp;nbsp; called in the code(file, function, line number)? Unless it reaches&amp;nbsp;NVIC_SystemReset(); in&amp;nbsp;app_error_fault_handler() in app_error_weak.c then the only other cause for a reset is a Hardfault.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can try to set a breakpoint in&amp;nbsp;HardFault_Handler in arm_startup_nrf52.s&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Make sure that you have disabled optimization under Options for Target -&amp;gt; C/C++ -&amp;gt; Optimization Level 0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134384?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 13:32:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dded5bb-1913-422b-b772-246f9955b427</guid><dc:creator>sorceressofmaths</dc:creator><description>&lt;p&gt;Yes, I adjusted the RAM start and length accordingly.&lt;/p&gt;
&lt;p&gt;The device still resets even if I comment out the APP_ERROR_CHECK, so I don&amp;#39;t think it has anything to do with that.&lt;/p&gt;
&lt;p&gt;The code seems to get right to the SEGGER_RTT_printf(0, &amp;quot;Error code evt_handler: %d\n&amp;quot;, err_code); statement before failing, and even at times it fails while the statement is printing. Is there any reason in particular why the device would reset in the middle of a print?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134357?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 12:11:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3445438f-b5b9-4dbf-8092-a2fe8fd75f51</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Oh, sorry, I am mistaken. The&amp;nbsp;sd_ble_enable() call does return&amp;nbsp;app_ram_base. In that case you should adjus the RAM start and length to be identical to what you are told in the log output. Where do you end up if you start a debug session, press run code and then halt the CPU when the device is not advertising?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134342?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 11:28:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5690a87b-d83d-43c2-b650-19171d701d71</guid><dc:creator>sorceressofmaths</dc:creator><description>&lt;p&gt;I&amp;#39;m using SDK 11.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134341?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 11:25:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06bdbd89-7ea6-47cb-93ae-d1dbdd2fc30c</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Which SDK version are you using? The tutorial you&amp;#39;re using is based on SDK v11.0.0 and the SoftDevices compatible with this SDK does not return the ram_start address.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134336?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 11:02:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95a76f4c-da22-4d73-9799-3b43cda58042</guid><dc:creator>sorceressofmaths</dc:creator><description>&lt;p&gt;The breakpoint in app_error_handler_bare is never being activated. I sprinkled a few breakpoints and prints around the code, and best I can tell it&amp;#39;s resetting around here:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
SEGGER_RTT_printf(0, &amp;quot;Error code evt_handler: %d\n&amp;quot;, err_code);
APP_ERROR_CHECK(err_code);
SEGGER_RTT_printf(0, &amp;quot;Passed error check&amp;quot;);&lt;/pre&gt;&lt;br /&gt;The error code is 0, but the app still fails without ever getting to the &amp;quot;passed error check&amp;quot; line, i.e. it&amp;#39;s not making it past the APP_ERROR_CHECK even though the error code is NRF_SUCCESS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134324?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 10:15:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cb7a157-0e07-4bb2-b3f9-d5c63fac84c3</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;If&amp;nbsp;sd_ble_enable is returning error code 0, i.e. NRF_SUCCESS, then this is not the cause of the reset and you have allocated enough ram to the SD. Could you place a breakpoint in app_error_handler_bare in app_error.c and see if there is any other function call that is returning&amp;nbsp; a non zero error code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134318?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 09:47:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d212d652-d8ca-483f-a66a-367d82eab7be</guid><dc:creator>sorceressofmaths</dc:creator><description>&lt;p&gt;Hello Bjorn,&lt;br /&gt;Once I started increasing the memory a bit, I started getting no error message (it was never hitting the breakpoint), and the device started pushing through RTT&lt;/p&gt;
&lt;p&gt;&amp;quot;sd_ble_enable: ram_start should be adjusted to 0x20001fe8&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;RAM length should be adjusted to 0xe018&amp;quot;&lt;br /&gt;&lt;br /&gt;When I tried adjusting it to those values, it simply started printing &amp;quot;sd_ble_enable: RAM START at 0x20001FE8&amp;quot; before restarting the program from the beginning.&lt;br /&gt;&lt;br /&gt;It still doesn&amp;#39;t hit the breakpoint in app_error.c, and it still isn&amp;#39;t advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134144?ContentTypeID=1</link><pubDate>Thu, 31 May 2018 08:50:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b2211b1-38d3-43ef-93b3-f0b29cfd11cf</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;You want to decrease the RAM allocated to the application, by increasing the origin( also the end address of the SoftDevice RAM section). So you&amp;#39;re effectivly increasing the size of the SoftDevice RAM section by increasing the application RAM origin.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;No, its a trial and error process so you&amp;#39;ll have to increase move the&amp;nbsp;origin upwards until the sd_ble_enable() call does not return the NO_MEM error code. We added a second parameter in the sd_ble_enable() call in S132 v3.0.0 which returns the application RAM origin for the configuration passed to the SoftDevice.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134135?ContentTypeID=1</link><pubDate>Thu, 31 May 2018 08:13:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1eb17ead-407e-47b8-9611-c5b79b1b9f73</guid><dc:creator>sorceressofmaths</dc:creator><description>&lt;p&gt;I don&amp;#39;t quite understand. If I want to increase the amount of memory allocated, shouldn&amp;#39;t I decrease the origin and increase the length? Also, is there a good rule of thumb for how much extra memory to allocate for a new service?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134131?ContentTypeID=1</link><pubDate>Thu, 31 May 2018 07:59:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2454505f-bdc6-420f-9f18-bfd2f87e8259</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;If you&amp;#39;re using Keil then this is done under Options for Target -&amp;gt; Target -&amp;gt; Read/Write Memory Areas.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Increase the IRAM1 Start address and decrease the size accordingly, i.e. so that&amp;nbsp;IRAM1 Start +&amp;nbsp;IRAM1 Size &amp;lt;= Total RAM on your nRF5x device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re using make and GCC you&amp;#39;ll have to modify the linker script, i.e. the RAM Origin and Length&lt;/p&gt;
&lt;p&gt;MEMORY&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; FLASH (rx) : ORIGIN = 0x1c000, LENGTH = 0x64000&lt;br /&gt;&amp;nbsp; &amp;nbsp; RAM (rwx) : ORIGIN = 0x20002080, LENGTH = 0xdf80&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134124?ContentTypeID=1</link><pubDate>Thu, 31 May 2018 07:30:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c6a22da-eaa0-45ce-b2cf-86501e7f4f83</guid><dc:creator>sorceressofmaths</dc:creator><description>&lt;p&gt;Hello Bjorn, &lt;br /&gt;&lt;br /&gt;It appears that I&amp;#39;ve not allocated enough RAM to the softdevice. How do I adjust this in SDK 11? All the tutorials I can find so far are for later SDK versions. (We plan to port our software to SDK 15 in a few weeks, but at the moment we&amp;#39;re on a tight deadline and don&amp;#39;t have time to do the port just yet.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device seems to crash when adding new BLE service</title><link>https://devzone.nordicsemi.com/thread/134118?ContentTypeID=1</link><pubDate>Thu, 31 May 2018 06:59:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48161059-f602-47a9-829b-e23082039c4a</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Generally, whenever you&amp;#39;re seeing that the nRF device is not advertising after you flashed you should do the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start a debug session&lt;/li&gt;
&lt;li&gt;Set a breakpoint in app_error_handler_bare in app_error.c&lt;/li&gt;
&lt;li&gt;Run the code and if you end up in the error handler, examine the call stack and identify the function that caused the error.&lt;/li&gt;
&lt;li&gt;Look up the error code in the SDK/SoftDevice API documentation on&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/" rel="nofollow"&gt;http://infocenter.nordicsemi.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Most likely you&amp;#39;ve not allocated enough RAM to the SoftDevice or you&amp;#39;ve passed incorrect parameters to the SoftDevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>