<?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>Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111838/bluetooth-hci-lpuart-issue---nrf9160-nrf52840</link><description>Hello, 
 I&amp;#39;m using nRF9160 as a HCI host and nRF52840 as HCI controller (nRF52840 config is based on HCI lpuart example). My application receives data over Bluetooth using notifications. To handle the notifications data I use a message queue and a workqueue</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Sep 2024 10:50:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111838/bluetooth-hci-lpuart-issue---nrf9160-nrf52840" /><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/502279?ContentTypeID=1</link><pubDate>Thu, 12 Sep 2024 10:50:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b39b5772-cd1b-46ba-aa14-760453e9219e</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/td_5f00_filip"&gt;tdfilip&lt;/a&gt;&amp;nbsp; &lt;a href="https://devzone.nordicsemi.com/members/vibe"&gt;Vidar Berg&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you share how to implement hadware flow control?&lt;/p&gt;
&lt;p&gt;I have this in my overlay file:&lt;/p&gt;
&lt;div style="background-color:#1f1f1f;color:#cccccc;font-family:&amp;#39;mononoki&amp;#39;, &amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace, &amp;#39;Droid Sans Fallback&amp;#39;, &amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;/&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#4ec9b0;"&gt;chosen&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;zephyr,bt-uart&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&amp;amp;&lt;/span&gt;&lt;span style="color:#4ec9b0;"&gt;uart1&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#4ec9b0;"&gt;uart1&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;current-speed&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &amp;lt;&lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;1000000&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;status&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;hw-flow-control&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;pinctrl-0&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &amp;lt;&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#4ec9b0;"&gt;uart1_default_alt&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;pinctrl-1&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &amp;lt;&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#4ec9b0;"&gt;uart1_sleep_alt&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;pinctrl-names&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;default&amp;quot;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;sleep&amp;quot;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#6a9955;"&gt;// lpuart: nrf-sw-lpuart {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#6a9955;"&gt;// compatible = &amp;quot;nordic,nrf-sw-lpuart&amp;quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#6a9955;"&gt;// status = &amp;quot;okay&amp;quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#6a9955;"&gt;// req-pin = &amp;lt;24&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#6a9955;"&gt;// rdy-pin = &amp;lt;25&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#6a9955;"&gt;// };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and this in my thingy conf file:&lt;/p&gt;
&lt;div style="background-color:#1f1f1f;color:#cccccc;font-family:&amp;#39;mononoki&amp;#39;, &amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace, &amp;#39;Droid Sans Fallback&amp;#39;, &amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#6a9955;"&gt;# CONFIG_NRF_SW_LPUART=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#6a9955;"&gt;# CONFIG_NRF_SW_LPUART_INT_DRIVEN=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#6a9955;"&gt;# CONFIG_UART_1_ASYNC=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;CONFIG_UART_1_INTERRUPT_DRIVEN&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#6a9955;"&gt;# CONFIG_UART_1_NRF_HW_ASYNC=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#6a9955;"&gt;# CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m getting an assert though:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:333&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; command opcode 0x0c03 timeout with err -11&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Assotiated line in hci_core is this:&lt;/p&gt;
&lt;div style="background-color:#1f1f1f;color:#cccccc;font-family:&amp;#39;mononoki&amp;#39;, &amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace, &amp;#39;Droid Sans Fallback&amp;#39;, &amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;err&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;k_sem_take&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;(&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;sync_sem&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;HCI_CMD_TIMEOUT&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;BT_ASSERT_MSG&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;(&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;err&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;==&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;0&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;command opcode 0x&lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;%04x&lt;/span&gt;&lt;span style="color:#ce9178;"&gt; timeout with err &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;%d&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;opcode&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;, &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;err&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/502264?ContentTypeID=1</link><pubDate>Thu, 12 Sep 2024 09:34:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6303a9c0-7979-497d-9921-4c657912ef22</guid><dc:creator>miceuz</dc:creator><description>&lt;p&gt;I am experiencing the same issues when getting a quite intense stream of notifications from peripheral.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/501471?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 07:16:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41754249-bfe4-44f7-aba2-97dac75a78ec</guid><dc:creator>tdfilip</dc:creator><description>&lt;p&gt;Hello, is there any update on that topic?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/495679?ContentTypeID=1</link><pubDate>Thu, 25 Jul 2024 15:21:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2aeab1c-28a7-44f9-85e4-981984dacad5</guid><dc:creator>sfemat</dc:creator><description>&lt;p&gt;I have a Thingy91 and facing the same errors&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;wrn&amp;gt; lpuart: req pin low when expected high&lt;br /&gt;[00:00:00.265,869] &amp;lt;err&amp;gt; lpuart: Empty receiver state:4&lt;/p&gt;
&lt;p&gt;and constant crashes even by using the lte_ble_gateway sample + hci_lpuart. From the crashes there seems to be some sort of timeout in the hci communication with the 52840&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/492629?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 08:29:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a2b1a57-9475-44c3-9472-583a44b08e1c</guid><dc:creator>tdfilip</dc:creator><description>&lt;p&gt;I changed back HCI to use lpuart but with baudrate 1000000 and I applied both changes you linked but it didn&amp;#39;t help. These logs show up while receiving the&amp;nbsp;data with notifications:&lt;/p&gt;
&lt;p&gt;&amp;lt;wrn&amp;gt; lpuart: req pin low when expected high&lt;br /&gt;&amp;lt;err&amp;gt; lpuart: Empty receiver state:4&lt;br /&gt;&amp;lt;err&amp;gt; bt_driver: Unknown H:4 type 0x00&lt;br /&gt;&amp;lt;err&amp;gt; bt_driver: Unknown H:4 type 0x00&lt;br /&gt;&amp;lt;wrn&amp;gt; bt_hci_core: Unexpected HOST_NUM_COMPLETED_PACKETS (status 0x0c)&lt;/p&gt;
&lt;p&gt;Bluetooth stops working after that.&lt;/p&gt;
&lt;p&gt;In addition, after adding modification to uart_nrf_sw_lpuart.c, application after power up goes to zephyr fatal error and logs:&lt;br /&gt; ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:331&lt;br /&gt;command opcode 0x0c03 timeout with err -11&lt;/p&gt;
&lt;p&gt;After restart, bluetooth starts without problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/492373?ContentTypeID=1</link><pubDate>Fri, 05 Jul 2024 07:47:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfe5aecf-a8d4-4fd4-a0f7-e75e6c14597b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It seems like the&amp;nbsp;HWFC control will interfere with the REQ/RDY handling in the LP UART implementation. However, I&amp;#39;ve discussed the case with one of the developers, and I thought your initial issue may have been caused by the bug addressed by this PR:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/14609"&gt;https://github.com/nrfconnect/sdk-nrf/pull/14609&lt;/a&gt;. Could you please try to cherry-pick this commit and increase the receive buffer (&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/ef120afe4d0d3e8a40c664f7f4c40881c456017b/drivers/serial/Kconfig.nrf_sw_lpuart#L41"&gt;https://github.com/nrfconnect/sdk-nrf/blob/ef120afe4d0d3e8a40c664f7f4c40881c456017b/drivers/serial/Kconfig.nrf_sw_lpuart#L41&lt;/a&gt;)&amp;nbsp;to 512, then try again with your original project?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/492255?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2024 12:38:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c5476e9-095e-4763-831d-811100176dbd</guid><dc:creator>tdfilip</dc:creator><description>&lt;p&gt;After some debugging I can say that&amp;nbsp;&lt;span&gt;bt_gatt_write_without_response function blocks forever because it waits for being able to allocate network buffer (in file buf.c, function net_buf_alloc_len). The timeout for this operation is set to K_FOREVER in function bt_att_chan_create_pdu in file att.c. I tried to change the timeout to 1 second and disconnect if timeout happens. When the issue occured I disconnected and on each of the following connections, the network buffer could never be allocated again. Do you have any&amp;nbsp;suggestions why would the network buffer become unavailable to be allocated forever?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edit 1&lt;br /&gt;I turned on CONFIG_NET_BUF_LOG and now if the issue occurs with timeout set to K_FOREVER I can see in logs:&lt;br /&gt;&amp;lt;wrn&amp;gt; net_buf: bt_l2cap_create_pdu_timeout():645: Pool 0x2002081c low on buffers.&lt;br /&gt;&amp;lt;wrn&amp;gt; net_buf: bt_l2cap_create_pdu_timeout():645: Pool 0x2002081c blocked for 1 secs&lt;br /&gt;&amp;lt;wrn&amp;gt; net_buf: bt_l2cap_create_pdu_timeout():645: Pool 0x2002081c low on buffers.&lt;br /&gt;&amp;lt;wrn&amp;gt; net_buf: bt_l2cap_create_pdu_timeout():645: Pool 0x2002081c blocked for 2 secs&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and this shows up every second.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/492067?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2024 12:43:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc118bad-51d7-49cc-ad6b-6c781d71a984</guid><dc:creator>tdfilip</dc:creator><description>&lt;p&gt;I would be grateful if you could look into 6 pins solution.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m testing my application with HWFC and 1000000 baudrate and I didn&amp;#39;t see any issues from the origin post.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, now I&amp;#39;m facing another issue which didn&amp;#39;t occur before. During the connection I use bt_gatt_write_without_response function to send commands over bluetooth (10 bytes max). I execute it from my custom workqueue (based on the function description - if used from outside the BT RX thread, it acts like a blocking function) and randomly this function might block forever - it never returns. I don&amp;#39;t see any related information in logs. This issue doesn&amp;#39;t seem to occur when I change optimization from CONFIG_DEBUG_OPTIMIZATIONS to CONFIG_SIZE_OPTIMIZATIONS but I wouldn&amp;#39;t take it as a solution. Do you think of any reason why would that happen?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/492060?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2024 12:23:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19b57b65-3544-4312-9915-28b639f7dc01</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I can&amp;#39;t immediately think of any reasons why this would not work if you can afford to use the extra pins. I can look into it, but perhaps you should try stress testing your application again to verify if enabling HWFC fixed the reliability issues you had first.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/492022?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2024 09:25:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acb51ff1-c34d-47b3-9d76-87a35a9f1c12</guid><dc:creator>tdfilip</dc:creator><description>&lt;p&gt;Thank you, now the hardware flow control works with HCI.&lt;/p&gt;
&lt;p&gt;Would it be possible to use lpuart with hardware flow control to lower the idle current consumption?&amp;nbsp;&lt;br /&gt;If I wired 6 pins between nRF91 and nRF52 (tx, rx, rts, cts, req, rdy) - would it make sense?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/491802?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2024 10:24:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a940d13-f650-44f4-b6ad-2250160a1e45</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;You need to use the interrupt-driven API as that is what is implemented in the HCI host driver.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/491796?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2024 09:46:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f963a2cc-42b1-40b7-b427-8334f343e788</guid><dc:creator>tdfilip</dc:creator><description>&lt;p&gt;I assume that this modification is also needed:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_UART_2_ASYNC=y
CONFIG_UART_2_INTERRUPT_DRIVEN=n
CONFIG_UART_2_NRF_HW_ASYNC=y
CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;into&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_UART_1_ASYNC=y
CONFIG_UART_1_INTERRUPT_DRIVEN=n
CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;After above modification I still can&amp;#39;t get bluetooth working with hardware flow control. Can you confirm that you can get bluetooth working on nRF9160dk using HCI_UART for nRF52 and LTE_BLE_GATEWAY for nRF91?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/491732?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2024 06:51:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84380553-c794-483c-b13d-5ddffd7b4d57</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Sure. For the nrf9160 target, you can use these overlays:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;nrf9160dk_nrf52840_reset_on_if5.dtsi&amp;gt;
#include &amp;lt;nrf9160dk_uart1_on_if0_3.dtsi&amp;gt;

