- Please confirm whether you are following the steps mentioned in 5.4 Adding an Upgradable Stack OTA Bootloader
- Please ensure that CyBle_ProcessEvents is called at regular intervals in the firmware.
- Are you facing this issue in pioneer kit?
- The Stack-only mode requires additional heap memory. What is the stack project heap settings?
- Please share the error screen shot and BLE component connection interval settings.
Please ensure that CyBle_ProcessEvents is called at regular intervals in the firmware. If a custom function consumes more time for execution, call CyBle_ProcessEvents inside. If it does not help, please share the workspace to recreate at our end.
I temporarily solved the problem by turning off the LowPowerImplementation call during the high ble notification operation. Since the error messages on the CySmart sides were " 'Connection Terminated Notification' event received" and "Reason: CONNECTION_TIMEOUT", I have a feeling that the ble core in the upgradable stack mode had longer sleep cycle compared to non-OTA version of the code.
ECO trim is set to 0xa0a0 (CYBLE-222014-01) for both the stack and main app. The project is rather large and requires a constant 50Hz external interrupt and I2C communication. Let me see if I can pare the workspace down to the bare essential so you can replicate the issue on your side.
Looks like the
bleMode = CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP);
is the cause of the Timeout. Switching to
bleMode = CyBle_EnterLPM(CYBLE_BLESS_SLEEP);
when I turn on the 50Hz notification rate solves the BLE Timeout issue.
However, this does not explain why the App works fine with the DEEPSLEEP without the OTA upgradable stack but times out with the OTA upgradable stack.
Please have a look in the datasheet of the BLE component. V3.40 page 532
There is a known issue in the errate with a combination of DeepSleep and continuous notifications send within a short time frame.
Please test the proposed fix by adding the function call CyBle_SetSlaveLatencyMode(st_ConnectionHandle.bdHandle, 1); to CYBLE_EVT_GAP_DEVICE_CONNECTED inside the BLE event handler.
Unfortunately I am not sure why it should be OTA related.