BLE Data Length Extension w/ RTT Logging

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:

#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# 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="LiteBEST"
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

I have used Lesson 3 Exercise 2 from Nordic Academy code and the prj configs, which can be found at this GitHub linkto create the above prj.conf and attached (please_work.zip) code base. Here is the expected output from that prj.conf and code: 

expected output showing increased data length on BLE link layer

When I add the following lines to my config (the prj_candi.conf file), I get the unexpected output of the default BLE link layer packet size = 27 bytes. 

# enable RTT logging
CONFIG_PRINTK=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_LOG_BACKEND_RTT=y 

Following is the unexpected output:

unexpected BLE link layer packet length

I'll reiterate: the only change is the config file and, obviously, how I'm observing the incoming data, VCOM port vs JTAG. 

This is the same issue I was experiencing as described in my previous ticket's later replies, which I thought I had a workaround for, but I do not. Please help me understand why this is happening and how I can solve this. If you'd like BLE sniffer logs to further prove this, you can refer to the linked ticket, or I can provide more upon request, but I think you'll be able to recreate the problem using the attached zip. Please create a build using the default "prj.conf" file, this should work as expected on an nRF5340 dev kit when examining the output over VCOM1, and then a second build using the "prj_candi.conf" file and examine using RTT.

This is the minimum code/project I could come up with to recreate the issue I'm having in my main codebase. Thank you so much for your time and effort. 

Respectfully,

Brady Adcock

---

Tools Used: 

Toolchain and SDK are both v2.4.1
Windows 11, Version 10.0.22621 Build 22621
nRF5340-DK, PCA10095
nRF Connect for VS Code v2023.9.336
Pixel 7 Pro, android version 13, build #TQ3A.230901.001.C2
Entire Project zip w/ build: 

Parents Reply Children
No Data
Related