<?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>BLE Data Length Extension w/ RTT Logging</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/108088/ble-data-length-extension-w-rtt-logging</link><description>Hello, 
 
 I am using the nRF5340 development kit alongside the nRF Connect mobile application for Android to establish a BLE connection and update the link layer packet size to the maximum of 251 bytes. This works as expected when my config is the following</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Feb 2024 09:00:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/108088/ble-data-length-extension-w-rtt-logging" /><item><title>RE: BLE Data Length Extension w/ RTT Logging</title><link>https://devzone.nordicsemi.com/thread/468167?ContentTypeID=1</link><pubDate>Fri, 09 Feb 2024 09:00:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42872d62-3beb-4b4e-87d9-7e746ac0483a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;Brady&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;Looking futher, I noticed that the .config file of the hci_rpmsg is different when using prj_candi.conf and using an identical prj.conf. This means that among other things, the parameter&amp;nbsp;&lt;code&gt;CONFIG_BT_CTLR_DATA_LENGTH_MAX=251&lt;/code&gt; is missing, and then the default of 27 is used.&lt;/p&gt;
&lt;p&gt;The reason for this is that when you specify a configuration file in VS Code, that is added to the west build command as&amp;nbsp;&lt;code&gt;-DCONF_FILE=&amp;lt;conf_file&amp;gt;&lt;/code&gt;. And this will replace existing config files. And for child images, the same suffix will have to be used. So if you copy the existing&amp;nbsp;child_image/hci_rpmsg.conf to&amp;nbsp;child_image/hci_rpmsg_candi.conf, it will work (as that matches your conf file name prj_candi.conf). Alternatively, if you build from the command line, you could use&amp;nbsp;&lt;span&gt;&lt;code&gt;-D&lt;strong&gt;EXTRA&lt;/strong&gt;_CONF_FILE=&amp;lt;conf_file&amp;gt;&lt;/code&gt;. This is not supported by the VS Code plugin at the moment, but I have asked the team to look into if this should be supported (and perhaps the default).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Einar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Data Length Extension w/ RTT Logging</title><link>https://devzone.nordicsemi.com/thread/468065?ContentTypeID=1</link><pubDate>Thu, 08 Feb 2024 13:14:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9420f258-bec1-4785-af20-57be50838ed6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Brady,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for the video. I see that your description is correct. I originally just modified the prj.conf from the solution in the dev accademy execsize, but did not see the issue that way. I also did not see it when I took your project and just added the part for enabling RTT logging for prj.conf. However, if I use you prj_candi.conf, I see the issue.&amp;nbsp;&lt;/span&gt;&lt;span&gt;In other words, if I use an identical prj.conf which produce the exact same .config as with your prj_candi.conf, I do not see the issue. But with prj_candi.conf I do.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In short, I reproduce the same as you now. And the beaviour is not expected at all, but I need a bit more time to digg into this and try to understand what is going on. I will come back to you when I know more.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Br,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Einar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Data Length Extension w/ RTT Logging</title><link>https://devzone.nordicsemi.com/thread/467851?ContentTypeID=1</link><pubDate>Wed, 07 Feb 2024 08:47:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7941f7b-3c04-4ac7-85ee-0db642d2d286</guid><dc:creator>Viral Patel</dc:creator><description>&lt;p&gt;Hi Brady, I have been using the same configuration and getting the same error. But thank you very much for pointing out the RTT logging creating problems with the data length. I am able to update the data length without using the RTT.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Data Length Extension w/ RTT Logging</title><link>https://devzone.nordicsemi.com/thread/467817?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2024 21:41:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14b41fb2-b460-473f-b1f5-1ff38c73b715</guid><dc:creator>blue_dew</dc:creator><description>&lt;p&gt;Hey Einar!&lt;br /&gt;&lt;br /&gt;I hate to hear that you were not able to reproduce this behavior, so I decided to take a quick &lt;a href="https://youtu.be/EQ_EXsFWE3M?si=Lj8eWAiD3Dr1UwjQ"&gt;video &lt;/a&gt;walking you through the exact steps I took and the buttons clicked, as well as showing the live BLE sniffer trace in real time.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Attached are the BLE sniffer logs taken during the recording, and I&amp;#39;ll also show the screenshots from those moments below:&lt;br /&gt;&lt;br /&gt;1) default prj.conf build (&lt;a href="https://youtu.be/EQ_EXsFWE3M?si=IwmHGgdGrzebKvsI&amp;amp;t=357"&gt;timestamp 5:57&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Logger module
CONFIG_LOG=y

