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

Parents
  • Thank you. 
    I have added the config for the child image andwas able to update the MTU length without updating from Mobile application, but  I'm getting an follwing warning . Is this waring can be ignored?

  • You should resolve this yes, for instance by copy and paste the config from the two conf files I linked to. If you ignore this, then the packets will be split on air, reducing the throughput and increasing power consumption.

    Kenenth

  • sure, I will try that

    the reason for asking whether to ignore the warning is because the throughput sample build also has generated up same warning messages

  • I tried compiling the throughput example here as-is, no warnings. 

    Kenneth

  • 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
    
    

Reply
  • 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
    
    

Children
Related