cancel
Showing results for 
Search instead for 
Did you mean: 

Connection Interval modification of BlueNRG-M0

Reda
Associate

 

I am writing to you as I am currently a computer engineering student, tasked with optimizing Bluetooth Low Energy for connected glasses.

 I tried to optimize the connection interval of the device, as the chip is a BlueNRG-M0. I am aware that it's not possible to set the MTU to a value greater than 23 at the moment, despite it being Bluetooth 4.2.

So, I focused on optimizing the connection interval instead.

Initially, I tried to modify the Macros in the setup.c file (see attached image), thinking these were the CI values that the slave (the connected glasses) sent to the master (MacbookPro 2019).

 

Capture d’écran 2023-12-28 à 11.45.46.png

However, after using my Python scripts to test throughput while altering these parameters, I realized there was no difference. This indicated that the CI had to be modified elsewhere. Moreover, when the connection interval print in the JLink viewer appeared, it did not change at all despite my adjustments in the macro value.

I then attempted to change the master's connection interval value using system commands on Linux:
`echo 6 > sudo /sys/kernel/debug/bluetooth/hci0/conn_min_interval`

There were no errors when using these commands, yet the connection interval displayed in the JLink viewer remained the same. Furthermore, there were no changes in throughput either.

Unable to understand the source of the connection interval displayed in the JLink viewer, I scoured through all the codes and got the impression that this printed value was read from a data buffer received. This led me to believe that it should normally come from the Master. However, as mentioned earlier, this value does not change even when using Linux commands to modify the Master's Bluetooth stack.

Confused about the issue's origin, I then decided to use the function:

```
R_OS_TaskSleep(2000);

int status = aci_l2cap_connection_parameter_update_request(cc->handle,
6,
20,
0,
300);
```

The received status is 0, so the function executed correctly, in theory. However, the documentation states that this command should raise the flag: EVT_BLUE_L2CAP_CONN_UPD_RESP.

Yet, as shown in the attachment, neither of the two flags is raised in my code, and thus no print indicating that the connection interval has been successfully updated is displayed. I don't understand why.

Capture d’écran 2023-12-28 à 11.49.35.png

Additionally, how could I print the value of the new connection interval at the slave's end to see if the change has indeed occurred?

I apologize for writing such a lengthy problem, but I am truly at a loss regarding the source of my issue.

Thank you in advance,

Reda Bellafqih.

 

0 REPLIES 0