Error Cy_BLE_GAP_GenerateKeys on CY8C6347xxx-BLD52

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

cross mob
manusharian
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Hello everybody,

Does any one really know why this error pops up: Cy_BLE_GAP_GenerateKeys returns API Error: 0x160004 CY_BLE_ERROR_INSUFFICIENT_RESOURCES ?

In the documentation we can find "If BLE Stack resources are unavailable.". What resources is this line referring too?  We use an app with OTA over BLE and everything is fine expect there are moments when we received this error.  

Any hints would be really appreciated!

Best regards,

Marian

0 Likes
1 Solution
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

Cy_BLE_GAP_GenerateKeys can return CY_BLE_ERROR_INSUFFICIENT_RESOURCES if HCI commands queue is FULL, so BLE stack can't allocate resource for this command.

Before calling Cy_BLE_GAP_GenerateKeys, if any other BLE functions are called without waiting the response (by event) then this error might occurs.
Please make sure that Cy_BLE_ProcessEvent function is called at regular intervals of time (refer to documentation for this function). Also, set the BLESS priority to the highest(i.e., priority should be 0).

If possible, please share your project for checking at our end.

Thanks,
P Yugandhar.

View solution in original post

0 Likes
2 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

Cy_BLE_GAP_GenerateKeys can return CY_BLE_ERROR_INSUFFICIENT_RESOURCES if HCI commands queue is FULL, so BLE stack can't allocate resource for this command.

Before calling Cy_BLE_GAP_GenerateKeys, if any other BLE functions are called without waiting the response (by event) then this error might occurs.
Please make sure that Cy_BLE_ProcessEvent function is called at regular intervals of time (refer to documentation for this function). Also, set the BLESS priority to the highest(i.e., priority should be 0).

If possible, please share your project for checking at our end.

Thanks,
P Yugandhar.

0 Likes

Hello,

Thanks for the fast response. Due to some problems with Infineon change password issues I was not able to accept the answer as a solution earlier. Indeed we called Cy_BLE_GAP_GenerateKeys based on event and the queue was full by that time. We add a cyclic processing thread for this and now the keys are generated correctly. 

Regards,

Marian

0 Likes