<?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>nRF51 to nRF52 migration, can&amp;#39;t discover services</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23902/nrf51-to-nrf52-migration-can-t-discover-services</link><description>Hi. I have some nRF51 firmware I&amp;#39;m migrating to the nRF52. It&amp;#39;s a peripheral with bunch of vendor specific services, using SDK 13.0.0 and SD 132 v4.0.2. 
 My code builds and runs and the device advertises OK. I can see it in the nRF Connect app for Android</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 19 Aug 2017 15:08:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23902/nrf51-to-nrf52-migration-can-t-discover-services" /><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94057?ContentTypeID=1</link><pubDate>Sat, 19 Aug 2017 15:08:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b26851a-1c83-4af0-b533-6e407e924340</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;@RK, Changing to using BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE made no difference here, sorry. It seems that both the Android and the iOS BLE stacks will happily do service discovery even with BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED. @Hung Bui, This now sounds plausible, thanks for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94054?ContentTypeID=1</link><pubDate>Sat, 19 Aug 2017 15:05:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79447640-7bf6-4ee6-9131-5039b65b37a4</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;This was indeed a caching issue, so thanks @RK, @endnode, @Hung Bui and @Nguyen Hoan Hoang for your help with this. I was pretty sure the mobile device I was testing with had never had a chance to cache anything yet for this peripheral, but I was wrong. When I went and got another Android central and fired up nRF Connect, it discovered services, no problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94056?ContentTypeID=1</link><pubDate>Mon, 07 Aug 2017 10:41:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:502cfe7f-f057-4929-88c5-81193a879f8e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Good catch RK.
