cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

JoYe_1259141
New Contributor

I have an application running on the CYBLE-222014-01 that has a BLE notification triggered by an external interrupt ranging from 10Hz to 50Hz.  During each notification event, the device grabs 8 bytes of data from an external device via I2C and transmits it to the host.  The application works every well.  However, with the OTA upgradeable BLE stack integration, I can no longer maintain a stable connection.  The host side, CySmart, will report a connection timeout, while the device side the connection LED will still show a connection.  The external interrupt is still running and being serviced, I can confirm this on the logic analyzer.  The drop event happens a lot faster as the interrupt rate increases.  The strange thing is that all other non BLE related function on my application works just fine.  It seems like just the BLE stack is having issues.  Has anyone experienced anything similar?  Does the BLE stack in the bootloader mode have a different timing specification?  How does one go about tuning such parameter?

Thanks in advance,

John

0 Likes
Reply
1 Solution
AchimE_41
Employee

Hello John,

Please have a look in the datasheet of the BLE component. V3.40 page 532

pastedImage_0.png

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.

kind regards,

Achim

View solution in original post

0 Likes
Reply
8 Replies
GeonaP_26
Moderator
Moderator
  • 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.
0 Likes
Reply
JoYe_1259141
New Contributor

1. Followed all the steps in 5.4

2. Have to roll the design back.  I'll give that a try.  However, the design worked fine if I don't incorporate the OTA stack.  Which indicates that the board design is fine.

3. Heap 0x0400, Stack 0x0800.  I've tried 0x0800/0x1000 no difference.

4. BLE Error1.JPGConnectionSettings.JPG

0 Likes
Reply
GeonaP_26
Moderator
Moderator

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.

0 Likes
Reply
JoYe_1259141
New Contributor

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.

0 Likes
Reply
GeonaP_26
Moderator
Moderator

Please confirm ECO cap trim value is set as given in ECO Capacitance Trim Values for EZ-BLE™ Modules - KBA218990

If it does not help, please share the workspace to recreate the issue at our end.

0 Likes
Reply
JoYe_1259141
New Contributor

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.

0 Likes
Reply
JoYe_1259141
New Contributor

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.

0 Likes
Reply
AchimE_41
Employee

Hello John,

Please have a look in the datasheet of the BLE component. V3.40 page 532

pastedImage_0.png

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.

kind regards,

Achim

View solution in original post

0 Likes
Reply