# Button and LED library
CONFIG_DK_LIBRARY=y

# Floating Point Unit
CONFIG_FPU=y

# Bluetooth LE
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME=&amp;quot;LiteBEST&amp;quot;
CONFIG_BT_LBS=y
CONFIG_BT_LBS_POLL_BUTTON=y
CONFIG_BT_GATT_CLIENT=y

# STEP 5 - Configure your preferred connection parameters
CONFIG_BT_PERIPHERAL_PREF_MIN_INT=800
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=800
CONFIG_BT_PERIPHERAL_PREF_LATENCY=0
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y

# STEP 8.2 - Enable PHY updates.
CONFIG_BT_USER_PHY_UPDATE=y

# STEP 12 - Update Data Length and MTU
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_L2CAP_TX_MTU=247

# Increase stack size for the main thread and System Workqueue
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_BT_RX_STACK_SIZE=2048&lt;/pre&gt;&lt;/p&gt;
&lt;p&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/video_5F00_walkthrough_5F00_expected_5F00_behavior_5F00_0557.png" /&gt;&lt;/p&gt;
&lt;p&gt;BLE sniffer trace for the above moment (&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/no_5F00_rtt_5F00_config_5F00_video_5F00_recording.pcapng"&gt;devzone.nordicsemi.com/.../no_5F00_rtt_5F00_config_5F00_video_5F00_recording.pcapng&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2) RTT config prj_candi.conf build (&lt;a href="https://youtu.be/EQ_EXsFWE3M?si=HBMShZ1XDrxnbhJQ&amp;amp;t=920"&gt;timestamp 15:20&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Logger module
CONFIG_LOG=y

# Button and LED library
CONFIG_DK_LIBRARY=y

# Floating Point Unit
CONFIG_FPU=y

# Bluetooth LE
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME=&amp;quot;LiteBEST&amp;quot;
CONFIG_BT_LBS=y
CONFIG_BT_LBS_POLL_BUTTON=y
CONFIG_BT_GATT_CLIENT=y

# STEP 5 - Configure your preferred connection parameters
CONFIG_BT_PERIPHERAL_PREF_MIN_INT=800
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=800
CONFIG_BT_PERIPHERAL_PREF_LATENCY=0
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y

# STEP 8.2 - Enable PHY updates.
CONFIG_BT_USER_PHY_UPDATE=y

# STEP 12 - Update Data Length and MTU
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_L2CAP_TX_MTU=247

# Increase stack size for the main thread and System Workqueue
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_BT_RX_STACK_SIZE=2048

# enable RTT logging
CONFIG_PRINTK=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_LOG_BACKEND_RTT=y &lt;/pre&gt;&lt;/p&gt;
&lt;p&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/video_5F00_walkthrough_5F00_incorrect_5F00_behavior_5F00_1520.png" /&gt;&lt;/p&gt;
&lt;p&gt;BLE sniffer trace for the above moment (&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/rtt_5F00_config_5F00_video_5F00_recording_5F00_ll_5F00_req_5F00_visible.pcapng"&gt;devzone.nordicsemi.com/.../rtt_5F00_config_5F00_video_5F00_recording_5F00_ll_5F00_req_5F00_visible.pcapng&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Again, I can not thank you enough for taking the time to help me out! I really appreciate it, Einar. I don&amp;#39;t think I need to re-attach the repository as it is the same in the video and attached earlier and the tools are the same. Thank you!!!!!!!!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Brady Adcock&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Data Length Extension w/ RTT Logging</title><link>https://devzone.nordicsemi.com/thread/467775?ContentTypeID=1</link><pubDate>Tue, 06 Feb 2024 15:00:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2a711d1-3065-49b6-8f6b-3d96bf9bb3a8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Brady,&lt;/p&gt;
&lt;p&gt;I am not able to reproduce this. When I take your project and add the Kconfigs you described for RTT, the&amp;nbsp;data length update procedure still happens. Are you sure this is the &lt;em&gt;only&lt;/em&gt; change you did? Can you share the code with these changes, as well as a sniffer trace that shows how this works on your end? Also, if you are able to provide more detailed steps in case I need to do something specific in order to reproduce it, that could be usefull.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>