I'd like to check if you find issue on your custom board, or DVK board? Based on your description, this issue is only occurred occasionally after "running long enough". I guess it might not be a explicit issue.
Anyway, please check firstly if the data to be updated is consistent with the settings in BLE customizer. For instance, the discovery mode.
I'm using the cy_ble_configPtr set by the customizer and I am only changing advData and advDataLength. The code is like this:
bool updateAdvertisement(cy_stc_ble_gapp_disc_data_t* advertisement)
if (advertisment->advDataLen <= CY_BLE_GAP_MAX_ADV_DATA_LEN)
cy_en_ble_api_result_t res = CY_BLE_SUCCESS;
memcpy(cy_ble_configPtr->discoveryModeInfo[cy_ble_advIndex].advData->advData, advertisment->advData, advertisment->advDataLen);
cy_ble_configPtr->discoveryModeInfo[cy_ble_advIndex].advData->advDataLen = advertisment->advDataLen;
if (Cy_BLE_GetAdvertisementState() == CY_BLE_ADV_STATE_ADVERTISING)
res = Cy_BLE_GAPP_UpdateAdvScanData(&cy_ble_configPtr->discoveryModeInfo[cy_ble_advIndex]);
CY_ASSERT(res == CY_BLE_SUCCESS);
return res == CY_BLE_SUCCESS;
Did you test on your custom board, or DVK board? Possible to attach simple project for us to reproduce this issue?
Hi, I had the issue on our custom boards. I'm currently working on creating a stripped down version to run on the development boards so I can see if can reproduce it on them
I have not been able to reproduce the problem on the development boards, but I got some other issues instead on the board (the periphal device is in state CY_BLE_ADV_STATE_ADVERTISING, but advertisement is not heard either by the central node or when I use a BLE scanning app on my phone, another issue is that Discconnect sometimes fails with CY_BLE_ERROR_NO_DEVICE_ENTITY even though I provide it with the bdHandle I received upon connection) so maybe I would've gotten it if it weren't for those other issues
However, I realized that I didn't have any checks that CY_BLE_EVT_GAPP_UPDATE_ADV_SCAN_DATA_COMPLETE was received before calling Cy_BLE_GAPP_UpdateAdvScanData() again. So I added that and noticed that CY_BLE_INVALID operation is received when calling Cy_BLE_GAPP_UpdateAdvScanData() in this situation.
However, it seems that the reason my code was able to call UpdateAdvScanData twice was that CY_BLE_EVT_GAPP_UPDATE_ADV_SCAN_DATA_COMPLETE was never received. This time between the two calls was 4.8 seconds and no complete event had been received in this period, even though Cy_BLE_GAPP_UpdateAdvScanData() had returned CY_BLE_SUCCESS.