Also I saw that the address when advertising with hrs example was e6:79:ec:64:b2:c1 when the address when advertising with Eliot&amp;#39;s code was e6:79:ec:64:b2:c0. Could be that the phone only cached ATT table of the e6:79:ec:64:b2:c0 device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94055?ContentTypeID=1</link><pubDate>Sat, 05 Aug 2017 00:35:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d80a5d58-1860-4748-8374-f189cea48e0f</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;You&amp;#39;ve set neither general nor limited discoverable mode in  your advertising flags. That makes the device non-discoverable even though android appears to be attempting to discover it and connect to it.&lt;/p&gt;
&lt;p&gt;I&amp;#39;d change that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94049?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 13:11:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:feece597-ac77-4ecf-aa53-ace59fc52f19</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;@RK That function is now called sd_ble_gap_addr_set(). Changing the MAC address has had no effect. @Hung Bui Rebooting the phone has had no effect either. Yes, I&amp;#39;ve added a capture with the HRS example (or the bootloader from it) above - it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94053?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 01:23:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9cbcc3f-5f05-4a9c-abad-eb32064f0b1d</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;a side from that I don&amp;#39;t see anything else that could go wrong except the caching thing.  You could also compare with my code &lt;a href="https://github.com/I-SYST/EHAL/blob/master/ARM/Nordic/src/ble_app.cpp"&gt;here&lt;/a&gt; that works both nRF51 (SDK12) &amp;amp; nRF52 (SDK13).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94048?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 21:06:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f954e409-31ea-4465-9713-348242a90c65</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;phone only caches when it bonds, don&amp;#39;t know about android (and suspect the behaviour might be different on different phones and oses).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94050?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 14:41:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1776e274-32ac-4fb8-b587-b50a109204f6</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Usually turn off and on the phone should also clear the cached ATT table if there is no bonding. Have you tried to test with normal SDK&amp;#39;s example ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94047?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 08:11:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e68a1dd6-ecb6-4438-ac01-e0aeebca83cd</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;that function still exists&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94046?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 07:30:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc508cb1-08a6-42d6-8636-25156defab52</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;@RK Thanks, but how do I now set the MAC address? sd_ble_gap_address_set() seems to have gone from the SDK. Is there an example app that sets it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94052?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 07:06:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94449466-4041-4dea-8e6a-b57313dcca74</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Thanks, I was indeed missing this code, having migrated from SDK 12 to 13 at the same time as from the nRF51 to nRF52, but adding it hasn&amp;#39;t fixed the problem. I see the same problem: the connection works, but no service discovery happens.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94038?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 23:29:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5f41580-eed6-4128-add8-6a1349d11fa9</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I have to go for caching as well - there&amp;#39;s nothing on the nordic side in those traces, the connection has been made, the peripheral is responding on time when requested, it&amp;#39;s the central which has sent out no single packet to ask any questions.&lt;/p&gt;
&lt;p&gt;@endnode to remove bonding on iPhone you just select the one device in the list and say &amp;#39;forget this device&amp;#39;, no need to remove all connections, I&amp;#39;ve done this a lot&lt;/p&gt;
&lt;p&gt;@eliot simple test - generate yourself a random MAC address before starting up the stack and set it, then test, if it&amp;#39;s caching that&amp;#39;ll prove it, if it&amp;#39;s not I&amp;#39;m fairly out of ideas.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94051?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 19:20:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a599859b-572d-4ec7-9703-dfbc45e46bda</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Do you have this function in your code ?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/**@brief Function for initializing the GATT library. */
void gatt_init(void)
{
    ret_code_t err_code;

    err_code = nrf_ble_gatt_init(&amp;amp;s_Gatt, gatt_evt_handler);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_gatt_att_mtu_periph_set(&amp;amp;s_Gatt, 64);
    APP_ERROR_CHECK(err_code);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to be called in your ble initialization after gap_param_init&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#if (NRF_SD_BLE_API_VERSION &amp;gt; 3)
    gatt_init();
#endif
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Could that be the problem ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94040?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 19:12:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:877c5da1-9912-4aca-8b02-cafe63244526</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;These two captures are targeting two advertisers each having different MAC address. Are you sure that one of them wasn&amp;#39;t cached as GATT Server on mobile side in any previous encounter? Also advertising data look like you are using DFU nor HRS demo for comparison (shouldn&amp;#39;t matter but it is confusing). Otherwise there is no obvious reason why should the phone (assuming it&amp;#39;s the same device?) do GATT Service Discovery on one target and not on the other....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94039?ContentTypeID=1</link><pubDate>Tue, 01 Aug 2017 18:20:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46795758-aad7-4b07-b094-d6399bbfec52</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;@Hung Bui Added two more captures above. How do I get logging out of the BLE sources in the SDK? What next?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94041?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 14:14:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d8ff156-e4b4-4d03-a2a0-c20f9d5ab6b2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I don&amp;#39;t see any problem from the peripheral side according to your sniffer trace. You may want to record another one. Also try to test with the SDK example for nRF52 for comparison.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94045?ContentTypeID=1</link><pubDate>Sat, 29 Jul 2017 15:20:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce98e291-6224-4d53-9b8c-521b19b604ec</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Just experience, 9 from 10 cases of &amp;quot;missing GATT Service Discovery on mobile phone side&amp;quot; is typically this;) If you say these devices never communicated before and this is definitely first connection which occurs then it must be something else. Although the trace doesn&amp;#39;t provide much other hints...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94044?ContentTypeID=1</link><pubDate>Sat, 29 Jul 2017 15:15:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdd8703c-1cac-4eb2-81fc-8ff4cbf06034</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Thanks, but what makes you think this is to do with GATT caching? There&amp;#39;s never been a successful connection and service discovery between this central (Android phone) and this peripheral (nRF52).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94043?ContentTypeID=1</link><pubDate>Sat, 29 Jul 2017 10:05:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8047733c-51d7-409b-bf82-36e9917506d4</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;&lt;code&gt;bike-tracker-nRF52-discovery-from-nrf-connect-android-app-2017-07.pcapng&lt;/code&gt; shows &lt;code&gt;CONNECT_REQ&lt;/code&gt; but no single PDU afterwards so it either failed or sniffer failed to follow the packets. Second &lt;code&gt;bike-tracker-nRF52-discovery-from-custom-android-app-2017-07.pcapng&lt;/code&gt; is better but as you said, no GATT procedure visible, just empty PDUs except &lt;code&gt;LL_FEATURE_REQ/RSP&lt;/code&gt; procedure. Note that basically all mobile phones today use GATT caching on Client side so to see whole Service discovery &amp;quot;like for the first time&amp;quot; you need to either change GAP Peripheral adv. (MAC) address or you need to erase cache on mobile side (which can be harder then it sounds, e.g. on iPhone you need to erase network settings which hurts because it deletes also other valuable pairings/keys including WiFi if I&amp;#39;m not mistaken, on Android it usually is enough to find &amp;quot;BT Share&amp;quot; or similar process and wipe all data).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94042?ContentTypeID=1</link><pubDate>Sat, 29 Jul 2017 09:29:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb5386a1-9efe-405f-b50b-c18b7be8899c</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;I&amp;#39;ve added Wireshark captures above, but don&amp;#39;t see the service discovery starting. I can see connection and bonding on one of the captures, then nothing. From the logcat on the Android side, I can see &lt;code&gt;BluetoothGatt.discoverServices()&lt;/code&gt; starting in our custom Android app. I&amp;#39;m using Segger RTT. The only logging I see regarding BLE stuff right now is coming from my own code, not the SDK sources.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51 to nRF52 migration, can't discover services</title><link>https://devzone.nordicsemi.com/thread/94037?ContentTypeID=1</link><pubDate>Fri, 28 Jul 2017 19:45:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ef83010-85ab-4cc1-8807-23d4ddcfdfd6</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Radio trace from BLE sniffer usually shows where GATT Service discovery procedure differs very quickly, I would start from there. When it comes to logging, are you using UART or SEGGER RTT? Is there anything going out over debug line and you just miss some particular module debug output (which?) or it doesn&amp;#39;t output anything at all?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>