If you can attach your project that would be much easier for debugging, but otherwise most of our comments will be speculation I think :)
support case created for this.
Update for future reference:
I used only fast scan to continuously scan for certain BLE advertisement events. The timing I used was the default values 30ms.
This meant that both scan window and scan interval was 30 ms. This caused my issue since there was almost no time where Rx/Tx were silent.
I changed the scan settings so that scan window < scan interval and this resolved the issue for me.
I'm having a similar issue.
In my case changing the scan window did not help. I updated BLE settings to remove the central role and still get CYBLE_ERROR_INVALID_OPERATION. calling CyBle_GapUpdateAdvData. This used to work so I must have done something. I'm at a loss what could cause this.
I added an ISR and a WDT since last time this worked - not sure how this has any bearing,just throwing it out there .
The comment for the function CyBle_GapUpdateAdvData says that the CYBLE_ERROR_INVALID_OPERATION is returned in the following cases
CYBLE_ERROR_INVALID_OPERATION | ADV Event is not closed, BLESS is active or ADV is not enabled.
Since CyBle_GapUpdateAdvData is called only when CyBle_GetBleSsState() == CYBLE_BLESS_STATE_EVENT_CLOSE I don't think the first 2 conditions apply. However how do I check if ADV is enabled? I'm assuming it is since the device is advertising. I can verify that in CySmart ( RSSI changes )
What else can cause CyBle_GapUpdateAdvData to return this error?
Any suggestions? I cannot share the project in the open forum - too much proprietary stuff.
Hi Andy. Glad you made it work. The reason that the update fails if window = interval is that updates can only take place when Tx/Rx is idle... which is never the case when window == interval.