You are here

BLE Connection with Deep Sleep | Cypress Semiconductor

BLE Connection with Deep Sleep

Summary: 1 Reply, Latest post by bobgoar on 03 May 2016 07:10 PM PDT
Verified Answers: 1
Last post
Log in to post new comments.
jmccanna's picture
3 posts

I've been trying to get deep sleep functionality to work on a PSoC module and have not been able to get it to operate correctly. My intended code flow is to do the following:

  • Come out of hibernate with a button press
  • Connect to a BLE host
  • Configure sensors and watchdog and go into deep sleep loop
  • Waking up via watchdog every 5/30 seconds to read and send data over BLE then going back to deep sleep
  • Return to hibernate when BLE is disconnected for a set amount of time

The hibernate functionality works fine but the MCU locks up whenever I try to enter deep sleep. I pulled a HandleLowPowerMode function out of a project similar to this one ( but it hasn't worked correctly. I also tried speedycat's EasySleep library ( to the same result.

When I use HandleLowPowerMode without the CyEnterCriticalSection function calls, the deep sleep loop actually works but causes the BLE to drop. From what I saw in the documentation (and an example project), the BLE connection should remain active through the deep sleep call unless I missed something.

void HandleLowPowerMode(uint8 lpmSel)
    CYBLE_LP_MODE_T sleepMode;
    CYBLE_BLESS_STATE_T blessState;
    uint32_t interruptStatus;
    if (lpmSel == DEEPSLEEP)
        sleepMode = CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP);
        blessState = CyBle_GetBleSsState();
        interruptStatus = CyEnterCriticalSection();

        if(sleepMode == CYBLE_BLESS_DEEPSLEEP)
            if(blessState == CYBLE_BLESS_STATE_ECO_ON || blessState == CYBLE_BLESS_STATE_DEEPSLEEP)
                UART_UartPutString("Entering Deep Sleep...");
        else if (blessState != CYBLE_BLESS_STATE_EVENT_CLOSE)
            UART_UartPutString("Entering Sleep...");


I have the project attached in addition to the above code block. Any assistance would be appreciated!

user_242978793's picture
960 posts

Check out this information it explains the sleep and power reduction issues.

Log in to post new comments.