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

NUS Nordic UART Service+nRF Toolbox max TX length is 62 bytes

I run the ./nrf/samples/bluetooth/peripheral_uart example on 52840DK and connect to it using the nRF Toolbox UART section. 

The connection works and I can send messages to the 52840DK from iOS through the log tab.

The problem is that if the length of the message is more that 62 bytes I receive and error in the log saying:

Writing value to characteristic has failed

Error: The reuquest is not supported.

I checked the peripheral_uart, and the 52840DK doesn't receive any message. I am assuming this error is generated by the iOS App. Surprisingly,  mtu  = bluetoothPeripheral?.maximumWriteValueLength on the iOS App is actually 512 bits, but still iOS doesn't send a message longer than bytes.

Parents Reply Children
  • Hello,

    In the previous version, if the UART RX Characteristic had both Write and Write Without Response properties, the first one was used. iOS was trying to do Long Write procedure under the hood, which does not need to be supported by the device, or the available buffer size may differ. The central is not aware of peripheral's capabilities, so it returns maximumWriteValueLength as 512, which is the maximum value supported by spec. Also, writing with response is slower, as each packet needs to be confirmed by the peripheral link (?) layer, however it's more reliable due to the same reason.

    Since 5.0.4, in the case described above the .withoutResponse type will be chosen, so the app will take care of splitting into smaller chunks and will send them one by one. Here's the relevant commit.

  • Thanks for the explantation.

    The reason I asked is because I need to exchange large amount of data between the iPhone and NRF and I was wondering if I use UART, or need to modify it  or create my own device.

    Regards

Related