<?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>central_uart example UART Rx can not receive all data sometimes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109226/central_uart-example-uart-rx-can-not-receive-all-data-sometimes</link><description>Hi, 
 NCS v2.4.3 
 nRF52DK (nRF52832) 
 Based on central_uart example, I extend MTU to 247 and UART_BUF_SIZE to 500, 
 and I send UART hex data from PC to DK with 61 bytes to test, 
 
 I output log in uart_cb(), case UART_RX_RDY : 
 
 Sometime RX receive</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Apr 2024 08:48:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109226/central_uart-example-uart-rx-can-not-receive-all-data-sometimes" /><item><title>RE: central_uart example UART Rx can not receive all data sometimes</title><link>https://devzone.nordicsemi.com/thread/478488?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2024 08:48:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2dc2859-881b-41e7-a54b-34b8734538ec</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There should be default configurations in the samples. I&amp;#39;m not aware of any specific overview of all Kconfig options specifically for BT connections. The guide you linked tries to explain the concepts and helps you determining what to configure. There is a complete &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.0/kconfig/index.html"&gt;Kconfig reference&lt;/a&gt; in the SDK documentation, but this is primarily helpful when you know exactly what you are looking for, or when you can to check what a specific Kconfig does.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: central_uart example UART Rx can not receive all data sometimes</title><link>https://devzone.nordicsemi.com/thread/476111?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2024 11:01:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d81fe177-ed2c-4254-9e44-0c7e3a95a52a</guid><dc:creator>Felix Shih</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There are many differences with this configuration set,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/building-a-bluetooth-application-on-nrf-connect-sdk-part-3-optimizing-the-connection"&gt;Building a Bluetooth application on nRF Connect SDK - Part 3 Optimizing the connection&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2 id="mcetoc_1ftnicups1"&gt;2.2 NUS throughput example&lt;/h2&gt;
