<?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>Custom Service Issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20353/custom-service-issue</link><description>I am attempting to enable a second custom service with a vendor specific UUID with three characteristics (in addition to an existing custom service and the battery service which are already working just fine) in SDK 13.0.0-alpha with the 5.0.0-1.alpha</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Mar 2017 19:07:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20353/custom-service-issue" /><item><title>RE: Custom Service Issue</title><link>https://devzone.nordicsemi.com/thread/79329?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2017 19:07:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6405965f-78e4-4d41-8d12-650dd834bb14</guid><dc:creator>operator</dc:creator><description>&lt;p&gt;Turns out services_init() needs to be called before advertising_init when doing it this way which makes sense when using a custom service...&lt;/p&gt;
&lt;p&gt;All appears to be working now!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Issue</title><link>https://devzone.nordicsemi.com/thread/79330?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2017 18:53:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c94d5e18-93b1-4a16-8826-49286dda90a5</guid><dc:creator>operator</dc:creator><description>&lt;p&gt;Hello Petter and thank you for the reply.&lt;/p&gt;
&lt;p&gt;I left the ble_enable_params.gatts_enable_params.attr_tab_size set to 0x900 and am debugging with the default memory size settings listed above.&lt;/p&gt;
&lt;p&gt;I have optimization set to Level 0 (-O0) in my C/C++ settings and set some break points around if (app_ram_base != ram_start).&lt;/p&gt;
&lt;p&gt;err_code equals 0x00000004 ram_start is 0x20002168 and app_ram_base becomes 0x200024F8
I also created a variable ram_size and set it equal to ram_end_address_get() - app_ram_base.&lt;/p&gt;
&lt;p&gt;ram_end_address_get is called and returns 0x20010000 as ram_end_address.&lt;/p&gt;
&lt;p&gt;My ram_size variable becomes 0x0000DB08&lt;/p&gt;
&lt;p&gt;So I go back and set my IRAM Start to 0x200024F8 and IRAM size to 0x0000DB08&lt;/p&gt;
&lt;p&gt;Sure enough, soft_device_enable() returns err_code 0x00000000, which I believe is NRF_SUCCESS.&lt;/p&gt;
&lt;p&gt;Unfortunately, now ble_advertising_init is returning 0x07
I have tried using:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
advdata.uuids_complete.p_uuids  = m_adv_uuids;
[...]
err_code = ble_advertising_init(&amp;amp;advdata, NULL, &amp;amp;options, on_adv_evt, NULL);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;as well as:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_advdata_t          scanrsp;
[...]
memset(&amp;amp;scanrsp, 0, sizeof(scanrsp));
scanrsp.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
scanrsp.uuids_complete.p_uuids  = m_adv_uuids;
[...]
err_code = ble_advertising_init(&amp;amp;advdata, &amp;amp;scanrsp, &amp;amp;options, on_adv_evt, NULL);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Any thoughts on what might be causing this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Service Issue</title><link>https://devzone.nordicsemi.com/thread/79328?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2017 10:08:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ada14af0-d37c-4a6c-baf3-ef983a6b1956</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Please examine softdevice_enable(). Here ram_start equals the linker value of the RAM starting point of the application. app_ram_base is set to ram_start and is given to the SoftDevice through sd_ble_enable().&lt;/p&gt;
&lt;p&gt;The SoftDevice will compare the value of app_ram_base with the RAM it actually needs, if too little RAM has been provided sd_ble_enable() will return NRF_ERROR_NO_MEM and app_ram_base will will be the required RAM starting point of the application.&lt;/p&gt;
&lt;p&gt;You can check the value of the app_ram_base by using the debugger (turn off optimizations), or by printing:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    NRF_LOG_WARNING(&amp;quot;sd_ble_enable: RAM start should be adjusted to 0x%x\r\n&amp;quot;,
            app_ram_base);
    NRF_LOG_WARNING(&amp;quot;RAM size should be adjusted to 0x%x \r\n&amp;quot;,
            ram_end_address_get() - app_ram_base);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>