cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the BLE communication setup using STM32WB55?

KKIM.6
Senior

I'm using STM32WB55 and communicating with a program using Windows BLE APIs.

My system affords BLE 5.2 version and I know it affords 2 Mbps.

However, I don't know how to change the BLE setup in the microcontroller and my program.

Currently, my microcontroller can send 244 bytes of data per packet.

So, Here is some question.

  1. How to change ATT-MTU (number of bytes per packet), Connection Interval, and number of packets. (or a good example for this)
  2. Whether, if I change these BLE setups, the BLE setup of the Windows program automatically changed. (or how to change Windows BLE setup using Windows APIs)
  3. How to transfer multi packets (or a good example for this)

I hope your comments.

1 ACCEPTED SOLUTION

Accepted Solutions
Remy ISSALYS
ST Employee

Hello,

In order to change ATT MTU size, you can change the value of the following define in app_conf.h:

/**
 * Maximum supported ATT_MTU size
 * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1"
 */
#define CFG_BLE_MAX_ATT_MTU             (156)

In BLE_p2pServer example, you can change the connection interval using SW2, see Connection_Interval_Update_Req function in app_ble.c file.

You can also increase the data characteristic value size.

The BLE parameters of your Windows program change automatically according to it's capabilities.

Best Regards

View solution in original post

5 REPLIES 5
KKIM.6
Senior

My custom C# program can get a ~130 packet per second using subscribe mode (continuous communication). It would mean the connection interval act as a bottleneck to increasing the speed (generally speaking, the initial connection interval is 7.5 ms. So, ~130 packet per second makes sense.)

Remy ISSALYS
ST Employee

Hello,

In order to change ATT MTU size, you can change the value of the following define in app_conf.h:

/**
 * Maximum supported ATT_MTU size
 * This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS is set to 1"
 */
#define CFG_BLE_MAX_ATT_MTU             (156)

In BLE_p2pServer example, you can change the connection interval using SW2, see Connection_Interval_Update_Req function in app_ble.c file.

You can also increase the data characteristic value size.

The BLE parameters of your Windows program change automatically according to it's capabilities.

Best Regards

Thanks for the clear comment but I have one more question.

Where could I modify the connection interval? and is it possible?

I checked both file for ATT_MTU and Connection_Interval_Update_Req.

but still hard to understand.

I can see these options below but I cannot understand the meaning of each component.

#define CFG_BLE_NUM_GATT_ATTRIBUTES 68

#define CFG_BLE_MAX_ATT_MTU       (156)

#define CFG_BLE_ATT_VALUE_ARRAY_SIZE  (1344)

#define CFG_BLE_PREPARE_WRITE_LIST_SIZE     BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)

Where can I see a detailed example for these setups?

+ my current setup can send 245 bytes but I cannot understand why it is possible for the current setup.

Remy ISSALYS
ST Employee

Hello,

You can modify the connection interval once the connection is established after the connection update. You can also look BLE_DataThroughput example available in STM32CubeWB package maybe it can help you to understand.

Best Regards