<?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>ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10650/ancs-resets-after-deleting-bond-on-dev-board</link><description>Hi, 
 I have a problem that the ANCS keeps resetting my board, so I was able to reproduce the problem on the PCA 10028 dev board. 
 Conditions: 
 
 iOS 8.x or 9.x 
 No app needed on iOS. This is on settings-&amp;gt;bluetooth 
 SD 110 
 ANCS nordic implementation</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Dec 2015 02:04:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10650/ancs-resets-after-deleting-bond-on-dev-board" /><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39734?ContentTypeID=1</link><pubDate>Mon, 21 Dec 2015 02:04:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:273f6f71-c749-4f6c-bc26-4be81432239d</guid><dc:creator>Antonio</dc:creator><description>&lt;p&gt;I did have an error handler.&lt;/p&gt;
&lt;p&gt;My problem, I know now, is that I am using a timer for part of the exception handling and it is running on app_low, and I was trying to solve the problem on a SD callback.&lt;/p&gt;
&lt;p&gt;So the solution was to set a flag and handle the exception on main.&lt;/p&gt;
&lt;p&gt;Thanks Anders!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39730?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2015 13:36:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87e06b36-accd-44c8-bc5c-af14ba9018d6</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Most events originate from the softdevice. It will send the event using a software interrupt with priority APP_LOW. Everything called from within that software interrupt is still in APP_LOW priority. See &lt;a href="https://devzone.nordicsemi.com/attachment/3aeaf4343cb6d19798a11bc41b744da3"&gt;this&lt;/a&gt; picture of event flow. Practically speaking; Anything that is not called from main(), will have APP_LOW priority or higher.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39733?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2015 09:07:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32c2907b-d289-439e-9e40-8f4c596f78a6</guid><dc:creator>Antonio</dc:creator><description>&lt;p&gt;Wow, I feel like a newbie now. I thought that the timer was working through interrupts and that I would get a call if I was on the same priority.
Or, now that I think of it, this one error is a callback to the device_manager_evt_handler. What priority would that be?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39732?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2015 08:58:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03551835-f7dc-4307-8552-e6bdec3a59cf</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;It really depends on the implementation of your error handler. Note that the event that come from the softdevice will run on the same priority as app_timer. If you are for example are doing an infinate while loop somewhere (other than main()), you will block the timer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39731?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2015 08:03:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0911c3d-53ad-4c2a-ab3d-be966d396387</guid><dc:creator>Antonio</dc:creator><description>&lt;p&gt;Thank you Anders!
In my board I am doing my own implementation of APP_ERROR_CHECK before I actually send it to APP_ERROR_CHECK for reset (after pressing a button that I am looping directly on the IO). The problem I am having is that when I intercept the error for some reason the timers do not work anymore. I have a timer that is constantly driving an LED for status, and that one stops working. Do you know if when an error condition is sent the timers from app_timer stop working?
Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39728?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 10:25:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2738a68e-29dc-44b9-af75-c1e685336d9a</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;If you want to filter the error, dont pass it to APP_ERROR_CHECK (APP_ERROR_CHECK(event_result); in device_manager_evt_handler) , but implement your own handling of the event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39729?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 10:23:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9093b9a-ea2d-4de2-948b-de97e6ee7b3b</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;When the phone has bonding data and the device doesn&amp;#39;t, it is not really any easy way out. The phone will try to encrypt the link with the existing encryption keys, and the peripheral device must deny these attempts because it does not have the keys. The only solution to this is to delete the device from the phone bluetooth settings.&lt;/p&gt;
&lt;p&gt;You mentioned this potentially being an issue when using DFU. You have the option to keep bond data when doing DFU, so this should not be a problem.&lt;/p&gt;
&lt;p&gt;About the board resetting or freezing when an error occurs:
This is how the default error handler reacts on errors. It resets by default, and freezes (while(1)), when DEBUG is defined.&lt;/p&gt;
&lt;p&gt;From the documentation of app_error_handler:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;@warning This handler is an example
only and does not fit a final product.
You need to analyze  *          how
your product is supposed to react in
case of error.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It is up to the developer to decide how the application should react to different errors.&lt;/p&gt;
&lt;p&gt;The return code 0x88 comes from&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;event_result = p_ble_evt-&amp;gt;evt.gap_evt.params.auth_status.auth_status;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The status is BLE_GAP_SEC_STATUS_UNSPECIFIED. This status describes that the authorization failed  with an unspecified reason. (As we can see on event 1415 in the sniffer log).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39727?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2015 23:33:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22a746de-e984-403f-a6d7-514ec08a1966</guid><dc:creator>Antonio</dc:creator><description>&lt;p&gt;Hi Anders. I checked some more and the problem with this error the stack is sending on the callback, is that somehow the SD stack is unstable at this point and I cannot try to recover. The timers are not responding anymore and the slot I am using with sd_radio_session_open(m_timeslot_callback) to do extra things with the radio is not responding either. Is there a way to catch this strange error (0x88) and have the SD still operational so I do not have to proceed with reset?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39726?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2015 21:44:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9734b1f9-f49e-440b-8c64-fd97e1ed726f</guid><dc:creator>Antonio</dc:creator><description>&lt;p&gt;Thanks Anders! It is returning an error 0x88 in the call back device_manager_evt_handler. Tha base of the error is 0 so it is a global error, but I did not find the documentation about that error. Can you point me in the right direction?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39725?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2015 13:38:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca430a78-2048-4849-980c-30cd248dd5b3</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;The APP_ERROR_CHECK call will end up in &lt;code&gt;app_error_handler&lt;/code&gt; in app_error.c. If DEBUG is defined, it will do the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;m_error_code = error_code;
m_line_num = line_num;
m_p_file_name = p_file_name;

UNUSED_VARIABLE(m_error_code);
UNUSED_VARIABLE(m_line_num);
UNUSED_VARIABLE(m_p_file_name);
__disable_irq();
while(1) ;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here you can see the error code, the line where is was coming from, and the file it was coming from.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39723?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2015 12:58:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7313c781-3892-4e14-b649-f1bc34e93ebf</guid><dc:creator>Antonio</dc:creator><description>&lt;p&gt;I cannot catch where is resetting. I already tried all of the APP_ERROR_CHECK in the ANCS example to try to pin it down. I think it might be reseting inside the SD. I was hopping you would have better luck trying to find exactly where it resets. That is the reason I documented how to reproduce the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39722?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2015 12:45:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68792742-3306-4bd5-b977-bc82afbeabfe</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;I see. Are you using the ANCS example from the SDK? If the device reset, it is probable because APP_ERROR_CHECK encounters an error. Can you try to find out which function returns the error? Add either a print or breakpoint in app_error.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39724?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2015 19:46:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fbc5a58-6013-42a7-a2ed-9d22e0b36bf4</guid><dc:creator>Antonio</dc:creator><description>&lt;p&gt;There are a thousand situations for which the bond could be deleted from the peripheral device, for which iOS would not know beforehand. A common example would be that another iOS or Android did a DFU.
The big problem is ANCS resetting instead of having a procedure to re-bond or a check-point to make a decision instead of resetting.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS resets after deleting bond on dev board</title><link>https://devzone.nordicsemi.com/thread/39721?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2015 13:03:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55829caf-e9de-4a52-9d43-f56cba9f6c2d</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;When you clear the bond on only one of the devices, the other one does not know about it. To fix this, you should delete the bond info on the iphone as well.&lt;/p&gt;
&lt;p&gt;Is this a normal use case for your device? Do you need to make this scenario work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>