<?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 is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9591/device-is-not-advertising-stuck-at-softdevice_handler_init-macro</link><description>I have created a customized Services according to nAN36 Document. 
 
 SDK using 8.0 
 Stack S110 8.0 
 DEV kit PCA10028 nRF51. 
 J-LInk RTT DEbugger 
 
 When the function ble_stack_init(void) get called from main. It stuck somewhere with MACRO</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Oct 2015 12:31:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9591/device-is-not-advertising-stuck-at-softdevice_handler_init-macro" /><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35426?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2015 12:31:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9bd4e45-d589-4854-aa35-ee585362c387</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;So proximity from SDK 8.0.0 works. Then you have taken that example or ble_app_template from SDK 8.0.0 and added some custom services. This shouldn&amp;#39;t affect anything inside ble_stack_init();, but there must be something that is different betweent the two applications. Maybe you could upload your complete project so we can test it here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35431?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2015 04:54:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8206fac-d8a6-417e-866d-9709d623daa2</guid><dc:creator>SHubham</dc:creator><description>&lt;p&gt;I think You got it your last line sir.... It never returns when it get inside the sd_softdevice_enable function..  OK Can you guide me where I can be wrong with Softdevice.. Because I am using everything as shown in Document. I am using nRF51-DK Hardware Kit and S110 softdevice version 8.0.2.&lt;/p&gt;
