Please attach your project if possible so that we can reproduce the issue and find out the root cause. ( If not complete project please share a simplified project)
Some below points might help to resolve the issue.
-) Are you using Low Power Modes in your design? If yes , are you configuring the WCO sleep clock accuracy in the firmware? If yes , please go through the page #12 of below document for correct configuration.
-) Did you try with connecting CySmart PC tool with BLE -USB Dongle or CySmart Mobile App? Please with that and let us know your observations.
-) How many boards with CY8C-4248LQI-BL573 do you have? Please check if the issue is only with some boards or with all of the boards.
Please follow the below steps before programming your project.
1. Make sure you have kept Bless interrupt high priority (go to .cydwr of project -> Interrupts tab -> make bless interrupt priority to 0 (highest)).
2. Call CyBle_ProcessEvents in regular intervals. If any custom function is there which will consume more time for execution, please call CyBle_ProcessEvents inside it. May be any of your function for I2C write will be taking more time, if then try call CyBle_ProcessEvents it to see whether the issue fixes.
3. Do you have any Interrupt routine in your project? If then don't write big code inside ISR. Instead, set a variable inside ISR and check the variable status and call the function in main loop.
4. If the disconnection happens in custom board, check external crystal / clock settings. Check external crystals parameters meets specifications mentioned in our appnote: http://www.cypress.com/documentation/application-notes/an95089-psoc-4proc-ble-crystal-oscillator-selection-and-tuning.
5. Please set the ECO capacitor trim value for the EZ-BLE module correctly. Refer our KBA: http://www.cypress.com/knowledge-base-article/eco-capacitance-trim-values-ez-ble-modules-kba218990. It is mandatory to manually set the ECO capacitance trim value in the firmware or clock settings in below cases:
a. Creating new project with BLE component V3.1, V3.2 or V3.3.
b. Updating the BLE component.
Thanks & Regards,