cancel
Showing results for 
Search instead for 
Did you mean: 

MTU size and Characteristic size config

DS.4
Senior II

Dear ST/forum members,

I am trying to configure the BLE slave side.

Using latest CubeMx (BLE_Custom.ioc ) and BLE_DataThroughput configuration as reference.

My questions:

1. CFG_BLE_MAX_ATT_MTU is restricted to 300 in CubeMx? Why is that? Can I make it 512 or more in code?

2."Value Length" of the characteristic is restricted to max of 247 in CubeMx, while in Data_Throughput example it is 255? Which one is it than? Can I make it 512? In AN5289 7.6.5 says something about getting data fragmentation? Will that cause through put loss?

3.Anything I can set in the advertisement data to, in order to improve connection speed? was wondering if increasing  usSlave_Conn_Interval_Min, usSlave_Conn_Interval_Max will allow faster connection? or something else that will it improve the Min_CE_Length and Max_CE_Length the master chooses.

4.How can I read (as the slave) the final value of connection CE_Length ?

Min_CE_Length < ??? < Max_CE_Length.

Thanks!

3 REPLIES 3
Remi QUINTIN
ST Employee

Max supported value for CFG_BLE_MAX_ATT_MTU is 512. So you should be able to modify it in your code.

Need to check why CubeMX restricts this value to 300 max;

The length of the characteristic is defined (aci_gatt_add_char) as 255 but only 249 bytes will be possibly sent as the total length of the parameters for the aci_gatt_update_char_value function shall not exceed 255.

In all cases, when MAX_ATT_MTU=512, the max data length that can be sent in a frame at GATT level is ATT_MTU-3. This means 509.

Use aci_gatt_update_char_value_ext function to send long data.

CE_length parameters are not part of the connection_complete_event. So the application running on the slave device has no mean to know those values.

DS.4
Senior II

Thanks, So if I can use max MTU and sent almost 512 bytes in each packet , with the overhead and everything, why should the BLE_DataThroughput example use less?

I thought bigger MTU faster things go?

Do all BLE's masters chips (android, IOS, etc..) support max MTU?

Remi QUINTIN
ST Employee

With ATT_MTU=251, higher throughput can be achieved close to the highest theoretical values.

Moreover, the hci_le_set_data_length function, which can avoid the fragmentation at link layer level has a max value of 251.

Performing some tests with the aci_gatt_update_char_value_ext function, the throughput is not increased that much.

Recent cell phones support 512 bytes but some older ones support less.