This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

NRF Connect SDK 1.8.0 for nRF5340 Using Visual Studio Code

I have a working build for the nRF5340 DK that implements a custom service and communicates over BLE. As I add features, the binary for the Application Core changes; the binary for the Network Core remains the same. I have increased the MTU size to 185 to increase BLE throughput. That is also working. However, I am having issues with certain added configuration parameters within prj.conf, specifically CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y and CONFIG_BT_CTLR_DATA_LENGTH_MAX=251. Apparently, I am missing dependencies for these to become active. I believe there are configuration changes required within the Remote Core build (hci_rpmsg) in order for the configurations with prj.conf to work. There is discussion about a "child_image" folder that might address this, but it is very unclear to me how to add a child_image folder into the project.

My CMakeLists.txt has the following entries:

# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(veris_chemo_port)

target_sources(app PRIVATE src/main.c)

# Custom files and folders

target_sources(app PRIVATE
src/bluetooth/ble_interface.c
src/bluetooth/vcp_service.c
)

zephyr_library_include_directories(src/bluetooth)
zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth)

My prj.conf has the following entries:

# Enable DK LED and Buttons library
CONFIG_GPIO=y
CONFIG_DK_LIBRARY=y

# Configure logger
#CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=n
#CONFIG_LOG_BACKEND_RTT=n
#CONFIG_LOG_BACKEND_UART=y
#CONFIG_LOG_DEFAULT_LEVEL=3

# Configure Bluetooth
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_DEVICE_NAME="Veris Chemo Port"
CONFIG_BT_DEVICE_APPEARANCE=1362
CONFIG_BT_MAX_CONN=1

# Config Display Information Service
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n
CONFIG_BT_DIS_SERIAL_NUMBER=y
CONFIG_BT_DIS_SERIAL_NUMBER_STR="VCP_xxxxxxxxxxxx"
CONFIG_BT_DIS_FW_REV=y
CONFIG_BT_DIS_FW_REV_STR="00.01.01"
CONFIG_BT_DIS_HW_REV=y
CONFIG_BT_DIS_HW_REV_STR="00.00.00"
CONFIG_BT_DIS_MODEL="VCP MODEL X"
CONFIG_BT_DIS_MANUF="Veris Health"
CONFIG_BT_DIS_SETTINGS=y

#CONFIG_BT_SETTINGS=y
CONFIG_SETTINGS_RUNTIME=y
CONFIG_SETTINGS=y
#CONFIG_SETTINGS_NONE=y

# Config Battery Service
CONFIG_BT_BAS=y

# Config Data Transfer for larger packet size
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_CONN_TX_MAX=10
CONFIG_BT_L2CAP_TX_BUF_COUNT=10
CONFIG_BT_L2CAP_TX_MTU=185
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BT_BUF_ACL_TX_COUNT=10
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

CONFIG_ASSERT=y
  • I was able to solve my issues.

    1) If changes to the network core are needed to speed up data transfers, there needs to be child_image subfolder added under the project folder. This new folder needs to include a hci_rpmsg.conf file. This file includes the configurations required to change the network core program. A good example of what the contents of hci_rpmsg.conf should be for improving data throughput can be found in the "throughput" example. CONFIG_BT_CTLR_DATA_LENGTH_MAX belongs in this config file, not the application config file (prj.conf).

    2) CONFIG_BT_L2CAP_DYNAMIC_CHANNEL does belong in the application config file (prj.conf) but has many dependencies that must be met before it can be activated. CONFIG_BT_SMP=y provides many (if not all) of the dependencies.

    3) To verify that hci_rpmsg.conf is being used in the build process, CMakeCache.txt within the build subfolder can be examined. If you see something like this:

    //Extra config fragments for hci_rpmsg child image
    .......<project folder>/child_image/hci_rpmsg.conf

    where your child image subfolder contents is being referenced, it was part of the build.

    By making the configuration modifications outlined in this ticket, I was able to improve the transfer of a 60000 byte data block from 75 seconds to 5 seconds. Knowing how to modify the network core program is a good thing to be able to do.

Related