<?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>Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61560/stopping-the-nrf52832-uart-sample</link><description>Hi, 
 If the app keeps sending data at a certain rate, the numbers will skip and the software will stop. 
 I tried to see how much data I could communicate and at what speed. So, I made it possible to increment and send numbers at regular intervals from</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Jun 2020 09:13:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61560/stopping-the-nrf52832-uart-sample" /><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/255446?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 09:13:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83ace6ae-ad06-4aea-94c6-7c886ffc3e72</guid><dc:creator>mamorudeta</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;span&gt;Vidar Berg&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your quick reply.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I understand.&lt;br /&gt;It was really helpful. Thank you for your long term relationship with us.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/255426?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 08:24:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bb2db8c-ceb4-46b1-a45a-280aecbda082</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This means that the BT chipset on your phone does not support longer data packets (ie the 244 byte payload will be split into multiple 27-byte radio packets on-air).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/255376?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 03:50:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2708884a-293d-4711-a968-784a2e035f0c</guid><dc:creator>mamorudeta</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi, Vidar Berg&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your quick reply.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I tried it with the attached settings. In my environment, it was about 80~100 kbps. Overall, it&amp;#39;s now up to 72 kbps, which is much faster than before.&lt;br /&gt;Let me just ask one last question.&lt;br /&gt;The following log is output when bonding with Android 7.0.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).
