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

Increasing MTU breaks ble_app_uart (SDK12, S132)

Hi,

I've read in your press release for SDK 12 that increasing the MTU beyond 23 bytes is now possible on the nRF52. I thought I'd test this increase out on my nRF52 with your example ble_app_uart program from the Getting started tutorial.

Unfortunately, changing the MTU breaks the ble_app_uart program. Setting GATT_MTU_SIZE_DEFAULT in /path/to/sdk/components/softdevice/s132/headers/ble_gatt.h:57 to anything but 23 causes the program to no longer function correctly, including LED1 no longer blinking every 2 seconds and "Nordic UART" no longer being a connectable device in the nRF Toolbox iOS app.

Is this a program bug, or are increased MTUs not supported by the SDK example programs?

Parents
  • That's not how you change the MTU, changing defines in the header files for the softdevice is not going to do anything except break things. Read the release notes for the V3 softdevice to understand what changes you need to make to negotiate the MTU size with the other side. It requires setting up your max MTU and doing some API calls and then figuring out what you ended up with, much more work than just changing a define.

  • also remember that peer device may reject MTU change requests so your code must be written to take it into account. Most notably you'll still have to support 'long write' procedures for characteristics longer than 20 bytes for compatibility with devices not allowing long MTU and at the same time support 'normal write' for those which will accept long MTU.

Reply
  • also remember that peer device may reject MTU change requests so your code must be written to take it into account. Most notably you'll still have to support 'long write' procedures for characteristics longer than 20 bytes for compatibility with devices not allowing long MTU and at the same time support 'normal write' for those which will accept long MTU.

Children
No Data
Related