What can cause CY_BLE_ERROR_INVALID_OPERATION other than CY_BLE_STACK_STATE_BUSY ?

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

cross mob
WiFl_1166056
Level 3
Level 3
10 replies posted 10 questions asked 5 replies posted

I am getting frequent failures where Cy_BLE_GATTS_SendIndication() returns  CY_BLE_ERROR_INVALID_OPERATION .

I'm fairly certain it's not caused by the BLE stack being busy because I check the stack before call the indication function:
( cy_ble_busyStatus[cy_ble_connHandle[0].attId] != CY_BLE_STACK_STATE_FREE )

I also set a breakpoint in my genericEventHandler() at case CY_BLE_EVT_STACK_BUSY_STATUS, but that event is never received.

I've stepped through the code as far as the call to Cy_BLE_GATTS_Indication(&param), but I can't find any source code for this function and the disassembly is not very enlightening.  Does anyone know where this source code is?

After I receive CY_BLE_ERROR_INVALID_OPERATION , I can't recover and keep getting that error until I restart the MCU.  I am trying to reset BLE as shown below.  No errors returned, but it doesn't help.
Cy_BLE_Stop();
cy_ble_initVar = 0u; // needed to let Cy_BLE_Start do initialization
Cy_BLE_Start(genericEventHandler);

I am using PDL 3.5.1.  BLE is configured in Peripheral role and Dual-Core mode (controller on CM0).

Any ideas are appreciated.
Thanks!

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

Hi,


The CY_BLE_ERROR_INVALID_OPERATION error code will be returned if the stack queue is full or for other reasons, the stack cannot process the operation.

I would suggest that:

  1. Please check the paramaters of Cy_BLE_GATTS_SendIndication(), to see if any wrong pointer were engaged.
  2. Please downgrade the PDL to several earlier versions, and then build and check if the issue still exists.
  3. Please burn your application to another PSoC 6 device, to test if the issue still exists.

Best regards

View solution in original post

0 Likes
2 Replies
WiFl_1166056
Level 3
Level 3
10 replies posted 10 questions asked 5 replies posted

Interestingly, this error does not occur if the BLE component is configured to be single-core, CM4.  However, then I don't have enough CPU time to do other tasks.

I have attached the debugger to the CM0 core when the error occurs and it seems to be looping through Cy_BLE_ProcessEvents().  I don't see any problems there. 

Perhaps there's some problem with the Inter Processor Communication?

Any ideas would be appreciated.

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

Hi,


The CY_BLE_ERROR_INVALID_OPERATION error code will be returned if the stack queue is full or for other reasons, the stack cannot process the operation.

I would suggest that:

  1. Please check the paramaters of Cy_BLE_GATTS_SendIndication(), to see if any wrong pointer were engaged.
  2. Please downgrade the PDL to several earlier versions, and then build and check if the issue still exists.
  3. Please burn your application to another PSoC 6 device, to test if the issue still exists.

Best regards

0 Likes