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

PSoC™ 6 Forum Discussions

Panometric
Level 5
Level 5
10 solutions authored First comment on KBA First comment on blog

My app sends about 10 notifications per second. Sometimes it gets CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED from Cy_BLE_GATTS_SendNotification().


Should the memory allocated to the BLESS stack be increased and if so how is it done? I am using the COMPONENTS+=BLESS_HOST BLESS_CONTROLLER on the M4 configuration. 

Alternatively, what is the best course of action when this error is encountered?

 

0 Likes
1 Solution
Panometric
Level 5
Level 5
10 solutions authored First comment on KBA First comment on blog

@Yugandhar I was already doing it via a variable set from the stack callback CY_BLE_EVT_STACK_BUSY_STATUS event like the throughput example. 
But doing it directly like you said seems to work better. Must be a race condition there. 

View solution in original post

0 Likes
2 Replies
Yugandhar
Moderator
Moderator
Moderator
1000 replies posted 5 likes given First comment on blog

Hello,

Before sending a Notification from the Server could you please check whether the stack is busy or not. Send the notification when the stack is free as shown in below.

if(Cy_BLE_GATT_GetBusyStatus(appConnHandle.attId) == CY_BLE_STACK_STATE_FREE)
{
/* Send notification data to the GATT Client*/

Cy_BLE_GATTS_SendNotification();
}

Thanks,
P Yugandhar.

0 Likes
Panometric
Level 5
Level 5
10 solutions authored First comment on KBA First comment on blog

@Yugandhar I was already doing it via a variable set from the stack callback CY_BLE_EVT_STACK_BUSY_STATUS event like the throughput example. 
But doing it directly like you said seems to work better. Must be a race condition there. 

0 Likes