cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to change ATT MTU value on STM32WB55

SPuge.1
Associate II

I play with two STM32WB55 eval boards and BLE_CableReplacement project.

It seems that whatever I try, I'm not able to change ATT MTU value to get more data troughput. It is set to 156 in the original project but it seems to stay at the default value 23. I've checked everything in source code and it looks correct.

I use STM32Cube_FW_WB_V1.12.1 and I've upgraded the firmware accordingly (stm32wb5x_BLE_Stack_full_fw.bin).

What can I try now ?

I also play with BlueNRG-LP and I can read the same limitation to 20 bytes when calling aci_gatt_clt_write_without_resp(), in project BLE_SerialPort_Master_Slave, (Send_Data_Over_BLE() in serial_port.c).

2 REPLIES 2
Remi QUINTIN
ST Employee

You can refer to AN5289 Rev 4 - 7.6.5 How to maximize data throughput

You should also have a look at the BLE-DataThroughput project whose purpose is to achieve the highest throughput.

Back to the data exchange configuration:

the command aci_gatt_exchange_config allows the exchange of the max supported ATT_MTU supported by each device. The result will be the minimum between both of them. If each device supports same MAX_ATT_MTU value, this command allows the sending of data of (CFG_BLE_MAX_ATT_MTU - 3) length.

With #define CFG_BLE_MAX_ATT_MTU (251) // in app_config.h

The command hci_le_set_data_length allows to have no fragmentation at Link Layer level.

tBleStatus status = hci_le_set_data_length(connHandle,251,2120);

Those value are used to have unfragmented data at LL layer with max data = 244. This improves the throughput.

aci_gatt_exchange_config may be sent either by the central or by the slave.

If data is sent from both sides and no LL fragmentation wanted, hci_le_set_data_length needs to be sent by each device.

You can also have a look at lease have a look at the programming manual PM0271 “ble-stack-programming-guidelines�?.

SPuge.1
Associate II

Hi Remi,

Thanks for your quick answer.

I've already read the documentation you said. I could understand how to achieve the highest data throughput, but it doesn't work in the project. In fact I wonder if the problem comes from MTU value.

I added a call to aci_gatt_exchange_config() in client. I receive the right value in Server_RX_MTU (251). I removed the call because I have a strange side effect: no data is send anymore from client to server !

Anyway, I still have the return value BLE_STATUS_INVALID_PARAMS from aci_gatt_write_without_resp() when Attribute_Val_Length is 21 or more. Why ? Is it related to MTU or to communication with CPU2 ?

Project BLE-DataThroughput use aci_gatt_update_char_value(). Is there a difference with aci_gatt_write_without_resp() regarding data length ?