&lt;p&gt;One more thing If Softdevice compatibility is the only issue than why Application like Proximity run perfectly with same Softdevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35430?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2015 03:56:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2c712b9-7b9c-4e8e-9c1b-b3835e7a317b</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I really don&amp;#39;t understand what you&amp;#39;re saying, sorry I just don&amp;#39;t understand some of the English.&lt;/p&gt;
&lt;p&gt;You&amp;#39;re saying you fail in side the sd_softdevice_enable() function, well that&amp;#39;s far before any services are added. So how can it have anything to do with the services?&lt;/p&gt;
&lt;p&gt;If the chip REALLY is resetting inside the call to sd_softdevice_enable() then you have serious problems and that really sounds like you don&amp;#39;t have the correct softdevice on the chip or you don&amp;#39;t have it on there properly. I assume this is very close to the start of your main() routine. You&amp;#39;re telling me that if you put a breakpoint RIGHT after the sd_softdevice_enable() call, in the assembler if necessary, that it never returns from there and the chip resets?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35429?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2015 03:45:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffbbf478-5f99-4181-9498-e01ec0bd65b5</guid><dc:creator>SHubham</dc:creator><description>&lt;p&gt;Yes I have added my own Error handler there, but execution point may be not reached till that point. Because if it reached there till my error handler than also print the printf statement there. But it reset somewhere inside the sd_softdevice_enable Function which is simply an API, under SVCALL. SO I cant see what is happening inside there... Please clear my one doubt. As I have added three customized services and three characteristics for each services. May be this the main issue?? anything happening inside the sd_softdevice_enable function which is hardwired but I may be providing excessive values to any related parameters.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35425?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 13:33:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a4421aa-f8d7-4040-bfd7-6e3d5f3bd61f</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;.. and if you&amp;#39;ve single stepped all the way to the line
err_code = sd_softdevice_enable(clock_source, softdevice_assertion_handler);
what is err_code? If it&amp;#39;s not zero, you have an error and APP_ERROR_CHECK() is going to fail on the very next line.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35424?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 13:25:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a80ff519-a1fe-4620-a7f8-def0e8e35ce3</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;One of the default error handler functions does reset the chip, which is why I suggested putting a breakpoint in the function before it does anything to see what the error code is. Or write your own error handler function which loops and you can break into it.&lt;/p&gt;
&lt;p&gt;Usually the error handler is only defined to reset the chip in release code, but I don&amp;#39;t know what flags you&amp;#39;ve built with so it&amp;#39;s possible you have the &amp;#39;reset the chip&amp;#39; error handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35423?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 13:21:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82f650ff-2174-4e4e-9ebd-21290c6811b0</guid><dc:creator>SHubham</dc:creator><description>&lt;p&gt;yes that two line has nothing to do. I am just to annotating a point so you can easily get it where I am stuck.&lt;/p&gt;
&lt;p&gt;Look that things goes inside the stack_init function&lt;/p&gt;
&lt;p&gt;there it is defined as
err_code = sd_softdevice_enable(clock_source, softdevice_assertion_handler);
APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;which means I am calling an error handler function. But things happened here is when this Function get call it won&amp;#39;t get inside this error handler (APP_ERROR_CHECK)  it reset the program.&lt;/p&gt;
&lt;p&gt;Softdevice and Application IROM and IRAM memory allocation is correct. Cause I did the same As it was shown in case of proximity service , which come within the SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35422?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 12:15:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab65a6fa-a992-4949-b177-228d443641ce</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;No i would doubt it. In fact those two lines of code wouldn&amp;#39;t really compile down to anything which does anything much. Just moves the address of and size of a chunk of statically allocated memory into program memory somewhere.&lt;/p&gt;
&lt;p&gt;Do you have an error handler? Put a breakpoint in that as well to check something else isn&amp;#39;t landing you in there. None of the places highlighted so far are places which could send the chip into reset (and hence start main() again)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35421?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 12:02:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bc9a8ef-37d4-49d2-96c7-8426c5a702bd</guid><dc:creator>SHubham</dc:creator><description>&lt;p&gt;Yes Softdevice Address is correct . I downloaded Softdevice first into Board than the application code. And same I checked with nRFGO studio everthing is fine.&lt;/p&gt;
&lt;p&gt;The functions mainly stops after setting this two parameter inside the ble_stack_init_function()
mp_ble_evt_buffer     = (uint8_t *)p_ble_evt_buffer;
m_ble_evt_buffer_size = ble_evt_buffer_size;&lt;/p&gt;
&lt;p&gt;Is any issue with size??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35428?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 11:43:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3b8d28b-40d2-499d-9d5f-6f7222d8e807</guid><dc:creator>SHubham</dc:creator><description>&lt;p&gt;Yes ofcourse advertsing thing is irrelevant point here. As I am stuck somewhere inside SOftDevice. Thing   is that is stuck at function which defination is abstracted. SO I cant add there any printf to look more. What is happening when it reached to that functions it immediately start executing from main() function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35420?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 10:51:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f50fe69f-e2d0-4454-8475-e154ef9f7edf</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Did you actually build your code with the correct addresses to use a softdevice and put the correct softdevice on the chip?&lt;/p&gt;
&lt;p&gt;Do you check the error code or you don&amp;#39;t even get that far?&lt;/p&gt;
&lt;p&gt;If you put a breakpoint on the printf() function does the code break there?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35419?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 10:47:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e426372a-8569-4d73-87f1-ff038a94c1c6</guid><dc:creator>SHubham</dc:creator><description>&lt;p&gt;When execution point reached to this function :::::::::
err_code = sd_softdevice_enable(clock_source, softdevice_assertion_handler);&lt;/p&gt;
&lt;p&gt;I added a printf function just below this function is also not get executed.
It terminates everything at this point. and  main() function starts again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro</title><link>https://devzone.nordicsemi.com/thread/35427?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2015 10:45:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00b1419d-5582-403e-af8b-807e784053f8</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;It doesn&amp;#39;t &amp;#39;stick&amp;#39; somewhere, microprocessors don&amp;#39;t just stop running. You have a debugger, hit &amp;#39;break&amp;#39; and see where you are in the code. Most likely you are in the error handler because one of the calls inside the handler init returned an error, the error was checked and the code jumped to the error handler, where it&amp;#39;s looping quietly waiting for you to hit break, look at the stack trace, and see what caused the error.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re stuck in the softdevice init and haven&amp;#39;t even returned from that, the advertising stuff isn&amp;#39;t really relevant as you won&amp;#39;t have got to that point in the code. However if those are 3 custom services with full length UUIDs, there&amp;#39;s no way they are going to fit in the advertising packet, and that will be the source of another error later.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>