Setting CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 but payload is limited to 229 bytes.

We are running an HCI controller on nRF52833 based on the Zephyr hci_uart sample code. We are using the Zephyr 3.7.0 LTS version.

We have set CONFIG_BT_CTLR_DATA_LENGTH_MAX=251 and CONFIG_BT_L2CAP_TX_MTU=247

Everything is working as long as our payload size is <= 229 bytes, but we need to understand the 18 byte difference between the configured MTU and the "real" MTU we are getting.

Note the following:

  • The nRF52833 is a HCI controller acting as a central. (See hcu_uart sample.)
  • The peripheral is reporting an MTU of 251 bytes (using ATT_EXCHANGE_MTU_REQ HCI command)
  • We are using the ATT_WRITE_CMD to send L2CAP PDU over HCI to the nRF52833 controller (via UART)
  • If the payload size of the PDU is <= 229 bytes everything works
  • If the payload size is > 229 bytes nothing gets transmitted
    • A sniffer shows no data over the air
    • If ATT_WRITE_REQ is used, not ack (ATT_WRITE_RSP) is received

We don't necessarily need more that 229 bytes of payload. We are just trying to understand the 18 bytes of discrepancy/overhead so that we can implement our firmware properly and robustly.

Thank you in advance for any help you may give!

-Mike 

Related