<?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>NUS transmitting debug messages as well as my own data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67486/nus-transmitting-debug-messages-as-well-as-my-own-data</link><description>So I&amp;#39;m not sure that this is an error, but it is a little annoying. I have an application that sends sensor data using ble_nus. Works great, except that mixed in with my data on the nrfConnect phone app are the messages from the Segger RTT. I understand</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Oct 2020 14:34:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67486/nus-transmitting-debug-messages-as-well-as-my-own-data" /><item><title>RE: NUS transmitting debug messages as well as my own data</title><link>https://devzone.nordicsemi.com/thread/276678?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 14:34:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb1c9b01-c60c-4fe2-b289-629aac9e51fc</guid><dc:creator>SmallerPond</dc:creator><description>&lt;p&gt;This is a now heavily modified copy of ble_app_template, but there is a fine chance that I&amp;#39;m doing something wrong since this is my first crack at it.&amp;nbsp; I get a bunch of data from a 6-axis IMU, then just send that data over ble_nus in 244 byte chunks.&amp;nbsp; On the phone, I see my data, but I also get the rtt messages:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nRF Connect, 2020-10-21
NumText (F2:AC:A6:67:73:DA)
V 14:25:40.945 Connecting to F2:AC:A6:67:73:DA...
D 14:25:40.945 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D 14:25:41.144 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 14:25:41.144 Connected to F2:AC:A6:67:73:DA
V 14:25:41.152 Discovering services...
D 14:25:41.152 gatt.discoverServices()
D 14:25:41.163 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
I 14:25:41.814 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
D 14:25:41.948 [Callback] Services discovered with status: 0
I 14:25:41.948 Services discovered
V 14:25:41.953 Generic Access (0x1800)
- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
- Central Address Resolution [R] (0x2AA6)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Nordic UART Service (6e400001-b5a3-f393-e0a9-e50e24dcca9e)
- RX Characteristic [W WNR] (6e400002-b5a3-f393-e0a9-e50e24dcca9e)
- TX Characteristic [N] (6e400003-b5a3-f393-e0a9-e50e24dcca9e)
   Client Characteristic Configuration (0x2902)
