<?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>Is there the turn of Advertise and Service initalize ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13209/is-there-the-turn-of-advertise-and-service-initalize</link><description>I tried to work application.
But firmware stops at advertising_init(). When I exchange advertising_init() and services_init(), firmware does not stop.
why ? 
 S110 v8.0.0 
SDK v8.1.0 
 [NG code in main()] 
 ble_stack_init();
gap_params_init();</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 16 Apr 2016 01:53:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13209/is-there-the-turn-of-advertise-and-service-initalize" /><item><title>RE: Is there the turn of Advertise and Service initalize ?</title><link>https://devzone.nordicsemi.com/thread/50375?ContentTypeID=1</link><pubDate>Sat, 16 Apr 2016 01:53:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fde30f7-d91c-48a4-9c01-285f290c23f2</guid><dc:creator>mino</dc:creator><description>&lt;p&gt;Thank you !&lt;br /&gt;
I understood !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there the turn of Advertise and Service initalize ?</title><link>https://devzone.nordicsemi.com/thread/50377?ContentTypeID=1</link><pubDate>Sat, 16 Apr 2016 01:47:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d56c7dd8-6e0d-4d7e-b017-4a8fe6279b62</guid><dc:creator>mino</dc:creator><description>&lt;p&gt;OK, I understood.&lt;br /&gt;
Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there the turn of Advertise and Service initalize ?</title><link>https://devzone.nordicsemi.com/thread/50376?ContentTypeID=1</link><pubDate>Fri, 15 Apr 2016 12:01:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66e3d6b2-db13-4613-b6dc-2657cbd66b3b</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;The base UUID for the 128-bit UUID is added to the SoftDevice inside services_init(). This base is not available if you call advertising_init() first. Could be the causing the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there the turn of Advertise and Service initalize ?</title><link>https://devzone.nordicsemi.com/thread/50373?ContentTypeID=1</link><pubDate>Fri, 15 Apr 2016 08:21:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bbf3bcd-7973-4d98-8a7f-62b772842a67</guid><dc:creator>Artucas</dc:creator><description>&lt;p&gt;so you are encoding 16 bit UUID, but your uuid=0x20003B14? Thats 32-bit. error code itself 0x00000007 stands for NRF_ERROR_INVALID_PARAM, means you passed invalid parameter to the function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there the turn of Advertise and Service initalize ?</title><link>https://devzone.nordicsemi.com/thread/50371?ContentTypeID=1</link><pubDate>Fri, 15 Apr 2016 03:19:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bfc6697-4ccb-4a9f-8ded-126968d0752d</guid><dc:creator>mino</dc:creator><description>&lt;p&gt;Thank you for your reply.
I used some Nordic Samples (HR sense sample and NUS sample).
I started a project from using NUS sample.
I want to include DFU code, and used HR sense sample.
I found a different from advertising_init() position in main().
Then I got Error !
I checked that NUS is working.
But I don&amp;#39;t execute HR sense sample. Sorry.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;HR sense
nRF51_SDK_8.1.0_b6ed55f\examples\ble_peripheral\ble_app_hrs&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;NUS
nRF51_SDK_8.1.0_b6ed55f_original\examples\ble_peripheral\ble_app_uart&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there the turn of Advertise and Service initalize ?</title><link>https://devzone.nordicsemi.com/thread/50374?ContentTypeID=1</link><pubDate>Fri, 15 Apr 2016 02:43:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cf4d459-edf3-49c5-86bf-463469f5b264</guid><dc:creator>mino</dc:creator><description>&lt;p&gt;Thank you for your reply.
I checked err_code. It was 0x00000007.
I tracked this program;
advertising_init()
--&amp;gt;  ble_advertising_init()
--&amp;gt;  ble_advdata_set()
--&amp;gt;  adv_data_encode() for &amp;quot;Encode scan response data&amp;quot;
--&amp;gt;  uuid_list_encode() for &amp;quot;Encode &amp;#39;complete&amp;#39; uuid list&amp;quot;
--&amp;gt;  uuid_list_sized_encode() for &amp;quot;Encode 16 bit UUIDs&amp;quot;&amp;quot;
--&amp;gt;  sd_ble_uuid_encode()
err_code = 0x00000007&lt;/p&gt;
&lt;p&gt;Parameter of sd_ble_uuid_encode(&amp;amp;uuid, &amp;amp;encode_size, NULL);
uuid=0x20003B14, uuid[0]=0x0001, uuid[1]=0x02, encode_size=0x02&lt;/p&gt;
&lt;p&gt;I think that it is correct the parameter of sd_ble_uuid_encode().
What will be wrong ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there the turn of Advertise and Service initalize ?</title><link>https://devzone.nordicsemi.com/thread/50370?ContentTypeID=1</link><pubDate>Thu, 14 Apr 2016 14:39:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62436251-b494-45e9-beda-b9454586ec64</guid><dc:creator>Artucas</dc:creator><description>&lt;p&gt;Is this Nordic example or yours? I have faced same behavior few months ago and i saw that i have to initialize services first before advertising_init(). I didn&amp;#39;t ask anyone then, but i believe it had to do something that i was putting my own custom service UUID in the advertisement packet. So i was trying to put that service UUID in the advertising packet, but the service wasn&amp;#39;t initialized yet. So calling services_init(), before advertising_init() fixed that. Then you don&amp;#39;t have this problem in Nordic examples, because they are using services which are defined by Bluetooth SIG and their UUIDs are known before initializing those services. Could be great if someone could confirm that my speculations here are correct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there the turn of Advertise and Service initalize ?</title><link>https://devzone.nordicsemi.com/thread/50372?ContentTypeID=1</link><pubDate>Thu, 14 Apr 2016 13:41:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af9df562-730a-4b9a-bc0e-2012fa1ba76b</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;No the firmware doesn&amp;#39;t stop, it&amp;#39;s somewhere doing something. What are the two values of err_code before the APP_ERROR_CHECK()s? If they aren&amp;#39;t zero, then one or other of them failed with an error code telling you why.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>