&amp;lt;info&amp;gt; app: Data len is set to 0xF4(244)
&amp;lt;debug&amp;gt; app: ATT MTU exchange completed. central 0xF7 peripheral 0xF7
&amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 27 on connection 0x0.
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 27
&amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 27&lt;/pre&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;max_tx_octets(and max_rx_octets?) is going to be 247, why is it 27?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;And where can I change this setting?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/254936?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 09:25:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd6fcca2-d68b-49f0-9831-770732485a9b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry, I looked over the project again and see that I had configured NRF_SDH_BLE_GAP_DATA_LENGTH to 27 instead of 251. I had also kept the default NRF_SDH_BLE_GAP_EVENT_LENGTH setting. Both of these will have a significant impact on the transfer speed given that the phone you are connected to support the same configuration.&lt;/p&gt;
&lt;p&gt;Please try the attached configuration and see if you can get closer to the numbers listed in the Softdevice specification.&lt;/p&gt;
&lt;p&gt;New configuration tested with Google Pixel 2 running Android 10:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-dccfa96bd1fa4b4db815e9b14736beda/pastedimage1592212922818v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Attachment:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-dccfa96bd1fa4b4db815e9b14736beda/pca10040_5F00_throughput_5F00_fix.zip"&gt;devzone.nordicsemi.com/.../pca10040_5F00_throughput_5F00_fix.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/254903?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 08:06:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40fef4b2-6864-4e1f-aa58-e51001b6b02a</guid><dc:creator>mamorudeta</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi, Vidar Berg&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your quick reply.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I tried it with the file you attached (I only had Android).&lt;br /&gt;The result was about 26~30 kbps. Android-nRF-UART, Android-nRF-ToolBox, and my own application all had similar results.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/253471?ContentTypeID=1</link><pubDate>Fri, 05 Jun 2020 09:39:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec7c6699-7a55-4dd8-92a7-3736bb637cbd</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi, I see. Could you try the modified example attached below and see if it gives you better results? I got around 66 kbps with my iPhone 8. The transfer speed is printed out on RTT.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-dccfa96bd1fa4b4db815e9b14736beda/ble_5F00_app_5F00_uart.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_uart.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/253208?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 09:00:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0e70c7e-9fe7-44a0-a901-3f6ab6dabe1f</guid><dc:creator>mamorudeta</dc:creator><description>&lt;p&gt;Hi, Vidar Berg&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your quick reply.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m sorry for the confusion. We&amp;#39;ve already tried to send it in 247 bytes. As a result, it&amp;#39;s only slightly faster.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/253203?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 08:47:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb08616a-0f30-49fc-bea0-8a9f7ed52dac</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="90456" url="~/f/nordic-q-a/61560/stopping-the-nrf52832-uart-sample/253189"]&amp;quot;m_ble_nus_max_data_len&amp;quot; was already set to a maximum value of 247.[/quote]
&lt;p&gt;That means you could have sent the data in one 70 byte package instead of 10 7-byte packets.&lt;/p&gt;
&lt;p&gt;1. Shorter connection intervals should be requested by the peripheral which you can do by adjusting the MIN_CONN_INTERVAL and MAX_CONN_INTERVAL settings in main.c.&lt;/p&gt;
&lt;p&gt;For selecting connection parameters I&amp;#39;d suggest you follow the recommendations given in the Apple accessory design guidelines, section 35.6 (&lt;a href="https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf"&gt;link&lt;/a&gt;). Phones will generally accept the connection param update requests if you follow these.&lt;/p&gt;
&lt;p&gt;2. I&amp;#39;m not sure, unfortunately.&lt;/p&gt;
&lt;p&gt;3. The throughput is limited because you are splitting the data into multiple smaller notifications packets.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/253189?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 08:05:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5da442a-b851-43de-b69e-a3eb6960c960</guid><dc:creator>mamorudeta</dc:creator><description>&lt;p&gt;Hi, Vidar Berg&lt;/p&gt;
&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;&amp;quot;m_ble_nus_max_data_len&amp;quot; was already set to a maximum value of 247.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Is there any way to shorten the connection interval for Android apps?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Do you know how to turn off &amp;quot;D/BluetoothGatt: onNotify()~&amp;quot; in Android app&amp;#39;s log when receiving data?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Is there any other way to improve the speed on the android app side?&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/252953?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 10:01:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b69c392-9cb0-44af-b00e-1c64931d0c6a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. Would it make sense to put more data in each packet rather than having several small packets? That will lower the overhead and increase the throughput significantly. Each notification packet can be &amp;#39;m_ble_nus_max_data_len&amp;#39; bytes long.&lt;/p&gt;
&lt;p&gt;2. It would allow you to queue more packets without getting the NRF_ERROR_RESOURCES&amp;nbsp; error, but it won&amp;#39;t prevent the error if you send data fast enough.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3. This is a generic and common error from Android that can mean a lot of things. It&amp;#39;s often related to sudden disconnects. I&amp;#39;d suggest to debug the FW side to see if any error or disconnect events occur.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/252922?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 08:41:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d722b793-19d5-4a99-9cab-17c4f08d2f4d</guid><dc:creator>mamorudeta</dc:creator><description>&lt;p&gt;Hi, Vidar Berg&lt;/p&gt;
&lt;p&gt;I apologize for the delay in replying.&lt;/p&gt;
&lt;p&gt;Once I created my own test tool using Android-BLE-Library, the missing numbers were gone.&lt;br /&gt;In addition, in order to speed up throughput, we changed the interrupt processing for receiving UART in ble_app_uart to just adding it to the ring buffer. In doing so, we were able to send 10 packets with a data size of 6~7 bytes with an interval of 1 ms. I can get about 28 kbps at maximum.&lt;/p&gt;
&lt;p&gt;1. Is it possible to make it faster?&lt;/p&gt;
&lt;p&gt;2. In addition, NRF_ERROR_RESOURCES is raised in the bleep_nus_data_send function, which causes a delay in transmission. I think the way to deal with this is to increase ble_cfg.conn_cfg.params.gatts_conn_cfg.hvn_tx_queue_size, but is there any other way?&lt;/p&gt;
&lt;p&gt;3. I have a bug (status=133) that doesn&amp;#39;t connect with my own Android test application for the first time, but it always connects with Android-nRF-ToolBox. It doesn&amp;#39;t make much difference in connection processing, but is there something special that needs to be done?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/251593?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 06:28:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6357e5aa-b080-417a-8ea5-6489d4050363</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Some missing bytes may be expected as you are ignoring UART communications errors. To narrow down the problem, are you able to get debug logs from the FW app that shows if the data gets successfully sent from the nRF52?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/251209?ContentTypeID=1</link><pubDate>Fri, 22 May 2020 09:41:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f045a3b4-eb56-4f3e-8c1b-e58b96748b91</guid><dc:creator>mamorudeta</dc:creator><description>&lt;p&gt;Hi, Vidar Berg&lt;/p&gt;
&lt;p&gt;Thank you for your quick reply.&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp;Commenting out as you answered did not result in an error. In addition, when I checked &amp;quot;p_event-&amp;gt;data.error_communication&amp;quot;, I found it to be &amp;quot;1&amp;quot;, indicating that it was a buffer overrun.&lt;/p&gt;
&lt;p&gt;2. This was due to the fact that the Android application did not check for sending errors.&lt;/p&gt;
&lt;p&gt;I have one more new question.&lt;/p&gt;
&lt;p&gt;I changed the Android application to &amp;quot;Android nRF Toolbox&amp;quot; and made a few changes to it as a testing tool in the same way.&lt;br /&gt;When sending data from the serial monitor to the Android application side at high speed, the missing data occurred. As a trial, I made the function immediately after receiving the data to output the received data to the log.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;// UARTService.java for Android-nRF-ToolBox
public class UARTService extends BleProfileService implements UARTManagerCallbacks {
    ...
    @Override
    public void onDataReceived(@NonNull final BluetoothDevice device, final String data) {
        Log.d(TAG, data);
        ...
    }
    ...
}&lt;/pre&gt;&lt;br /&gt;However, at this point I found it to be missing. This problem did not occur when using &amp;quot;Android-nRF-UART&amp;quot;.&lt;br /&gt;What do you think is the cause?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Stopping the nRF52832 uart sample.</title><link>https://devzone.nordicsemi.com/thread/250651?ContentTypeID=1</link><pubDate>Tue, 19 May 2020 09:56:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4420bca7-a47e-46a8-8ff7-0a01bcc95b70</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. You may get the &amp;quot;overrun error&amp;quot; (see &lt;span&gt;&lt;a title="ERRORSRC" href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/uarte.html?cp=4_0_0_5_33_8_20#register.ERRORSRC"&gt;ERRORSRC&lt;/a&gt;&lt;/span&gt;) if the UART transfer speed exceeds the transfer speed of your BLE link. The reason for this is that the send loop will become blocking while waiting for the NRF_ERROR_RESOURCES error to clear and thus prevent the UARTE buffer from being read.&lt;/p&gt;
&lt;p&gt;To confirm that this is indeed the problem, try to comment out the code shown below from your UART event handler and see if it still stops:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        /* Handle UARTE communications errors. Comment APP_ERROR_HANDLER() to ignore lost packets */
        case APP_UART_COMMUNICATION_ERROR:
            APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);
            break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This will make the FW ignore any communication errors on the UART interface.&lt;/p&gt;
&lt;p&gt;2. Have you done any customizations to the original ble_app_uart example? Packets will get sent as long as ble_nus_data_send() returns NRF_SUCCESS (ie link will be terminated if not)&lt;/p&gt;
&lt;p&gt;3. Throughput is likely going to be limited by the tablet in this case. Particularly if you are testing with an older Model running Android 7. Throughput numbers with nRF52&amp;#39;s on both sides of the link can be found in the Softdevice specification here: &lt;span&gt;&lt;a title="Bluetooth Low Energy data throughput" href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/ble_data_throughput/ble_data_throughput.html?cp=4_6_2_0_16"&gt;Bluetooth Low Energy data throughput&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Note that the UART v.2.0 mobile app has replaced by the UART app in nRF Toolbox.&amp;nbsp; &lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>