D 14:25:41.953 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 14:25:41.954 gatt.setCharacteristicNotification(6e400003-b5a3-f393-e0a9-e50e24dcca9e, true)
I 14:25:42.038 Connection parameters updated (interval: 45.0ms, latency: 0, timeout: 5000ms)
V 14:25:43.247 Enabling notifications for 6e400003-b5a3-f393-e0a9-e50e24dcca9e
D 14:25:43.247 gatt.setCharacteristicNotification(6e400003-b5a3-f393-e0a9-e50e24dcca9e, true)
D 14:25:43.248 gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0100)
I 14:25:43.343 Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
A 14:25:43.343 &amp;quot;Notifications enabled&amp;quot; sent
V 14:25:43.344 Notifications enabled for 6e400003-b5a3-f393-e0a9-e50e24dcca9e
I 14:25:45.240 Notification received from 6e400003-b5a3-f393-e0a9-e50e24dcca9e, value: (0x) 00-2C-FF-C8-FF-D2-00-02-00-09-00-07-00-00-00-00-00-00-00-2D-FF-C7-FF-D0-FF-FE-FF-F5-FF-FE-00-2D-FF-C7-FF-D0-00-07-FF-FF-FF-FF-00-2E-FF-C8-FF-D2-00-03-FF-F9-00-05-00-2E-FF-C8-FF-D4-00-02-00-06-FF-FB-00-00-00-00-00-00-00-2C-FF-C8-FF-D4-FF-FA-FF-FE-00-0B-00-2D-FF-C6-FF-D1-FF-F6-FF-E4-00-02-00-2E-FF-C6-FF-D2-FF-FF-FF-FA-00-01-00-2C-FF-C7-FF-D1-FF-F9-FF-F1-00-00-00-00-00-00-00-00-00-2C-FF-C8-FF-D2-FF-FC-00-00-00-04-00-2E-FF-C7-FF-D2-00-00-FF-FE-00-03-00-2D-FF-C7-FF-D2-00-02-FF-FD-00-00-00-2D-FF-C8-FF-D2-00-08-FF-FA-00-04-00-00-00-00-00-00-00-2D-FF-C7-FF-D3-FF-FB-00-00-FF-FA-00-2C-FF-C7-FF-D3-00-01-00-09-00-01-00-2C-FF-C6-FF-D2-FF-FF-FF-FD-00-02-00-2C-FF-C7-FF-D1-FF-F7-FF-F6-FF-F8-00-00-00-00-00-00-00-2C-FF-C7-FF-D2-00-0B-00-01
A 14:25:45.240 &amp;quot;�,����� � � �������-�����������-����� �����.����� ��� �.����� � ���������,��������� �-��������� �.��������� �,�����������������,��������� �.��������� �-����� �����-����� ��� �������-�����������,����� � � �,��������� �,�����������������,����� � &amp;quot; received
...
I 14:25:49.629 Notification received from 6e400003-b5a3-f393-e0a9-e50e24dcca9e, value: (0x) FF-AB-FF-3D-00-AF-FF-89-FF-39-FF-8C-FF-89-FE-93-01-09-FF-2E-FF-C9-FF-F5-FF-B3-00-00-00-00-00-00-FE-2B-01-AD-FE-E2-00-50-00-23-FF-A6-FE-30-02-58-FE-AC-00-2F-00-08-FF-FE-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-53-45-47-47-45-52-20-52-54-54-00-00-00-00-00-00-02-00-00-00-02-00-00-00-40-8E-03-00-64-53-00-20-00-02-00-00-45-00-00-00-45-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-40-8E-03-00-64-55-00-20-10-00-00-00-00-00-00-00-00-00-00-00
A 14:25:49.629 &amp;quot;���=�����9������ �.�������������+ ����P�#���0 X���/� ��������������������������������������������������������������������������������������������������SEGGER RTT������ ��� ���@� �dS� � ��E���E�������������������������������@� �dU� �����������&amp;quot; received
I 14:25:49.778 Notification received from 6e400003-b5a3-f393-e0a9-e50e24dcca9e, value: (0x) 35-37-2E-0D-0A-3C-69-6E-66-6F-3E-20-61-70-70-3A-20-42-4C-45-20-65-76-65-6E-74-20-72-65-63-65-69-76-65-64-2E-20-45-76-65-6E-74-20-74-79-70-65-20-3D-20-38-37-0D-0A-0D-0A-3C-64-65-62-75-67-3E-20-6E-72-66-5F-73-64-68-5F-62-6C-65-3A-20-42-4C-45-20-65-76-65-6E-74-3A-20-30-78-35-37-2E-0D-0A-3C-69-6E-66-6F-3E-20-61-70-70-3A-20-42-4C-45-20-65-76-65-6E-74-20-72-65-63-65-69-76-65-64-2E-20-45-76-65-6E-74-20-74-79-70-65-20-3D-20-38-37-0D-0A-0D-0A-3C-64-65-62-75-67-3E-20-6E-72-66-5F-73-64-68-5F-62-6C-65-3A-20-42-4C-45-20-65-76-65-6E-74-3A-20-30-78-35-37-2E-0D-0A-3C-69-6E-66-6F-3E-20-61-70-70-3A-20-42-4C-45-20-65-76-65-6E-74-20-72-65-63-65-69-76-65-64-2E-20-45-76-65-6E-74-20-74-79-70-65-20-3D-20-38-37-0D-0A-0D-0A-3C-64-65-62-75-67-3E-20
A 14:25:49.778 &amp;quot;57.
&amp;lt;info&amp;gt; app: BLE event received. Event type = 87

&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x57.
&amp;lt;info&amp;gt; app: BLE event received. Event type = 87

&amp;lt;debug&amp;gt; nrf_sdh_ble: BLE event: 0x57.
&amp;lt;info&amp;gt; app: BLE event received. Event type = 87

&amp;lt;debug&amp;gt; &amp;quot; received
I 14:25:49.929 Notification received from 6e400003-b5a3-f393-e0a9-e50e24dcca9e, value: (0x) 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
A 14:25:49.929 &amp;quot;����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������&amp;quot; received
...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;To actually send the data, it&amp;#39;s just breaking the buffer into 244 byte chunks (easy enough) and sending them with&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;while (ble_nus_tx_complete == 0);
            err_code = ble_nus_data_send(&amp;amp;m_nus, ble_data_buffer + (BLE_NUS_MAX_DATA_LEN * i++), &amp;amp;length, m_conn_handle);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s the only line I have that does any transmission.&amp;nbsp; So I shouldn&amp;#39;t be seeing the informational/debug messages in the nrfConnect app?&lt;/p&gt;
&lt;p&gt;**EDIT** So I&amp;#39;m guessing that I am sending too many data over nus and the pointer is over counting and running outside of my buffer and into the memory with the debug messages.&amp;nbsp; I&amp;#39;ll take a look.&amp;nbsp; I just thought that it was normal :-P&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS transmitting debug messages as well as my own data</title><link>https://devzone.nordicsemi.com/thread/276546?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2020 07:20:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f9a307e-e609-4b1c-8557-3c58b7ce4838</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure how the RTT messages&amp;nbsp;received on your chip are sent over NUS, are you using a default example from the nRF5 SDK or have you modified any of them yourself. The ble_app_uart sample only forwards the messages received over UART.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;
&lt;div style="left:189px;top:22.6335px;"&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>