<?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>Getting instantly disconnected when trying to connect to BLE (0x3e with HCI)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/122574/getting-instantly-disconnected-when-trying-to-connect-to-ble-0x3e-with-hci</link><description>Hello, 
 I’m having an issue with my setup: I have a nRF9160 running the bt/peripheral sample through a nRF52840 (running the hci_lpuart sample). It seems to work fine with nRF SDK v2.7.0. However when embedded in my application, I have a somewhat erratic</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 27 Jun 2025 14:04:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/122574/getting-instantly-disconnected-when-trying-to-connect-to-ble-0x3e-with-hci" /><item><title>RE: Getting instantly disconnected when trying to connect to BLE (0x3e with HCI)</title><link>https://devzone.nordicsemi.com/thread/540735?ContentTypeID=1</link><pubDate>Fri, 27 Jun 2025 14:04:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d58cbaa-1f2f-4863-bdd9-2485dcec7bff</guid><dc:creator>GilDev</dc:creator><description>&lt;p&gt;After multiple days of digging, it seems that I found the issue.&lt;/p&gt;
&lt;p&gt;I had an orphaned `BT_DATA_BYTES(BT_DATA_UUID_ALL)` in my advertisement data, which looked like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static const struct bt_data ad[] = {
	BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
	BT_DATA_BYTES(BT_DATA_UUID16_ALL),
	BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_CUSTOM_SERVICE_VAL),
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;That middle line should have been entirely removed when I adapter the zephyr/peripheral sample, which looks like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static const struct bt_data ad[] = {
	BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
	BT_DATA_BYTES(BT_DATA_UUID16_ALL,
		      BT_UUID_16_ENCODE(BT_UUID_HRS_VAL),
		      BT_UUID_16_ENCODE(BT_UUID_BAS_VAL),
		      BT_UUID_16_ENCODE(BT_UUID_CTS_VAL)),
	BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_CUSTOM_SERVICE_VAL),
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I guess some smartphones use Bluetooth stacks that are more strict than others, which made the whole thing crash somehow. I wonder if Android could have given me some useful logs about this&amp;hellip;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>