This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can't send more than 62 bytes using DLE?

When I enable DLE with a max MTU size of 247 (NRF_BLE_MAX_MTU_SIZE = 247) and PDU payload size of 251 (opt.gap_opt.ext_len.rxtx_max_pdu_payload_size = 251) and a max characteristic length of 244 (attr_char_value.max_len = NRF_BLE_MAX_MTU_SIZE - 3), and I try and send more than 62 bytes using nRF Connect on a Nexus 5X running Android 7.1.1, I get a fatal error displayed on my nRF52832 terminal window. I am currently using nRF5_SDK_12.0.0_12f24da and the s132_nrf52_3.0.0 softdevice. I have no idea why this occurs. At download, my terminal window indicates I have set my RAM start and size correctly and my Sodera LE suggests a successful MTU exchange request/response pair for an MTU size of 247 bytes following a connection. I can send any number of data bytes up to and including 62 data bytes, but if I try and send 63 data bytes, I get a fatal error. Any help to understand why this occurs and how I might correct the issue would be most appreciated.

  • FormerMember
    0 FormerMember

    Which function is returning the error?

  • Hello Kristin, Thanks for the response. I really can't tell what function is returning the error because it happens immediately on the write from the phone before the BLE_GATTS_EVT_WRITE event occurs. What I do notice on the Sodera LE is that the phone indicates a maximum of 123 octets for both TX and RX in response to the MTU exchange that occurs after the connection is established. What is somewhat interesting is the fact that 62 = (123 + 1)/2. Is this just a coincidence or could there be some significance to this? When I write 62 bytes to the characteristic, the write is successful and the Sodera LE ATT tab shows a Write Request entry with the following link layer data LE DATA: LLID: Start NESN: 0 SN: 0 SN+NESN: 0 MD: 0 SP: No SuppInfo Payload Length: 69 However, when I write 63 bytes to the same characteristic, I get the fatal error on the Nordic board with the Sodera LE showing a Write Request entry with the following link layer data: LE DATA: LLID: Start NESN: 1 SN: 1 SN+NESN: 3 MD: 0 SP: No SuppInfo Payload Length: 70 As best as I can tell, this is the only difference between the two write requests. Any ideas? Thanks for the help.

  • FormerMember
    0 FormerMember

    Okay, I see. could you upload the sniffer trace?

  • FormerMember
    0 FormerMember

    The error, it occurs in the nRF52, but not upon a function call?

    Could you run the chip in debug mode and check if there is an error that is caught by APP_ERROR_CHECK()?

    According to the Bluetooth Core Specification, the MTU exchange procedure is for exchanging the maximum RX capabilities for the two devices in a connection. So the 123 octets should be the RX capability for the phone. If you take detailed look at the sniffer trace, what is the MTU size set to in the Exchange MTU Response?

Related