<?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>a bt_gatt_dm error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119698/a-bt_gatt_dm-error</link><description>based on SDK v2.9.0 
 1 Central, 4 Peripherals, Repeat the following: 
 Power off 3 Peripherals, wait a while, power on 3 Peripherals. 
 
 The following error usually occurs on central when reconnecting. 
 [02:04:16.465,545] &amp;lt;err&amp;gt; bt_gatt_dm: Discover</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Jul 2025 06:32:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119698/a-bt_gatt_dm-error" /><item><title>RE: a bt_gatt_dm error</title><link>https://devzone.nordicsemi.com/thread/543095?ContentTypeID=1</link><pubDate>Tue, 22 Jul 2025 06:32:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1411a141-9e77-49e8-a792-c940c60fc170</guid><dc:creator>Leo Mo</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;span&gt;This is my configuration, for reference only.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BT=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_PERIPHERAL=y

CONFIG_BT_SMP=y
CONFIG_BT_BONDING_REQUIRED=y
CONFIG_BT_SMP_SC_PAIR_ONLY=y
CONFIG_BT_SMP_APP_PAIRING_ACCEPT=y
CONFIG_BT_PRIVACY=n
CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y

CONFIG_BT_MAX_PAIRED=20
CONFIG_BT_MAX_CONN=20
CONFIG_BT_BUF_ACL_TX_COUNT=20
CONFIG_BT_BUF_ACL_RX_COUNT=21
CONFIG_BT_USER_PHY_UPDATE=y
CONFIG_BT_AUTO_PHY_UPDATE=n

CONFIG_BT_GATT_DM=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_GATT_DYNAMIC_DB=y

CONFIG_BT_DEVICE_NAME=&amp;quot;xxx&amp;quot;

CONFIG_BT_DEVICE_NAME_DYNAMIC=y

CONFIG_BT_SETTINGS=y

CONFIG_BT_DIS=y
CONFIG_BT_DIS_SETTINGS=y
CONFIG_BT_DIS_MODEL=&amp;quot;unkown model&amp;quot;
CONFIG_BT_DIS_MANUF=&amp;quot;unkown manuf&amp;quot;
CONFIG_BT_DIS_SERIAL_NUMBER=y
CONFIG_BT_DIS_SERIAL_NUMBER_STR=&amp;quot;0&amp;quot;
CONFIG_BT_DIS_SW_REV=y
CONFIG_BT_DIS_SW_REV_STR=&amp;quot;0.1&amp;quot;
CONFIG_BT_DIS_FW_REV=y
CONFIG_BT_DIS_FW_REV_STR=&amp;quot;1.0&amp;quot;
CONFIG_BT_DIS_HW_REV=y
CONFIG_BT_DIS_HW_REV_STR=&amp;quot;1.0&amp;quot;

