6 Replies Latest reply on Sep 15, 2016 2:06 AM by user_4121894

    BLE and DeepSleep problem




      I have a very big problem with DeepSleep in my project.


      I use the CY8CKIT-042-BLE with the CY8CKIT-043A device. I have a very big project with an SPI-RTC, an SPI-LCD-Display, an adc, an Op-Amp, a timer, a reset-watchdog and of course the BLE-Component.


      The RTC generates an interrupt each second and triggers the adc to do a measurement. Beside that a timer-component generates a 40ms-Interrupt for the handling of the BLE. Thats o.k. It works perfect if I use the "Sleep" mode.


      I used the Global-Signal component with the "AllPortInt" and a custom ISR to wake up the device from the GPIO-Interrupt from the external RTC.


      If I try to use the "DeepSleep" according to the example, I see that the device wakes up one time and then it is stuck in an endless loop. In the picture I added you see that the DeepSleep is entered (first signal goes low). It is interrupted by the BLE-component for some milliseconds. But if the RTC triggers (falling edge) the DeepSleep is left and never entered again. At 5.5s it looks like the AllPortInt triggers again, but I don't know why. I clear the interrupt in the ISR by calling _ClearPending() in both, the single GPIO-ISR and the AllPortInt-ISR.
      This is the call stack from this situation:


      0 CySysPmSleep() .\Generated_Source\PSoC4\cyPm.c 52 0x0000874A (All)
      1 ll_exit_low_power_mode() ?????? ?????? 0x0000DC06 (All)
      2 ll_task_handler() ?????? ?????? 0x000112C8 (All)
      3 llft_service_queue() ?????? ?????? 0x00011AAE (All)
      4 llf_task_start_routine() ?????? ?????? 0x00011A06 (All)
      5 CyBle_StackTaskHandler() ?????? ?????? 0x0000C3E6 (All)
      6 OS_scheduler() ?????? ?????? 0x0000D276 (All)
      7 CyBleStackMgr_ProcessBleEvents() ?????? ?????? 0x0000C116 (All)
      8 CyBle_ProcessEvents() ?????? ?????? 0x0000BE38 (All)
      9 main() .\main.c 98 0x00000444 (All)


      I have no clue what I should do now?
      I hope that anybody can help me!


      Thanks Andreas