/ {
	chosen {
		zephyr,bt-uart=&amp;amp;uart1;
	};
};

&amp;amp;uart1 {
	current-speed = &amp;lt;1000000&amp;gt;;
	hw-flow-control;
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nrf9160dk_5F00_nrf9160_5F00_ns_5F00_0_5F00_14_5F00_0.overlay"&gt;devzone.nordicsemi.com/.../nrf9160dk_5F00_nrf9160_5F00_ns_5F00_0_5F00_14_5F00_0.overlay&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/491621?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2024 13:16:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f03cdd4-bfe6-4175-bb48-f8c0cdb2c7b0</guid><dc:creator>tdfilip</dc:creator><description>&lt;p&gt;Could you show me&amp;nbsp;what should be modified in .dts, .conf and _defconfig files in both nRF91 and nRF52 applications to make it use hardware flow control?&lt;/p&gt;
&lt;p&gt;For nRF52 I followed HCI uart sample but I don&amp;#39;t see any sample that shows how to configure nRF91 to work with HCI uart.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/491059?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2024 09:47:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f9efa18-efa1-4845-baa0-8f1dc83821bb</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Sorry, I thought the host the was using the Async API, but I see the HCI driver uses the interrupt API, and I don&amp;#39;t think it will help if the async API is only used on one side of the connection. I have reported the issues you have experienced internally. Another option would be to use the HCI uart sample with the regular driver and HW flow control, but then you will get an increased idle current as long as the BT stack is enabled, or run the whole BT application (host + controller) on the nRF52840 and only expose a&amp;nbsp;custom&amp;nbsp;command interface to the nRF9160 for sending and receiving BLE data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/490582?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2024 10:38:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d447504-0423-4d5c-a213-b09463b9a11b</guid><dc:creator>tdfilip</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;So, based on hci_uart_async I copied files main.c and hci_uart_async.c to my nRF52840 project and changed configuration to the following:&lt;br /&gt;&lt;br /&gt;dts:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
    chosen {
        zephyr,bt-c2h-uart=&amp;amp;bt_c2h_uart;
    };
};