CONFIG_BT_BAS=y
CONFIG_BT_BAS_CLIENT=y
CONFIG_BT_GATTP=y
CONFIG_BT_ANCS_CLIENT=y
CONFIG_BT_NUS=y
CONFIG_BT_NUS_CLIENT=y&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a bt_gatt_dm error</title><link>https://devzone.nordicsemi.com/thread/542923?ContentTypeID=1</link><pubDate>Sat, 19 Jul 2025 10:40:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1ffc0a4-b87c-40f3-8f17-691c15402b63</guid><dc:creator>lzy</dc:creator><description>&lt;p&gt;&lt;span class="trans-sentence" data-index="0"&gt;Hello! &lt;/span&gt;&lt;span class="trans-sentence" data-index="1"&gt;I also encountered the problem of consent. I tried to increase CONFIG_BT_ATT_TX_COUNT=30, but the problem still existed. &lt;/span&gt;&lt;span class="trans-sentence" data-index="2"&gt;Do you have any suggestions for revision?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a bt_gatt_dm error</title><link>https://devzone.nordicsemi.com/thread/527065?ContentTypeID=1</link><pubDate>Thu, 13 Mar 2025 01:47:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c16ed94-df9e-47bb-ae92-c228f989fe6a</guid><dc:creator>Leo Mo</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It worked fine. Thank you!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Leo Mo.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a bt_gatt_dm error</title><link>https://devzone.nordicsemi.com/thread/527035?ContentTypeID=1</link><pubDate>Wed, 12 Mar 2025 17:59:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95431345-a39f-4338-a38c-65bc874ed70b</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user="leo mo bsa"]00&amp;gt; [00:11:48.919,128] &amp;lt;err&amp;gt; bt_gatt_dm: Discover failed, error: -12.[/quote]
&lt;p&gt;I think the error message is from this line&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.9.1/subsys/bluetooth/gatt_dm.c#L682-L684"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.9.1/subsys/bluetooth/gatt_dm.c#L682-L684&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You could try to adjust&amp;nbsp;CONFIG_BT_ATT_TX_COUNT.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;See description of&amp;nbsp;&lt;/span&gt;&lt;a title="" href="https://docs.nordicsemi.com/bundle/zephyr-apis-2.9.1/page/group_bt_gatt_client.html#gac06a945e5f7939b6716bc4f2cea781bd"&gt;&lt;code&gt;&lt;span&gt;bt_gatt_discover():&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;GATT Discover function.&lt;/p&gt;
&lt;p&gt;&lt;a title="" href="https://docs.nordicsemi.com/bundle/zephyr-apis-2.9.1/page/group_bt_gatt_client.html#gac06a945e5f7939b6716bc4f2cea781bd"&gt;&lt;code&gt;&lt;span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This procedure is used by a client to discover attributes on a server.&lt;/p&gt;
&lt;p&gt;&lt;a title="" href="https://docs.nordicsemi.com/bundle/zephyr-apis-2.9.1/page/group_bt_gatt_client.html#gac06a945e5f7939b6716bc4f2cea781bd"&gt;&lt;code&gt;&lt;span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Primary Service Discovery: Procedure allows to discover primary services either by Discover All Primary Services or Discover Primary Services by Service UUID. Include Service Discovery: Procedure allows to discover all Include Services within specified range. Characteristic Discovery: Procedure allows to discover all characteristics within specified handle range as well as discover characteristics with specified UUID. Descriptors Discovery: Procedure allows to discover all characteristic descriptors within specified range.&lt;/p&gt;
&lt;p&gt;&lt;a title="" href="https://docs.nordicsemi.com/bundle/zephyr-apis-2.9.1/page/group_bt_gatt_client.html#gac06a945e5f7939b6716bc4f2cea781bd"&gt;&lt;code&gt;&lt;span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For each attribute found the callback is called which can then decide whether to continue discovering or stop.&lt;/p&gt;
&lt;p&gt;&lt;a title="" href="https://docs.nordicsemi.com/bundle/zephyr-apis-2.9.1/page/group_bt_gatt_client.html#gac06a945e5f7939b6716bc4f2cea781bd"&gt;&lt;code&gt;&lt;span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Response comes in callback&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;params-&amp;gt;func&lt;/code&gt;. The callback is run from the BT RX thread.&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;params&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;must remain valid until start of callback where iter&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;attr&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;is&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;NULL&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;or callback will return&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;BT_GATT_ITER_STOP&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a title="" href="https://docs.nordicsemi.com/bundle/zephyr-apis-2.9.1/page/group_bt_gatt_client.html#gac06a945e5f7939b6716bc4f2cea781bd"&gt;&lt;code&gt;&lt;span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This function will block while the ATT request queue is full, except when called from the BT RX thread, as this would cause a deadlock.&lt;/p&gt;
&lt;p&gt;&lt;a title="" href="https://docs.nordicsemi.com/bundle/zephyr-apis-2.9.1/page/group_bt_gatt_client.html#gac06a945e5f7939b6716bc4f2cea781bd"&gt;&lt;code&gt;&lt;span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Parameters&lt;/dt&gt;
&lt;dd&gt;
&lt;div&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;conn&lt;/td&gt;
&lt;td&gt;Connection object.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;params&lt;/td&gt;
&lt;td&gt;Discover parameters.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;&lt;a title="" href="https://docs.nordicsemi.com/bundle/zephyr-apis-2.9.1/page/group_bt_gatt_client.html#gac06a945e5f7939b6716bc4f2cea781bd"&gt;&lt;code&gt;&lt;span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Return values&lt;/dt&gt;
&lt;dd&gt;
&lt;div&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;Successfully queued request. Will call&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;params-&amp;gt;func&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;on resolution.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-ENOMEM&lt;/td&gt;
&lt;td&gt;ATT request queue is full and blocking would cause deadlock. Allow a pending request to resolve before retrying, or call this function outside the BT RX thread to get blocking behavior. Queue size is controlled by
&lt;pre&gt;CONFIG_BT_ATT_TX_COUNT &lt;/pre&gt;
.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a bt_gatt_dm error</title><link>https://devzone.nordicsemi.com/thread/526845?ContentTypeID=1</link><pubDate>Wed, 12 Mar 2025 06:52:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17b40c4d-7b23-44ff-ade8-7d1d52bf59f7</guid><dc:creator>Leo Mo</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes,&amp;nbsp;&lt;span&gt;I&amp;#39;ve increased my CONFIG_HEAP_MEM_POOL_SIZE and CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE by more than 50% and still have this issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;00&amp;gt; [00:11:48.919,128] &amp;lt;err&amp;gt; bt_gatt_dm: Discover failed, error: -12.&lt;br /&gt;00&amp;gt; [00:11:48.919,158] &amp;lt;err&amp;gt; &lt;span style="color:#ff0000;"&gt;bt_gatt_dm: alloced_bytes 8912, free_bytes 6136, max_allocated_bytes 9256&lt;/span&gt;&lt;br /&gt;00&amp;gt; [00:11:48.919,219] &amp;lt;wrn&amp;gt; blea: Discovery start failed: 89:59:78:89:55:7A (public) index 4 uindex 0 err -12&lt;br /&gt;00&amp;gt; ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:430&lt;br /&gt;00&amp;gt; Controller unresponsive, command opcode 0x0406 timeout with err -11&lt;br /&gt;00&amp;gt; [00:11:58.919,433] &amp;lt;err&amp;gt; os: r0/a1: 0x00000003 r1/a2: 0x00000002 r2/a3: 0x00000001&lt;br /&gt;00&amp;gt; [00:11:58.919,433] &amp;lt;err&amp;gt; os: r3/a4: 0x00000003 r12/ip: 0x00000004 r14/lr: 0x0003f083&lt;br /&gt;00&amp;gt; [00:11:58.919,433] &amp;lt;err&amp;gt; os: xpsr: 0x01000000&lt;br /&gt;00&amp;gt; [00:11:58.919,464] &amp;lt;err&amp;gt; os: Faulting instruction address (r15/pc): 0x0003f092&lt;br /&gt;00&amp;gt; [00:11:58.919,494] &amp;lt;err&amp;gt; os: &amp;gt;&amp;gt;&amp;gt; ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0&lt;br /&gt;00&amp;gt; [00:11:58.919,525] &amp;lt;err&amp;gt; os: Current thread: 0x2001b680 (sysworkq)&lt;br /&gt;00&amp;gt; [00:11:59.150,421] &amp;lt;err&amp;gt; os: Halting system&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Leo Mo&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: a bt_gatt_dm error</title><link>https://devzone.nordicsemi.com/thread/526785?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 15:03:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88906dab-acb7-4908-aafe-a58687942743</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
[quote user=""][02:04:16.465,545] &amp;lt;err&amp;gt; bt_gatt_dm: Discover failed, error: -12.[/quote]
&lt;p&gt;&lt;span&gt;error code -12 corresponds to ENOMEM, which means &amp;quot;Not enough memory&amp;quot; or &amp;quot;Out of memory&amp;quot; in the Zephyr system.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you try to increase&amp;nbsp;CONFIG_HEAP_MEM_POOL_SIZE?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;br /&gt;Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>