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

Data transfer to a characteristic is limited to 20 bytes

Hallo,

we are using an nrf5340 SOC together with the SDK v1.9.0.

When running the sample "ncs_ble_tutorial_part1"  from here  

https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/getting-started/posts/ncs-ble-tutorial-part-1-custom-service-in-peripheral-role

we observed that maximum 20 bytes can be written to the "MY_SERVICE_RX" characteristic.

My Question:

Which modifications have to done to increase the number of byte to be transferred from 20 to e.g. 500 ?

 

Best regards

Georg

Best regards Georg

Parents
  • Hallo,

    With the default kconfig settings the Bluetooth zephyr host and Softdevice controller will give you an ATT_MTU size of 23 bytes which limits your effective payload to 20 bytes after you account for the GATT header.

    With the following configuration you should be able to write up to 244 byte of payload in one write command:

    <project_dir>/child_image/hci_rpmsg.conf

    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
    CONFIG_BT_BUF_ACL_RX_SIZE=251

    <project_dir>/prj.conf

    CONFIG_BT_L2CAP_TX_MTU=247
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_BUF_ACL_RX_SIZE=251

    Project from tutorial with the updated configuration settings above:

    Best regards,

    Vidar

    Edit: here's another thread with a similar question : https://devzone.nordicsemi.com/f/nordic-q-a/87829/updating-mtu-size-for-tx-and-rx-with-android-ble-client

Reply
  • Hallo,

    With the default kconfig settings the Bluetooth zephyr host and Softdevice controller will give you an ATT_MTU size of 23 bytes which limits your effective payload to 20 bytes after you account for the GATT header.

    With the following configuration you should be able to write up to 244 byte of payload in one write command:

    <project_dir>/child_image/hci_rpmsg.conf

    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
    CONFIG_BT_BUF_ACL_RX_SIZE=251

    <project_dir>/prj.conf

    CONFIG_BT_L2CAP_TX_MTU=247
    CONFIG_BT_BUF_ACL_TX_SIZE=251
    CONFIG_BT_BUF_ACL_RX_SIZE=251

    Project from tutorial with the updated configuration settings above:

    Best regards,

    Vidar

    Edit: here's another thread with a similar question : https://devzone.nordicsemi.com/f/nordic-q-a/87829/updating-mtu-size-for-tx-and-rx-with-android-ble-client

Children
Related