<?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>How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39079/how-to-increase-notification-throughput-on-nrf52840</link><description>Hello there, 
 I&amp;#39;m developing a C++ application on the BLE654 development bord which shall be able to generate and send 100+ BLE notifications per second on a single BLE connection. 
 On my first try it managed 5. 
 After some digging, I found that the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 30 Nov 2018 12:08:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39079/how-to-increase-notification-throughput-on-nrf52840" /><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/159692?ContentTypeID=1</link><pubDate>Fri, 30 Nov 2018 12:08:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46fd7bad-f6cd-4402-bbbb-781193e61371</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;I finally managed to nail down the problem. It seems that the only thing wrong with my application was that I set BLE_GATT_ATT_MTU_DEFAULT to 247. This seems to produce some undefined/unexpected behaviour of yout BLE stack.&lt;/p&gt;
&lt;p&gt;I now have&lt;/p&gt;
&lt;p&gt;BLE_GATT_ATT_MTU_DEFAULT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23&lt;/p&gt;
&lt;p&gt;NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247&lt;/p&gt;
&lt;p&gt;The actual MTU of course is lower than 247 Bytes thanks to the phone on the other side.&lt;/p&gt;
&lt;p&gt;Still, I now can accumuate my data and can send one notification instead of ten, which is a tremendous help. Btw, I still use sd_ble_gatts_hvx() for this, I didn&amp;#39;t have to use the nus.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your help (and patience) in the last weeks!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lasse&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/159175?ContentTypeID=1</link><pubDate>Tue, 27 Nov 2018 09:00:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4943740-32f1-4503-bfa4-3805db7390fe</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Lasse,&lt;/p&gt;
&lt;p&gt;I am sorry, but I am starting to loose track of where we are. Your phone supports a higher MTU, and the ble_app_uart example from SDK15.2.0 does as well, so there is something missing from your project that is not allowing it, I think.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you have gatt_init as in the ble_app_uart example?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void gatt_init(void)
{
    ret_code_t err_code;

    err_code = nrf_ble_gatt_init(&amp;amp;m_gatt, gatt_evt_handler);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_gatt_att_mtu_periph_set(&amp;amp;m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE); //247
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What is your&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH in sdk_config.h?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you compare your gatt values from the log in the ble_app_uart example and your example?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In both projects, set&amp;nbsp;#define NRF_LOG_DEFAULT_LEVEL 4 in sdk_config.h, and make sure you are looking at the log, and not the uart output in ble_app_uart. You need to check the RTT log.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Try to send a string larger than 20 bytes using the ble_app_uart example. You should see a string longer than 20 *cencored* bytes in the mobile application. Do you see a string longer than this in your example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/158857?ContentTypeID=1</link><pubDate>Fri, 23 Nov 2018 14:26:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e04e885-82be-4352-be27-5faff4d9fb87</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Using nRF Connect I see the same *censored* 20 Bytes I saw with any other application so far.&lt;/p&gt;
&lt;p&gt;However, there is something curious: If I use the &amp;quot;Request MTU&amp;quot; command from the Menu besides &amp;quot;SERVER&amp;quot; to increase the MTU to x Bytes, nRF Connect shows x-3 Bytes (the header, I know) of my string. That&amp;#39;s great, but...&lt;/p&gt;
&lt;p&gt;-The gatt_evt_handler() of my device still says that the nRF Connect requested 0xF7 Bytes regardless of the Value I entered. I have no confirmation that the actual x Value was send to the device.&lt;/p&gt;
&lt;p&gt;-Only the first time I use &amp;quot;Request MTU&amp;quot; triggers the gatt_evt_handler(). I have to dis- and reconnect the device for it to trigger the gatt_evt_handler() again.&lt;/p&gt;
&lt;p&gt;-If I increase the MTU twice (i.e to 40 and then 60 Bytes) the nRF Connect still only shows 37 Bytes. If I increase and then decrease the MTU (i.e to 40 ant then 30 Bytes) the nRF Connect doesn&amp;#39;t show any new notifications (allthoug it will again if i increase the MUT back to 40 or more).&lt;/p&gt;
&lt;p&gt;Do you know if this behaviour is a (misunderstood) feature or a bug in the nRF Connect?&lt;/p&gt;
&lt;p&gt;I&amp;#39;d love to send you a sniffer log of this, but still, we can&amp;#39;t get the sniffer to work.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lasse&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: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/158549?ContentTypeID=1</link><pubDate>Thu, 22 Nov 2018 08:12:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5629d0d6-75e6-4116-b189-8ce0d71eddd1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok. But when you try to send one single string of length 80 bytes, or even longer, what is shown in nRF Connect? do you see the entire string?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/158477?ContentTypeID=1</link><pubDate>Wed, 21 Nov 2018 15:22:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eebb7ce5-7f0e-4425-a08b-b744d5a6e6c9</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;we have tried to get the sniffer working on three PC by now, but we had no success. We have followed the instructions as well as the steps in the troubleshooting chapter, but we couldn&amp;#39;t find an error. And yes, we tried multiple times.&lt;/p&gt;
&lt;p&gt;The screenshot was from the Toolbox, yes. I also have the Connect app, though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/156136?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 11:41:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1475d48c-d029-4e51-b8c4-323d2a195a38</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;The nRF Sniffer is a bit buggy if everything isn&amp;#39;t correct with the segger versions. Did you remember to flash the sniffer-DK with the firmware for nRF Sniffer?&lt;/p&gt;
&lt;p&gt;If it still doesn&amp;#39;t show up, try to close it and open it again (Wireshark), and it usually shows up after a few tries. Also remember to reset the DK after programming. Turn it off and on to be sure.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry that this description isn&amp;#39;t very good. I usually have to close and open Wireshark a couple of times myself, but because it works eventually, I haven&amp;#39;t looked into why it doesn&amp;#39;t show up.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can try to update to the latest version of nRF Connect. Have you tested the nRF Connect app for mobile by the way? It looks ilke your screenshots is from nRF Toolbox, is that correct?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/156122?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 11:04:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bb7cadf-3a6c-45d8-a2c7-3667e9dd5660</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;it doesn&amp;#39;t complain. It always returns NRF_SUCCESS.&lt;/p&gt;
&lt;p&gt;p_len is 86 Byte (I&amp;#39;m trying a fixed string at the moment), the array is fine.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/hv_5F00_params.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t sniff the BLE connection. I&amp;#39;ve tried to get the sniffer software running on two different PCs, but each time anything didn&amp;#39;t work (usually the sniffer wasn&amp;#39;t visible in wiresharks main window).&lt;/p&gt;
&lt;p&gt;I willl try a third time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lasse&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/156012?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 15:28:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8eb23755-0bff-4a17-b5c3-3c1589aa0a1e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok. So then we know that the phone supports more than MTU = 247 bytes, and it is actually updating to it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the part that you have imported from the ble_app_uart example, can you see if you can find out where it complains after 20 bytes? Do you get the return value NRF_SUCCESS (=0) if you try to send more than 20 bytes?&lt;/p&gt;
&lt;p&gt;If it does, can you try to set a breakpoint on&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx() and look at the parameters that you are sending? Is the array larger than 20? Is p_len larger than 20?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is it possible to do a sniffer log of the connection?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/155983?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 14:16:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a38c702f-0770-4cbe-9e7d-79af09eb3dc9</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;Your &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-bfd49c17f88b449e8ff71af2c3cbb296/test_5F00_app_5F00_2.hex"&gt;test_app_2.hex&lt;/a&gt;&amp;#39; application produced the following output:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;lt;info&amp;gt; app: Connected&lt;br /&gt;&amp;lt;info&amp;gt; nrf_ble_gatt: server_rx_mtu = 247, p_link-&amp;gt;att_mtu_desired = 247&lt;br /&gt;&amp;lt;info&amp;gt; app: Data len is set to 0xF4(244)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My application gave me&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;ATT MTU exchange completed. central 0xf7 peripheral 0xf7&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lasse&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/155409?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 16:15:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aac62849-e77f-4126-a0b5-5ce0f1dd7705</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Oh. sorry again. I forgot to mention that the log backend is RTT. Can you check it with the RTT viewer? The same as I used in an earlier reply.&lt;/p&gt;
&lt;p&gt;Can you enable RTT logging on your project as well, and then check the RTT output on both applications?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can find RTT viewer &lt;a href="https://www.segger.com/products/debug-probes/j-link/tools/rtt-viewer/"&gt;here&lt;/a&gt;, if you don&amp;#39;t have it already.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/155343?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 13:26:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebc7c2dc-a205-4453-b9fa-ea62c32447e7</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I wasn&amp;#39;t able to use the your application with our first tablet (it always lost connection during service discovery), but it worked with the 2nd one.&lt;/p&gt;
&lt;p&gt;this is what I got:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot_5F00_20181031_2D00_135932.jpeg" alt=" " /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot_5F00_20181031_2D00_135942.jpeg" alt=" " /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Tera.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The line beginning with &amp;quot;Es ist der Vater&amp;quot; was send from the dev kit to the tablet; more than 20 Bytes received, all fine.&lt;/p&gt;
&lt;p&gt;However, when I compile and run the example code, i get the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Screenshot_5F00_20181031_2D00_140514.jpeg" alt=" " /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/Tera2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The red error message occured wehin I tried to send data to the device (not good, but not my main concern). The &amp;quot;Er erreicht&amp;quot; line was send from the device to the tablet. it is longer than 20 Bytes, but only the first 20 Byte are shown in the application.&lt;/p&gt;
&lt;p&gt;What have you done that I am missing?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note: In these screenshots I used two different DVK-BL654 boards, but I also tried it on the same board. The results were the same (your App worked, mine not).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/155289?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 10:27:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83c5baf0-3cc0-409f-847a-e369be25a1b3</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry. I forgot. Try this one, then:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-bfd49c17f88b449e8ff71af2c3cbb296/test_5F00_app_5F00_2.hex"&gt;devzone.nordicsemi.com/.../test_5F00_app_5F00_2.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(this .hex file also includes the softdevice)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/155208?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 16:26:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eac1a7dc-1a5b-4371-844a-53d735906bfd</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;the app doesn&amp;#39;t say anything. It seems that it isn&amp;#39;t running at all (or at least, it isn&amp;#39;t running very long).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think the problem may be the soft device clock configuration. We are using a DVK-BL654 development kit which doesn&amp;#39;t feed the XTAL clock. Since most examples do use the XTAL clock source I think your code does too, in wich case it will stall as soon as the soft device is initialized.&lt;/p&gt;
&lt;p&gt;Here are our soft device clock settings:&lt;/p&gt;
&lt;p&gt;#define NRF_SDH_CLOCK_LF_SRC 0&lt;br /&gt;#define NRF_SDH_CLOCK_LF_RC_CTIV 16&lt;br /&gt;#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2&lt;br /&gt;#define NRF_SDH_CLOCK_LF_ACCURACY 1&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lasse&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/154849?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 11:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca21250f-4520-475a-a05e-6b7cdebd9849</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Try to program the attached app on your device, and check the RTT log. What does it say?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-bfd49c17f88b449e8ff71af2c3cbb296/test_5F00_app.hex"&gt;devzone.nordicsemi.com/.../test_5F00_app.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;NB:&lt;/p&gt;
&lt;p&gt;The app is an application AND the softdevice, so no need to program the softdevice first.&lt;/p&gt;
&lt;p&gt;Just use:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;em&gt;nrfjprog -e &amp;amp;&amp;amp; nrfjprog --program test_app.hex &amp;amp;&amp;amp; nrfjprog --reset&lt;/em&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;Then connect to it with your android devices, and check the log. The app should advertise as Nordic_UART.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/154834?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 10:35:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb8f5833-aab0-4069-8242-99ce32f29319</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;&amp;gt; Do you use the unmodified example, ble_app_uart from SDK15.2.0, or did you pull some parts of it into your application?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I did both, each with at least two different android devices. In neither case the &amp;quot;Data len is set to ...&amp;quot; line was called (only &amp;quot;ATT MTU exchange completed. central 0xF7 peripheral 0xF7&amp;quot;).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Regarding the &amp;quot;kill&amp;quot;: I didn&amp;#39;t want to say that the application ran into a hard fault or similar problems. It runs fine and stable. What I meant was that it is pointless for me to increase the MTU and/or use the nus as long as the 20 byte restriction still is in place (whatever the reason may be).&lt;br /&gt;&lt;br /&gt;Sorry for the misunderstanding.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;No, I don&amp;#39;t have a sniffer trace. I keep trying.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lasse&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/154385?ContentTypeID=1</link><pubDate>Thu, 25 Oct 2018 07:39:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f1c2c21-04f0-4742-8e80-852288b3f899</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Lasse,&lt;/p&gt;
&lt;p&gt;I am a bit confused. Do you use the unmodified example, ble_app_uart from SDK15.2.0, or did you pull some parts of it into your application? The reason that I ask is that the unmodified example should ask for a higher MTU (247), but most phones don&amp;#39;t allow this, and typically gives a bit less.&lt;/p&gt;
&lt;p&gt;Is it possible to do a sniffer trace of your connection? If possible, the &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF-Sniffer"&gt;nRF Sniffer&lt;/a&gt; would be sufficient.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When you said, a couple of posts ago, &amp;quot;the 20 byte border kills this approach&amp;quot;&lt;/p&gt;
&lt;p&gt;Can you try to debug to see what &amp;quot;kills&amp;quot; the application? It is probably an APP_ERROR_CHECK that receives an err_code != NRF_SUCCESS. Can you see where it comes from?&lt;/p&gt;
&lt;p&gt;Most likely it is ble_nus_data_send() if that is the only thing you change, but can you also debug to check whether it is the sd_ble_gatts_hvx(), or one of the checks before? And what value does it return?&lt;/p&gt;
&lt;p&gt;I tested just now with the unmodified example from SDK15.2.0, and the log output is like this when I connect with an iPhone 8:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-bfd49c17f88b449e8ff71af2c3cbb296/pastedimage1540452450674v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I then modified the example to send a dummy array of size 182 with some random numbers whenever the uart handler triggered, and it was sent with the return value NRF_SUCCESS, and I received this array on my phone when notifications were enabled.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you check the log output when you run your application. I don&amp;#39;t know what your pcb looks like, but if you are able to program the chip, you should be able to view the RTT log using the same application as in the screenshot above.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/154306?ContentTypeID=1</link><pubDate>Wed, 24 Oct 2018 14:14:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f14a742-5c98-4f9d-8042-d91b8718222a</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;the&amp;nbsp; gatt_evt_handler() isn&amp;#39;t called.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve logged the m_ble_nus_max_data_len value prior to a call to ble_nus_data_send(); it was an unchanged 247.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best redargs,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lasse&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/153994?ContentTypeID=1</link><pubDate>Tue, 23 Oct 2018 08:24:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d3f6d7e-d791-4790-b782-e7fef992a1eb</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Lasse,&lt;/p&gt;
&lt;p&gt;You are correct. ble_nus_data_send will only use the sd_ble_gatts_hvx() function, in addition to doing some checks first, e.g. that notifications is enabled and that the conn_handle is correct, and so on.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you check whether you get the gatt_evt_handler() callback function? If you do, what is the att_mtu_effective from the event?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the ble_app_uart example, the gatt_evt_handler() looks like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void gatt_evt_handler(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_t const * p_evt)
{
    if ((m_conn_handle == p_evt-&amp;gt;conn_handle) &amp;amp;&amp;amp; (p_evt-&amp;gt;evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED))
    {
        m_ble_nus_max_data_len = p_evt-&amp;gt;params.att_mtu_effective - OPCODE_LENGTH - HANDLE_LENGTH;
        NRF_LOG_INFO(&amp;quot;Data len is set to 0x%X(%d)&amp;quot;, m_ble_nus_max_data_len, m_ble_nus_max_data_len);
    }
    NRF_LOG_DEBUG(&amp;quot;ATT MTU exchange completed. central 0x%x peripheral 0x%x&amp;quot;,
                  p_gatt-&amp;gt;att_mtu_desired_central,
                  p_gatt-&amp;gt;att_mtu_desired_periph);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;What is the m_ble_nus_max data_len after this call?&lt;/p&gt;
&lt;p&gt;You can&amp;nbsp;log it like it is done in this function:&lt;/p&gt;
&lt;p&gt;NRF_LOG_INFO(&amp;quot;Data len is set to 0x%X(%d)&amp;quot;&lt;span&gt;, m_ble_nus_max_data_len&lt;/span&gt;&lt;span&gt;, m_ble_nus_max_data_len&lt;/span&gt;);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/153639?ContentTypeID=1</link><pubDate>Fri, 19 Oct 2018 12:42:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c4b30bd-d8ed-4227-9e0b-5050ff2cc5a0</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;br /&gt;&lt;br /&gt;I&amp;#39;m using SDK 15.2.0.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve tried to integrate the nus from the ble_uart_example into my code. However it didn&amp;#39;t work as expected, since the notifications I send were truncated after 20 Byte. This is the same behaviour i got with a normal notification and the sd_ble_gatts_hvx() function. After digging through the nus code, I saw that it essentially boils down to calling the sd_ble_gatts_hvx(), so this is not a big surprise after all.&lt;br /&gt;I may have overlooked something, but at this point I cannot see why I should need the nus - I could as well hand the array in which I accumulated the data to sd_ble_gatts_hvx() directly.&lt;br /&gt;&lt;br /&gt;Either way, the 20 byte border kills this approach.&lt;br /&gt;&lt;br /&gt;These are the parameters I&amp;#39;ve used:&lt;br /&gt;&lt;br /&gt;#define NRF_SDH_BLE_GAP_DATA_LENGTH 251&lt;br /&gt;#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247&lt;br /&gt;#define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 14080&lt;br /&gt;&lt;br /&gt;After negotiation, the mtu size was still 247 byte.&lt;br /&gt;&lt;br /&gt;Any more Ideas?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lasse&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/151669?ContentTypeID=1</link><pubDate>Thu, 04 Oct 2018 12:48:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f667752d-379c-4568-b3aa-535537a7ae15</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;There is no functionality in the SoftDevice to put together small packets to larger packets, unfortunately. You will have to do this in the application. So you have to collect the data that you want to send in larger packs, before you send them to the softdevice. The limit of the size of the pack is defined by the MTU size of the connection.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know what SDK version you use, but at least in the later SDKs, v15.0.0 and later, the ble_app_uart example is initialized with maximum MTU. The actual MTU, though, is dependent on the connected device. If it is a fairly new mobile phone, you will usually get an MTU of about 180B, but if it is connected to another nRF (with the ble_app_uart_c example) you will get the maximum possible MTU of 247.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can see the actual MTU in the&amp;nbsp;gatt_evt_handler(), which will update the m_ble_nus_max_data_len in the ble_app_uart example.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you change the application to send messages based on UART input, but instead send packets from the main-loop, you can test the throughput.&lt;/p&gt;
&lt;p&gt;In this example, you can use ble_nus_data_send() with arrays of size m_ble_nus_max_data_len, and send them until you get the return value NRF_ERROR_RESOURCES. This means that your queue is full. Then you must wait for the&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE event (you must add this to the&amp;nbsp;ble_evt_handler() ), which means that a packet has been ACKed, and you can queue another.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/151656?ContentTypeID=1</link><pubDate>Thu, 04 Oct 2018 12:23:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc84f2a2-6222-4fcb-8268-bc1b46791160</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;the throughput is definitively our priority. A latency of ~100 ms is no problem, and even if it gets larger we can accept it as long as no notifications get lost.&lt;/p&gt;
&lt;p&gt;You say that a high connection interval is preferrable for our application due to the lesser overhead. So far I consent, but my problem is that no matter if the interval is 200ms or 20 ms, only one notification is transferred per interval (5 at 200ms, (nearly) 50 at 20 ms).&lt;/p&gt;
&lt;p&gt;Is there an option i&amp;#39;ve overlooked (or uintentionally set) that has to be set (or unset) to enable the soft device to gather several notifications in one big packet?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lasse&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/151650?ContentTypeID=1</link><pubDate>Thu, 04 Oct 2018 11:53:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efe5631d-a0f0-4a46-807d-2d42f09cedd5</guid><dc:creator>LWittland</dc:creator><description>&lt;p&gt;Ih Nathan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using sd_ble_gatts_hvx() with BLE_GATT_HVX_NOTIFICATION type, so unless there is some hidden overruling at work I&amp;#39;m certain that it ain&amp;#39;t indications.&lt;/p&gt;
&lt;p&gt;Thanks for the CONNECTION_PRIORITY_HIGH advice, I&amp;#39;ll forward it to our android programmer (I&amp;#39;m programming the embedded side only) and let you know how it worked.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lasse&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/151205?ContentTypeID=1</link><pubDate>Tue, 02 Oct 2018 11:07:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d374d61f-c8a8-4211-a435-07e166903ebe</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Lasse,&lt;/p&gt;
&lt;p&gt;It is true, like &lt;a href="https://devzone.nordicsemi.com/members/nathan"&gt;Nathan&lt;/a&gt; says, a phone will give an application 100% of the radio time, so a phone will typically not allow a connection interval too low.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The minimum connection interval allowed by the BLE stack is 7.5ms. At this connection interval, you will not have time to&amp;nbsp;send 6 packets (because 1 packet takes longer than 7.5ms/6). However, phones would typically allow 15ms or 30ms connection intervals.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What is the critical part for your application? Do you need updates every 10ms (low latency), or do you need a high throughput?&lt;/p&gt;
&lt;p&gt;Low latency =&amp;gt; short connection interval =&amp;gt; more. but shorter packages =&amp;gt; more headers =&amp;gt; less throughput.&lt;/p&gt;
&lt;p&gt;High latency offers longer packs which could mean less headers and more throughput.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So do you need to transfer data continuously, and is it important that the phone receives these packs as soon as possible, or is it OK for the application to gather up several packs and send it as one big pack?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to increase notification throughput on nRF52840?</title><link>https://devzone.nordicsemi.com/thread/151045?ContentTypeID=1</link><pubDate>Mon, 01 Oct 2018 16:41:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad4750c9-ccac-4403-9015-05e341568d1d</guid><dc:creator>Nathan</dc:creator><description>&lt;p&gt;Hi Lasse,&lt;/p&gt;
&lt;p&gt;Although your device can do better than what it&amp;#39;s currently handling, you won&amp;#39;t get 6 notifications in 7.5ms connection intervals on pretty much any phone out there. The phone operating system has to allow an arbitrary number of Bluetooth apps to run simultaneously, so it won&amp;#39;t allow a single application to hog the entire radio interface for itself. On the latest OS&amp;#39;s it might be a bit better, but a couple years ago I found that most phones at the time would allow either 6 notifications at 30ms connection intervals max, or 4 notifications at 20ms connection intervals max, which both come out to ~4KB/s theoretical max rate assuming 20 byte packets for BLE 4.0 level operation. You can now take advantage of BLE 4.2 and 5.0&amp;#39;s longer packet sizes to increase the throughput though.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One thing you could do that could help right away is in your application, from the Bluetooth GATT class call the requestConnectionPriority function with the CONNECTION_PRIORITY_HIGH argument. What this will do is cause Android to pick the lowest connection interval that both the phone and the device will support, so you can keep reasonable MIN_CONN_INTERVAL and MAX_CONN_INTERVAL values in your device code. When you&amp;#39;re done with high transfer rate, you can call requestConnectionPriority again with either the balanced or the low priority settings to save battery power.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To queue up multiple notifications, push the data you want to output to the phone onto&amp;nbsp;a software queue, and call a function that tries to write them out&amp;nbsp;to the softdevice in a loop. The softdevice call that handles putting a packet onto its outgoing queue is sd_ble_gatts_hvx, and once it has all the notifications it can handle it will return with the error code NRF_ERROR_RESOURCES. Basically whenever &lt;span&gt;sd_ble_gatts_hvx&lt;/span&gt; returns success, remove the packet from your software queue and try pushing&amp;nbsp;the next one. If you get an error or run out of packets to queue up, break out of the loop and retry after getting a&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE event from the BLE events handler.&amp;nbsp;The event will tell you how many notifications were sent successfully during the connection interval associated with the event.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also I&amp;#39;m pretty sure you&amp;#39;ve check this already but just to double check, make sure you&amp;#39;re using notifications and not indications, as indications are limited to one at a time max.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Edit: Whoops, needed to read your notes, you&amp;#39;re already doing the &lt;span&gt;NRF_ERROR_RESOURCES thing. The exact size of the internal queue should be 6, so you could write a piece of test code to verify it. And definitely check that you&amp;nbsp;aren&amp;#39;t accidentally doing indications instead of notifications.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>