8 Replies Latest reply on Jun 7, 2017 11:23 PM by rautinst_2245351

    Connection timeout in DeepSleep mode

    rautinst_2245351

      I am implementing Deep Sleep mode for low power consumption, I am able to achieve it but when MCU enters Low power mode, Bluetooth connection is lost with CySmart 1.2 . 

      Following are the connection parameters I am using: 
      #define MINIMUM_CONNECTION_INTERVAL (790u) /* 790 * 1.25 = 987.5ms*/ 
      #define MAXIMUM_CONNECTION_INTERVAL (800u) /* 800 * 1.25 = 1000ms*/ 
      #define SLAVE_LATENCY (0u) /* No slave latency */ 
      #define SUPERVISION_TIMEOUT (500u) /* Supervision timeout of 5 seconds*/ 

      IMO=12 Mhz 
      ECO trimmed to 3Mhz. 

      Please tell me how to maintain Bluetooth link with Cysmart 1.2 or any other App when device is in Deep Sleep mode.

         

      I also had "PSoC_4_BLE_LowPowerModes" project from Github, it works well and bluetooth connection is not lost while using that project but when I add my other code to the project then bluetooth connection is not maintained.

        • 1. Re: Connection timeout in DeepSleep mode
          e.pratt_1639216

          If you disable the interrupts before deepsleep to prevent "wonky" interrupt behavior, it will also prevent the wakeup interrupts from firing as well.

             

          Check your HandleLowPower.c file.

             

          Try using CyEnterCriticalSection() and CyExitCriticalSection(). (Not one hundred percent it will work, but iirc it should)

             

          Otherwise, you will probably need to disable the ISRs you don't want firing directly rather than doing a global disable.

          • 2. Re: Connection timeout in DeepSleep mode
            rautinst_2245351

            Thanks for reply Pratt, I have alo tried code using CyEnterCriticalSection() and CyExitCriticalSection() but it won't work

            • 3. Re: Connection timeout in DeepSleep mode
              anpm

              Hi ,

                 

              I tested your attached project on my pioneer kit with CySmart 1.2 and was not able to reproduce the issue.

                 

              Can you please let us know the steps to reproduce the issue?

                 

              Have you tested the project in pioneer kit or Custom board? If the issue is only in Custom board , then the problem may be on the PCB design.

                 

              Also please try keeping Bless interrupt high priority (number 0) in .cydwr of the project and try.

                 

               

                 

              Thanks & Regards,
              Anjana

              • 4. Re: Connection timeout in DeepSleep mode
                kania.dominik_1646476

                Hi Anjana / Pratt,

                   

                I have a simliar issue when using CYBLE-214009-EVAL. I am developing a sensor which initially connects fine to an Android app (both Cypress CySmart & my own app) but then drops the signal after ~4 seconds. Reading various articles, I understand that this is due to the Cypress BLE chip going into DeepSleep which essentially kills the existing Bluetooth connection?

                   

                What is the cleanest way to ensure that the device stays connected, and then just wakes up (keeps / re-establishes the connection) so that it continues to display information from the sensor via the app?

                   

                Thanks in advance.

                   

                Dominik

                • 5. Re: Connection timeout in DeepSleep mode
                  e.pratt_1639216

                  If you setup the hardware/software correctly, it will not lose connection upon sleep/deep sleep modes. The BLE chip will still function at those power levels if desired :)

                     

                  One method of testing would be to comment out the power mode (sleeping functionality) to see if it is really the sleep portion of the project causing the issue.

                     

                  Deep sleep should work fine for your application; Try changing what you are doing in the code you add? It sounds like that is the culprit from your descriptions in your original post. If the example project is working until you add your code, then the problem is quite possibly the code you added. :)

                     

                  Another thing to keep in mind, is that the chip only wakes upon certain interrupts (mostly hardware components, and WDTs), and will run starting immediately after the deepsleep/sleep function call. This means that if you are returning to deep sleep after running through main only once, it could be that you have more processing/things you need to handle before call deepsleep? Or you may need to call cyprocessevents() more frequently depending on what BLE functions you are calling?

                     

                  Here is a similar thread if you want more reading material: http://www.cypress.com/forum/psoc-4-ble/ble-connection-deep-sleep

                  • 6. Re: Connection timeout in DeepSleep mode
                    anpm

                    Hi Dominik,

                       

                    E.pratt is correct. If possible, share your project and steps to reproduce. So that we can look into it.

                       

                    Also, as you are using EzBle module, please make sure you have set the ECO capacitor trim value correctly as in the following KBA: http://www.cypress.com/knowledge-base-article/eco-capacitance-trim-values-ez-ble-modules-kba218990

                       

                    Thanks,
                    Anjana

                    • 7. Re: Connection timeout in DeepSleep mode
                      anpm

                      Hi rautinst_2245351,

                         

                      If you still facing issues of disconnection, please provide us the steps to reproduce issue.

                         

                      Thanks,
                      Anjana

                      • 8. Re: Connection timeout in DeepSleep mode
                        rautinst_2245351

                        Thanks for your reply, problem was with antenna section of the PCB, it has been solved with the new PCB.