Optimizing BLE Middleware 3.6 throughput

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Panometric
Level 5
Level 5
100 sign-ins 100 replies posted 10 solutions authored

Streaming some live sensor data, (~60 kB/s)  as notifications, and it works pretty well. But sometimes. I'm seeing cases where the CY_BLE_EVT_STACK_BUSY_STATUS  is busy too long. 

In: Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60  under CY_BLE_EVT_STACK_BUSY_STATUS  it says "To increase the BLE Stack's default queue depth(CY_BLE_L2CAP_STACK_Q_DEPTH_PER_CONN) and achieve better throughput for the attribute MTU greater than 32, use the AddQdepthPerConn parameter in the 'Expression View' of the Advanced tab in the BLE component GUI. To Access the 'Expression View', right click on the 'Advanced' tab in th BLE Component GUI and select the 'Show Expression View' option."

But these instructions seem to be for PSoc Creator, not Modus TB. 

How do you make this change in ModusTB, or is it even necessary? Note I have the Link Layer maxed out at 251b, and L2CAP MTU set to my largest normal packet size. 

0 Likes
9 Replies
Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

Hi,

I need to confirm that: are you using BLE Middleware 2.6 in ModusToolbox?

Best regards

0 Likes
Panometric
Level 5
Level 5
100 sign-ins 100 replies posted 10 solutions authored

@Charles_Lai No, so sorry for the typo, 3.6 as the link shows. 

0 Likes
Charles_Lai
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 sign-ins

Hi,

'AddQdepthPerConn' is a param used in the middleware BLESS. In fact, BLESS is used in early PSoC 6 BLE project architecture, in early MTB versions (<=2.1).

If you need to use this parameter in MTB, try to use MTB v2.1 and create an early PSoC 6 BLE project inside it. Then in Library Manager, confirm BLESS is displayed and selected. Then alter the param in BLESS's code.

But BLESS has been iterated to BTSTACK in the latest PSoC 6 BLE architecture, in the latest MTB version.

If you need to use the latest MTB version and the newer PSoC 6 architecture, you might need to find an equivalent way to do this. (Or the issue might have been resolved in BTSTACK so it might not be a problem anymore :D)

Best regards

0 Likes
Panometric
Level 5
Level 5
100 sign-ins 100 replies posted 10 solutions authored

@Charles_Lai You have only given me options that seem impossible. Bless 3.6 is what was recommended for MTB 2.4, and since MTB 3.0 does not support it at all,  and we have invested lots in testing in 2.4, it's not like I can  upgrade to 3.0, or revert from 2.4 to 2.1.  I do not find that parameter in the Bless 3.6 code, except in the comments mtb_shared/bless/release-v3.60.0/cy_ble_stack.h in what looks like an abandoned comment. 

But what we are seeing is cases where the stack becomes unresponsive under high load, and this queue depth is cited as a reason. Yet, I can find no place to change it in 3.6.  Is there anything that can be configured to make 3.6 more capable of higher throughput  loads?

0 Likes

I'm sorry but BLESS is normally used in PSoC Creator and BTSTACK is used in MTB, in our design. And BLESS stopped receiving updates for a while.

Try to use BTSTACK instead. See the repo:
https://github.com/Infineon/btstack
https://github.com/Infineon/btstack-integration

0 Likes
Panometric
Level 5
Level 5
100 sign-ins 100 replies posted 10 solutions authored

@Charles_Lai MTB 2.4 offers  this example: https://github.com/Infineon/mtb-example-psoc6-ble-throughput-freertos/blob/master/README.md . So you are saying this should not be used? 

Is there a porting guide from BLESS to BTSTACK?
Is there a similar throughput example for BTSTACK?

0 Likes

https://github.com/Infineon/mtb-example-psoc6-ble-throughput-freertos is an old code example that belongs to the LIB flow projects. LIB flow projects will receive the best compatibility in MTB 2.1 because MTB 2.1 only supports LIB flow projects (although you can still download it in MTB 2.4).

I'm saying this because the code example is offered in mtb-ce-manifest.xml, not mtb-ce-manifest-fv2.xml. See below:
https://github.com/Infineon/mtb-ce-manifest

And it did require using BLESS, not BTSTACK. So if you stick to it, then you have to stick to the LIB flow.

Beginning in MTB 2.2, the new MTB flow is encouraged to use and the old LIB flow support is stopped after MTB 3.0. And BLESS is not used in any of the MTB flow projects.

About the LIB/MTB flow, please see section 2.3 of the MTB user guide:
https://www.infineon.com/dgdl/Infineon-ModusToolbox_2.4_User_Guide-UserManual-v01_00-EN.pdf?fileId=8...

And luckily we offer https://github.com/Infineon/mtb-example-btsdk-ble-throughput by the MTB flow.

0 Likes

@Charles_Lai We already used the MTB flow. But, I do not see how to this example is compatible with the CYBLE416045-02. What is required to port to that platform?

DM-FS
Level 1
Level 1
10 sign-ins First question asked 5 sign-ins

Same question here.

The problem is not the LIB flow or MTB flow (because BLESS can be integrated with MTB flow in MTB 2.4) but how we can use BLESS or migrate to another stable and documented BLE-stack API.

Please, Cypress-Moderator, note that the question about 'AddQdepthPerConn' parameter and throughput optimization came here because, in the BLESS API documentation, the parameter is mentioned.

If it is an error in the API documentation, please inform us.

Best,