&amp;amp;pinctrl {
	uart1_default_alt: uart1_default_alt {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 20)&amp;gt;,
					&amp;lt;NRF_PSEL(UART_RX, 0, 13)&amp;gt;,
					&amp;lt;NRF_PSEL(UART_RTS, 0, 14)&amp;gt;,
					&amp;lt;NRF_PSEL(UART_CTS, 0, 15)&amp;gt;;
		};
	};

	uart1_sleep_alt: uart1_sleep_alt {
		group1 {
			psels = &amp;lt;NRF_PSEL(UART_TX, 0, 20)&amp;gt;,
					&amp;lt;NRF_PSEL(UART_RX, 0, 13)&amp;gt;,
					&amp;lt;NRF_PSEL(UART_RTS, 0, 14)&amp;gt;,
					&amp;lt;NRF_PSEL(UART_CTS, 0, 15)&amp;gt;;
			low-power-enable;
		};
	};
};

bt_c2h_uart: &amp;amp;uart1 {
	status = &amp;quot;okay&amp;quot;;
	current-speed = &amp;lt;1000000&amp;gt;;
	hw-flow-control;

	pinctrl-0 = &amp;lt;&amp;amp;uart1_default_alt&amp;gt;;
	pinctrl-1 = &amp;lt;&amp;amp;uart1_sleep_alt&amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;prj.conf:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y

CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_H4=y
CONFIG_BT_HCI_RAW_H4_ENABLE=y

CONFIG_BT_WAIT_NOP=y

CONFIG_BT_BUF_ACL_RX_SIZE=255
CONFIG_BT_BUF_ACL_TX_SIZE=255
CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255

CONFIG_UART_CONSOLE=n&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;board_defconfig:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_SOC_SERIES_NRF52X=y
CONFIG_SOC_NRF52840_QIAA=y
CONFIG_BOARD_xyz=y

CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y

CONFIG_GPIO=y
CONFIG_PINCTRL=y
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512

CONFIG_BT_TINYCRYPT_ECC=n
CONFIG_BT_CTLR_ASSERT_HANDLER=n

CONFIG_UART_1_ASYNC=y
CONFIG_UART_1_INTERRUPT_DRIVEN=n
CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Now nRF9160 logs the following on system start and resets:&lt;/p&gt;
&lt;p class="p1"&gt;00&amp;gt; *** Booting nRF Connect SDK v3.5.99-ncs1-1 ***&lt;br /&gt;00&amp;gt; [1970-01-01 00:00:03.039000]&amp;lt;wrn&amp;gt; bt_hci_core: opcode 0x0400 pool id 3 pool 0x20020974 != &amp;amp;hci_cmd_pool 0x200209cc&lt;br /&gt;00&amp;gt; [1970-01-01 00:00:03.039000]&amp;lt;err&amp;gt; bt_driver: Unknown H:4 type 0x0e&lt;/p&gt;
&lt;p&gt;Do I miss something in nRF52840 configuration?&amp;nbsp;What should I change in nRF9160 configuration?&lt;/p&gt;
&lt;p&gt;Also, is it possible to run hci_uart_async sample (nRF52840) and lte_ble_gateway sample (nRF9160) together on nrf9160dk? Should it work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/490005?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2024 14:14:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d8cb197-493f-42b9-a1dc-930bf9cd6351</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Could you try to enable the LP UART driver in the&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/zephyr/samples/bluetooth/hci_uart_async/README.html"&gt;HCI UART based on ASYNC UART&lt;/a&gt;&amp;nbsp;sample instead? The ASYNC implementation should enable more reliable communcation at higher data rates than the interrupt-driven API.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/487832?ContentTypeID=1</link><pubDate>Fri, 07 Jun 2024 07:04:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5be17961-1b17-4a27-beb3-7bbcc10e74a3</guid><dc:creator>tdfilip</dc:creator><description>[quote userid="4240" url="~/f/nordic-q-a/111838/bluetooth-hci-lpuart-issue---nrf9160-nrf52840/487750"]Is the application allowed to returned to the idle thread after you&amp;#39;ve sent the disconnect, or is it busy with other tasks? It unepexted if the disconnect callback never comes through. Are you observing any HCI errors when this happens?[/quote]
&lt;p&gt;I put a log in an idle thread every second and I can see that after executing bt_conn_disconnect, idle thread still works. My other threads also work. No HCI errors observed in logs. The bt_conn_disconnect also doesn&amp;#39;t return any error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth HCI lpuart issue - nRF9160 + nRF52840</title><link>https://devzone.nordicsemi.com/thread/487750?ContentTypeID=1</link><pubDate>Thu, 06 Jun 2024 13:39:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5c23d35-392d-445e-95d8-60f0382a3b21</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I will try to see if I can replicate the HCI communication issues on my end, but did not get time to get started on that today. Will update the ticket when I have had a chance to try this.&lt;/p&gt;
[quote user=""]&lt;div&gt;&lt;span&gt;To do it, I execute bt_conn_disconnect in a workqueue that handles notification data. Using sniffer, I can see that the disconnect command goes to the peripheral device and the connection ends. The problem is that I do not receive a disconnected callback.&amp;nbsp;&lt;/span&gt;&lt;span&gt;When I disconnect after receiving all the data, the disconnected callback is executed.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Any help would be greatly appreciated.&lt;/span&gt;&lt;/div&gt;[/quote]
&lt;p&gt;Is the application allowed to returned to the idle thread after you&amp;#39;ve sent the disconnect, or is it busy with other tasks? It unepexted if the disconnect callback never comes through. Are you observing any HCI errors when this happens?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>