<?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>assert in BLE_GATTS_EVT_TIMEOUT with newer iOS iPhones</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74183/assert-in-ble_gatts_evt_timeout-with-newer-ios-iphones</link><description>Hi, 
 I am working with nrf52-ble-app-uart-relay example taken from Nordic Playground github. I have SES IDE, nRF5_SDK_16.0.0 &amp;amp; nRF52840 DK. The central part of the relay device ( nRF52840 DK) polls the status of a peripheral BLE device. The peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Apr 2021 12:38:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74183/assert-in-ble_gatts_evt_timeout-with-newer-ios-iphones" /><item><title>RE: assert in BLE_GATTS_EVT_TIMEOUT with newer iOS iPhones</title><link>https://devzone.nordicsemi.com/thread/306797?ContentTypeID=1</link><pubDate>Mon, 26 Apr 2021 12:38:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ed3e4ad-ce41-40b8-8806-fdccb8dafb85</guid><dc:creator>kunal1234</dc:creator><description>&lt;p&gt;Hi rainbow_carpet, yes my issue is solved. See the fix above. I am not working with BLE Mesh.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: assert in BLE_GATTS_EVT_TIMEOUT with newer iOS iPhones</title><link>https://devzone.nordicsemi.com/thread/306669?ContentTypeID=1</link><pubDate>Mon, 26 Apr 2021 03:19:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f30ba042-92e0-4583-a701-f1adb9a8d727</guid><dc:creator>Rainbow_carpet</dc:creator><description>&lt;p&gt;Hi,have you solve your problem? And also I have a small request ,did you have some demo code for develop the buletooth mesh APP for ios?or can you recommond some website or book? Thank you very much,&lt;span class="tran"&gt;looking forward to&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="tran"&gt;your&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="tran"&gt;replies&lt;/span&gt;&lt;span&gt;!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: assert in BLE_GATTS_EVT_TIMEOUT with newer iOS iPhones</title><link>https://devzone.nordicsemi.com/thread/305945?ContentTypeID=1</link><pubDate>Tue, 20 Apr 2021 17:43:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88473c6d-8a1e-4286-91c7-279c5dce9fa4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Kunal,&lt;/p&gt;
[quote user="kunal1234"]Can you confirm that commenting out these event handling from&amp;nbsp;&lt;span&gt;app_nus_server.c is the right solution?&lt;/span&gt;[/quote]
&lt;p&gt;Yes. It is up to you where you handle it, but each event should be handled only once.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: assert in BLE_GATTS_EVT_TIMEOUT with newer iOS iPhones</title><link>https://devzone.nordicsemi.com/thread/305932?ContentTypeID=1</link><pubDate>Tue, 20 Apr 2021 16:13:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6dfeb9e-2b43-4638-a154-427e49699e58</guid><dc:creator>kunal1234</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thank you for the quick reply.&lt;/p&gt;
&lt;p&gt;My code execution halted in&amp;nbsp;BLE_GATTS_EVT_TIMEOUT of&amp;nbsp;&lt;span&gt;app_nus_server.c. (not in BLE_GAP_EVT_PHY_UPDATE_REQUEST). From your explanation, I see that these 4 events are handled both in main.c and&amp;nbsp;app_nus_server.c :&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BLE_GAP_EVT_PHY_UPDATE_REQUEST,&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BLE_GAP_EVT_SEC_PARAMS_REQUEST,&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BLE_GATTC_EVT_TIMEOUT,&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BLE_GATTS_EVT_TIMEOUT.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I commented them out from app_nus_server.c -&amp;gt;&amp;nbsp;app_nus_server_ble_evt_handler(). I could connect to iphone 11 which was an issue previously.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you confirm that commenting out these event handling from&amp;nbsp;&lt;span&gt;app_nus_server.c is the right solution?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Thank you&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Kunal&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: assert in BLE_GATTS_EVT_TIMEOUT with newer iOS iPhones</title><link>https://devzone.nordicsemi.com/thread/305923?ContentTypeID=1</link><pubDate>Tue, 20 Apr 2021 15:17:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52a08c92-85bc-463b-9567-ae5fbc579980</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Kunal,&lt;/p&gt;
&lt;p&gt;You would only see this on phones which are new enough to support PHY updates.&lt;/p&gt;
&lt;p&gt;The debug log shows this when testing with iPhone 11:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app_timer: RTC: initialized.
&amp;lt;info&amp;gt; app: BLE UART central example started.
&amp;lt;info&amp;gt; app: Connecting to target D50087B15257
&amp;lt;info&amp;gt; app: Peripheral connected
&amp;lt;info&amp;gt; app: ATT MTU exchange completed.
&amp;lt;info&amp;gt; app: Ble NUS max data length set to 0xB6(182)
&amp;lt;error&amp;gt; app: ERROR 17 [NRF_ERROR_BUSY] at C:\Users\eith\SDK\nRF5_SDK_16.0.0_98a08e2\examples\other_projects\nrf52-ble-app-uart-relay\app_nus_server.c:287
PC at: 0x00030FE9
&amp;lt;error&amp;gt; app: End of error report&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And the relevant code and app_error check is this from app_nus_server.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        {
            NRF_LOG_DEBUG(&amp;quot;PHY update request.&amp;quot;);
            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_AUTO,
                .tx_phys = BLE_GAP_PHY_AUTO,
            };
            err_code = sd_ble_gap_phy_update(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;phys);
            APP_ERROR_CHECK(err_code);
        } break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The reason you get&amp;nbsp;NRF_ERROR_BUSY here is that there is a bug, as the&amp;nbsp;BLE_GAP_EVT_PHY_UPDATE_REQUEST event is not only handled here, but before it was handled by the&amp;nbsp;ble_evt_handler() function in main.c. So essentially the app calls&amp;nbsp;sd_ble_gap_phy_update() for one&amp;nbsp;BLE_GAP_EVT_PHY_UPDATE_REQUEST, and then the second will fail. So the fix is to simply remove the handling of the&amp;nbsp;BLE_GAP_EVT_PHY_UPDATE_REQUEST from once of the places, for instance from app_nus_server.c.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>