&lt;p&gt;How to decide which configuration is&amp;nbsp;mandatory or option?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: central_uart example UART Rx can not receive all data sometimes</title><link>https://devzone.nordicsemi.com/thread/475953?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 14:03:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0810900-71df-43e4-85de-ecc682ea6d77</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You might have to increase the data length in order to send the packets correctly. Try adding something like this to your prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BT_DATA_LEN_UPDATE=y
CONFIG_BT_HCI_ACL_FLOW_CONTROL=y
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_CTLR=y
CONFIG_BT_CTLR_RX_BUFFERS=10
CONFIG_BT_BUF_ACL_TX_COUNT=10
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: central_uart example UART Rx can not receive all data sometimes</title><link>https://devzone.nordicsemi.com/thread/475841?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2024 09:19:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3a4d53a-cefe-4e9f-9dca-2840bd272e62</guid><dc:creator>Felix Shih</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1) I update to NCS v2.6.0, so it need to use send interval less than 800ms to reproduce the issue now. If send with 800ms interval, it send a few packets normally and then show error messages, but if less than 700ms interval, it show the error messages at the first.&lt;/p&gt;
&lt;p&gt;2) the connection interval should be default values, I don&amp;#39;t change it.&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_GAP_INIT_CONN_INT_MIN&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;0x0018&lt;/span&gt;&lt;span&gt; &amp;nbsp;/* 30 ms &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;BT_GAP_INIT_CONN_INT_MAX&lt;/span&gt;&lt;span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;0x0028&lt;/span&gt;&lt;span&gt; &amp;nbsp;/* 50 ms &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;3) I send 207 bytes from central UART to test it, the test hex value string as the following:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;41542b0051c801020304050607080910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989900010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899000a&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;the RTT log:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; [00:00:00.006,896] &amp;lt;inf&amp;gt; fs_nvs: 6 Sectors of 4096 bytes
00&amp;gt; [00:00:00.006,927] &amp;lt;inf&amp;gt; fs_nvs: alloc wra: 0, f70
00&amp;gt; [00:00:00.006,927] &amp;lt;inf&amp;gt; fs_nvs: data wra: 0, 118
00&amp;gt; [00:00:00.007,110] &amp;lt;inf&amp;gt; bt_sdc_hci_driver: SoftDevice Controller build revision: 
00&amp;gt;                                             36 f0 e5 0e 87 68 48 fb  02 fd 9f 82 cc 32 e5 7b |6....hH. .....2.{
00&amp;gt;                                             91 b1 5c ed                                      |..\.             
00&amp;gt; [00:00:00.010,711] &amp;lt;inf&amp;gt; bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
00&amp;gt; [00:00:00.010,742] &amp;lt;inf&amp;gt; bt_hci_core: HW Variant: nRF52x (0x0002)
00&amp;gt; [00:00:00.010,772] &amp;lt;inf&amp;gt; bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870
00&amp;gt; [00:00:00.011,413] &amp;lt;inf&amp;gt; bt_hci_core: No ID address. App must call settings_load()
00&amp;gt; [00:00:00.011,413] &amp;lt;inf&amp;gt; central_uart: Bluetooth initialized
00&amp;gt; [00:00:00.012,329] &amp;lt;inf&amp;gt; bt_hci_core: Identity: C1:69:8A:90:[00:00:13.908,386] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:14.459,625] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:15.321,746] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:15.862,976] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:16.725,067] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:17.266,265] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:18.108,367] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:18.669,586] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:19.521,697] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:20.062,896] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:20.904,998] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:21.466,217] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:22.308,319] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:22.869,537] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:23.711,639] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:24.252,868] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:25.114,959] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:25.656,158] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am not sure captured the data what you need to watch, the sniffer log is as the follows.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/240326_5F00_NUS-send-timeout.pcapng"&gt;devzone.nordicsemi.com/.../240326_5F00_NUS-send-timeout.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: central_uart example UART Rx can not receive all data sometimes</title><link>https://devzone.nordicsemi.com/thread/475714?ContentTypeID=1</link><pubDate>Mon, 25 Mar 2024 15:00:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3684cf7c-7d9b-4c74-b54d-9bfdeb4d283b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>[quote user="Felix168"]But when I send data size to 207 bytes in 1000ms interval, the BLE failed to send data,[/quote]
&lt;p&gt;Does it work for the first packets, or it never works from the first connection?&lt;/p&gt;
&lt;p&gt;What is the connection interval for the BLE connection? Can you provide a sniffer trace?&lt;/p&gt;
&lt;p&gt;Error -120 means &amp;quot;&lt;span&gt;Operation already in progress&amp;quot;.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: central_uart example UART Rx can not receive all data sometimes</title><link>https://devzone.nordicsemi.com/thread/474044?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2024 10:08:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2ab2acf-461b-4a6e-8443-3c1ca744bd6d</guid><dc:creator>Felix Shih</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1) 115200 8-n-1&lt;/p&gt;
&lt;p&gt;2) use nRF52DK, its VCOM, no HW flow control&lt;/p&gt;
&lt;p&gt;3) another serial terminal still have the same issue&lt;/p&gt;
&lt;p&gt;4) the original unmodified NCS sample limit to 20 bytes, it happened in large data size, need to extend UART buffer and MTU.&lt;/p&gt;
&lt;p&gt;5) I found this thread&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/109034/data-loss-with-nordic-uart-service"&gt;Data Loss With Nordic Uart Service&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;add&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_UART_0_NRF_HW_ASYNC&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CONFIG_UART_0_NRF_HW_ASYNC_TIMER=1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;to prj.conf seem fix UART Rx issue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But when I send data size to 207 bytes in 1000ms interval, the BLE failed to send data, and cause not run k_free() in&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;ble_data_sent&lt;/span&gt;&lt;span&gt;() then UART can not k_malloc() success.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;How to improve it?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; [00:00:01.344,512] &amp;lt;inf&amp;gt; central_uart: Service discovery completed
00&amp;gt; [00:00:31.065,216] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:31.905,487] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:33.053,070] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:33.916,748] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:35.065,765] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:35.915,405] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:37.058,563] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:37.905,853] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:39.055,389] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:39.901,641] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:41.064,086] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:41.913,696] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:43.063,781] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:43.912,200] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:45.060,913] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:45.905,578] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:47.056,152] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:47.901,214] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:49.066,131] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:49.912,597] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:51.063,079] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:51.912,811] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:53.058,593] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:53.905,120] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:55.053,314] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:55.901,123] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:55.901,184] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:56.914,154] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:57.065,704] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:57.913,330] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:57.913,391] &amp;lt;wrn&amp;gt; central_uart: Failed to send data over BLE connection(err -120)
00&amp;gt; [00:00:57.963,470] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:58.013,580] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:58.063,720] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:58.913,940] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:58.964,080] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:59.014,190] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:59.064,300] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:59.065,124] &amp;lt;wrn&amp;gt; central_uart: NUS send timeout
00&amp;gt; [00:00:59.114,410] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:59.164,520] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer
00&amp;gt; [00:00:59.214,630] &amp;lt;wrn&amp;gt; central_uart: Not able to allocate UART receive buffer&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: central_uart example UART Rx can not receive all data sometimes</title><link>https://devzone.nordicsemi.com/thread/473932?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2024 15:00:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6c7b72e-47fb-4c3d-8333-027b36bde4cd</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which baudrate are you using? Do you have HW flow control pins enabled?&lt;/p&gt;
&lt;p&gt;Have you tested different serial terminals on the PC to see if that makes any difference?&lt;/p&gt;
&lt;p&gt;Are you testing with the unmodified central_uart sample? If not, what changes have you made?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>