<?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>Example NUS service, the packet transmission is very long.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114514/example-nus-service-the-packet-transmission-is-very-long</link><description>Using the nus central and peripheral examples from SDK_17.1.0 trying to transfer at least 1 kilobytes per second. 
 Peripheral on nRF52840 PCA10059, central on nrf52832 pca10040. 
 Successfully set BLE_GAP_PHY_2MBPS mode and buffer size 244 bytes. 
 MIN_CONN_INTERVAL</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 Sep 2024 15:22:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114514/example-nus-service-the-packet-transmission-is-very-long" /><item><title>RE: Example NUS service, the packet transmission is very long.</title><link>https://devzone.nordicsemi.com/thread/501580?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 15:22:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:577eca75-40e1-488e-ae36-56910529cf92</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Unrelated, but perhaps useful:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/69687/how-to-check-if-the-nus-tx-buffer-is-empty/285841"&gt;how-to-check-if-the-nus-tx-buffer-is-empty&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Example NUS service, the packet transmission is very long.</title><link>https://devzone.nordicsemi.com/thread/501557?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 13:23:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac09e0d1-ae3f-4e82-b6a0-66e491ff75bf</guid><dc:creator>sevstels</dc:creator><description>&lt;p&gt;Tried to do that a few days ago. But it&amp;#39;s not working for you either. Try it yourself. Your sniffer is not installed in WireShark and is not visible there, it doesn&amp;#39;t work. And there is no time to mess around with it.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s why I used Ubertooth &lt;a href="https://github.com/sevstels/Ubertooth-Win"&gt;github.com/.../Ubertooth-Win&lt;/a&gt; The packets seem to be fine.&lt;/p&gt;
&lt;p&gt;Today I found that debug output in SDK was not fully disabled and it was messing up packets in UART channel. It started working better, but there are still isolated losses of blocks. And it&amp;#39;s somewhere in the USB-COM link and the Windows driver. Probably the J-Link gate is also messing something up.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I would like to know what event the event appears on: BLE_GATTS_EVT_HVN_TX_COMPLETE&lt;/p&gt;
&lt;p&gt;Is this the end of the buffer transfer, or the end of the connection interval?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Example NUS service, the packet transmission is very long.</title><link>https://devzone.nordicsemi.com/thread/501513?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 11:04:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dd6c7e8-ca80-43e5-a80c-41a36b379667</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Are you able to capture a sniffer trace of what&amp;#39;s happening on-air, and save and upload it here?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Example NUS service, the packet transmission is very long.</title><link>https://devzone.nordicsemi.com/thread/501368?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2024 12:38:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa3d8020-f43d-4062-b743-339567b5ba24</guid><dc:creator>sevstels</dc:creator><description>&lt;p&gt;nrf_log output had to delete, it was useless. Because it doesn&amp;#39;t work via J-Link, it just freezes and stops displaying messages through the viewer. And there is no UART on the dongle.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not spinning in that cycle. The output from there is no more than 60us. CLRBIT(TEST_PIN2);&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the bottom line. But the event BLE_GATTS_EVT_HVN_TX_COMPLETE: comes after 60ms already&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;ry increasing&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH&amp;nbsp; again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This would make sense if the packet is longer than 20 bytes. I tried sending: 1, 2, 4, 8, 16 bytes in one call of BLE_PeripheralSend(). The busy length (Green line) does not change and is strictly equal to 60ms.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Increased the memory size. NRF_SDH_BLE_GAP_EVENT_LENGTH = 60&amp;nbsp; Now the application does not crash. But the transfer speed did not increase. Transmission time of one packet is still 60ms. &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1725542789381v1.jpeg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Packets are still missing. To keep them from disappearing, I have to make the interval between packets more than 200ms. You can see here that a 100 byte packet is missing.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1725542939722v2.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Example NUS service, the packet transmission is very long.</title><link>https://devzone.nordicsemi.com/thread/501366?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2024 12:33:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d73837b-860a-4e99-90c7-80826a648205</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
[quote user=""]Implemented all the recommendations from it. But it does not solve the problem. If you use NRF_SDH_BLE_GAP_EVENT_LENGTH more than 6, the application immediately fails.[/quote]
&lt;p&gt;You need to allocate more RAM to the SoftDevice. You should be able to see in the nrf_log output what changes are needed.&lt;/p&gt;
[quote user=""]From one to 200, the transmission length is about 60 ms. If you start loading new data at this interval, the packets disappear. Instead of 1ms, it takes 60 times longer.[/quote]
&lt;p&gt;You are likely just spinning in the&amp;nbsp;ble_nus_data_send() loop until the block is transferred. Try increasing&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH&amp;nbsp; again.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>