nRF5340 - send large data over BLE

Hi

Currently, I am developing an application to send larger data over BLE through custom service. I have referred to multiple tickets on devzone was able to send the data by updating the MTU size by using the “Request MTU” option on the nRF connect mobile application.

Is it the right way of doing this or am I missing something?

Hardware/Peripheral – nRF5340-DK

Central – nRF connect Mobile application

SW Tools: vscode, ncsv2.0.2 and Zephyr version: 3.0.9

This is my prj.conf parameters I have added

CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

Changes made in peripheral code:

#define BT_L2CAP_RX_MTU (CONFIG_BT_BUF_ACL_RX_SIZE - BT_L2CAP_HDR_SIZE)

Thanks

Tchag

  • I have tried creating a new Freestanding application as-is using the "throughput" template but still getting the warnings.

    I have attached the template creation,  build cfg and build warnings screenshot  and config files for the sample application.

    Is this something issue with my toolchain installation or it is expected to be fixed during the dev based on the their env setups?

    1. hroughput-sample_app-creation

    2.throughput-sample_build-cfg3.throughput-sample_build-warnings

    #
    # Copyright (c) 2018 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    CONFIG_SHELL=y
    
    CONFIG_BT_DEVICE_NAME="Nordic_Throughput"
    CONFIG_BT=y
    CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_SMP=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_CENTRAL=y
    CONFIG_BT_MAX_CONN=2
    
    CONFIG_BT_SCAN=y
    CONFIG_BT_SCAN_FILTER_ENABLE=y
    CONFIG_BT_SCAN_UUID_CNT=1
    
    CONFIG_BT_THROUGHPUT=y
    
    CONFIG_BT_GATT_DM=y
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    
    CONFIG_BT_USER_DATA_LEN_UPDATE=y
    CONFIG_BT_USER_PHY_UPDATE=y
    CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n
    
    CONFIG_BT_BUF_ACL_RX_SIZE=251
    CONFIG_BT_GATT_CLIENT=y
    CONFIG_BT_ATT_PREPARE_COUNT=2
    CONFIG_BT_CONN_TX_MAX=10
    CONFIG_BT_L2CAP_TX_BUF_COUNT=10
    CONFIG_BT_L2CAP_TX_MTU=247
    CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
    CONFIG_BT_CTLR_PHY_2M=y
    CONFIG_BT_CTLR_RX_BUFFERS=2
    CONFIG_BT_BUF_ACL_TX_COUNT=10
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
    
    CONFIG_DK_LIBRARY=y
    CONFIG_DK_LIBRARY_DYNAMIC_BUTTON_HANDLERS=y
    
    
    ########################CHILD IMAGE hci_rpmsg.conf
    #
    # Copyright (c) 2021 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
    CONFIG_BT_BUF_ACL_RX_SIZE=251
    
    CONFIG_BT_MAX_CONN=2
    
    

  • Looks like there is an issue with the vs code extension, if you build straight from the \v2.0.2\nrf\samples\bluetooth\throughput it compiles with no problems. In both cases the compiled hex file is identical, so I assume you can ignore the problem in this case. The vs code exension team is looking into it, and it should be fixed in next release (~month).

    Kenneth

  • thanks Kenneth. Did you use prj.conf file to build the sample?

  • Thanks..
    I was able to fix the warning by removing "CONFIG_BT_CTLR_DATA_LENGTH_MAX" to child_image .conf file

Related